OK I have been trying to learn how to use this program and I cannot even import any data into it. I have downloaded all the manuals but they do not seem to help. Is there a book on R for dummies???
Basic Help
4 messages · Marisa Ramos, Ko-Kang Kevin Wang, Jason Turner +1 more
-----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Marisa Ramos Sent: Friday, February 13, 2004 8:49 AM To: R-help at stat.math.ethz.ch Subject: [R] Basic Help OK I have been trying to learn how to use this program and I cannot even import any data into it. I have downloaded all the manuals but they do not seem to help. Is there a book on R for dummies???
Chapter 7 in "An Introduction to R" explains how to read the data in, it should be pretty good....if you're still unsure, look at the documentation for read.table() and scan(). Chapter 2 of my incomplete book, http://www.stat.auckland.ac.nz/~kwan022/pub/R/RBook/, has a short explanation about data structure in R. The chapter has sort of been complete (it's in the draft version).... HTH, Kevin Wang -------------------------------------------- Ko-Kang Kevin Wang, MSc(Hon) Statistics Workshops Co-ordinator Student Learning Centre University of Auckland New Zealand
OK I have been trying to learn how to use this program and I cannot even import any data into it. I have downloaded all the manuals but they do not seem to help. Is there a book on R for dummies???
I don't know about dummies, but Peter Dalgaard's book, "Introductory Statistics with R" is an intro that is both gentle and thorough. Cheers Jason
Marisa, If the examples in R Data Import/Export can't help you you'll have to be way way way more specific. http://cran.r-project.org/doc/manuals/R-data.pdf I'm assuming you are using windows. Here's an example. Try saving the attached file to c:\temp and copying the commands below into R. This file junk.csv is a text file where each value is seperated by a comma. You can open it in Excel or with a text editor like notepad. Try looking at it with both. In windows it's often easiest to get you data from excel to R by saving it as a comma seperated file (.csv) from excel. Good luck, Andy #### Start copy and paste # Set the working directory so R knows where your files are setwd("c:/temp") # Read the data (see read.csv for comma seperated files too) some.data <- read.table(file = "junk.csv", header = T, sep = ",") # Now try some things with this data some.data summary(some.data) attach(some.data) a.model <- lm(Y ~ X1 + X2) detach(some.data) summary(a.model) # now look at the help pages for these commands ?read.table ?setwd ?lm ?summary ?attach ?detach #### End copy and paste Here's a copy of the attached file junk.csv which probably won't make it to the R-Help list. ID,Y,X1,X2,X3 1,2,2,75,645 2,5,6,35,8 3,73,2,754,323 4,8,7,26,76 5,3,21,6,25