Skip to content

Importing all observations and variables from csv file into dataframe

4 messages · Sally Ann Sims, jim holtman, R. Michael Weylandt +1 more

#
I would assume that you would use 'read.csv'.  I don't know where you
got the syntax for "summary";

x <- read.csv(("C:\\Documents\\R_dfiles\\H_N_T.csv",as.is=TRUE)
summary(x)
On Mon, Oct 17, 2011 at 2:56 PM, Sally Ann Sims <sallysims at earthlink.net> wrote:

  
    
#
You aren't reading the file in at all: notice that,
Length     Class      Mode
        1 character character

This is because you are asking for a summary of the string containing
the file name, not the file itself.

Rather, use

X = read.csv("C:\\Documents\\R_dfiles\\H_N_T.csv",header=TRUE,as.is=TRUE)

and then start looking at X which will be an R object (data frame most
likely) storing all the values of the spreadsheet.

Hope this helps,

Michael
On Mon, Oct 17, 2011 at 2:56 PM, Sally Ann Sims <sallysims at earthlink.net> wrote: