[R] To import data to R from Excel

Petr PIKAL petr.pikal at precheza.cz
Thu Aug 11 11:21:12 CEST 2011


Hi
> 
> In Excel, make sure that your data has a format that corresponds to an R 

> data frame (first row with column names, consistent column size and data 
type).
> Export your .XLS worksheet as .CSV file (mydata.csv).
> In R, read it into a data frame with
> 
> > read.csv( "mydata.csv" ) 

Another option is simple copy/paste way.

In Excel select the data area you want to transfer (preferably formatted 
like stated above.
Press Ctrl-C
Change to R
In R command window write 

my.data.frame <- read.delim("clipboard",...further options according to 
your locale...)

Regards
Petr

> 
> >From here, you shold be able to reshapte the data in a way that you can 

> draw your boxplot.
> 
> Rgds,
> Rainer
> 
> 
> On Thursday 11 August 2011 11:29:23 Blessy chemmannur Francis wrote:
> > Sir,
> >           I am a beginner in R language. I want to import data from 
excel to
> > R. My data contains not only numeric values but also string values.I 
want to
> > draw a boxplot graph . I can't import or write this string data. it is
> > essential for my graph.Please give me a suggestion for This.
> >            Thanking You,
> > 
> > 
> > BLESSY.C.F.
> > 
> >    [[alternative HTML version deleted]]
> > 
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list