Information Technology Reference
In-Depth Information
If you click on the Introductions tab, for example, you'll find tutorial material. The
Task Views tab will show any Task View that mentions your search term. Likewise,
clicking on Functions will show links to relevant R functions. This is a good way to
zero in on search results.
Stack Overflow is a so-called Q&A site, which means that anyone can submit a question
and experienced users will supply answers—often there are multiple answers to each
question. Readers vote on the answers, so good answers tend to rise to the top. This
creates a rich database of searchable Q&A dialogs. Stack Overflow is strongly problem
oriented, and the topics lean toward the programming side of R.
Stack Overflow hosts questions for many programming languages; therefore, when
entering a term into their search box, prefix it with “[r]” to focus the search on questions
tagged for R. For example, searching for “[r] standard error” will select only the ques-
tions tagged for R and will avoid Python and C++ questions.
Stack Exchange (not Overflow) has a Q&A area for Statistical Analysis. The area is
more focused on statistics than programming, so use this site when seeking answers
that are more concerned with statistics in general and less with R in particular.
See Also
If your search reveals a useful package, use the install.packages function to install it
on your machine.
1.5 Reading Tabular Datafiles
Problem
You want to read a text file that contains a table of data.
Solution
Use the read.table function, which returns a data frame:
> dfrm <- read.table("filename.txt")
Discussion
Tabular datafiles are quite common. They are text files with a simple format:
• Each line contains one record.
• Within each record, fields (items) are separated by a one-character delimiter, such
as a space, tab, colon, or comma.
• Each record contains the same number of fields.
 
Search WWH ::




Custom Search