[R] converting to data frame

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Sep 10 11:29:57 CEST 2004


Vito Ricci <vito_ricci at yahoo.com> writes:

> Hi,
> 
> see  ? read.csv  and use read.csv() to read the csv
> file, after convert as a data.frame see: 
> 
> ? as.data.frame
> 
> it forces into a data.frame;
> 
> e.g. you've the data csv file: data.csv
> 
> mydata<-read.csv('C:/data.csv')
> mydf<-as.data.frame(mydata) ## data as dataframe

Eh? The return value from read.csv() *is* a data frame! 

Notice, by the way, that you need read.csv2() in locales which use
comma as decimal separator.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list