Re: [R] how to import data from excel to R

2012-11-14 Thread Flavio Barros
Simple:

> install.packages('xlsx')
> setwd('C://) (Define directory with your file)
> data <- read.xlsx('file.xlsx', 1) (Read the first spreed sheet)

On Wed, Nov 14, 2012 at 3:25 PM, jim holtman  wrote:

> Also checkout the XLConnect package since it can read/write EXCEL
> files directly so that you do not have to go through the step of
> creating a CSV file.  Really nice when you want to create an Excel
> file with multiple worksheets containing different phases of your
> analysis.
>
> On Wed, Nov 14, 2012 at 8:45 AM, shwetank  wrote:
> > The simplest way, in my opinion is:
> >>save .xls file as .csv in ms excel "save as" option. csv means comma
> > delimited.
> >>now type following command on R console;
> > >mydata<-read.csv(file.choose())
> >  this will open a dialog box will open and select your .csv
> > file.
> > now the data will be saved as "mydata" is actually a data frame.
> >
> > Enjoy,
> > regards.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/how-to-import-data-from-excel-to-R-tp966629p4649487.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > __
> > R-help@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.
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
> __
> R-help@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.
>



-- 
Att,

Flávio Barros

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] how to import data from excel to R

2012-11-14 Thread jim holtman
Also checkout the XLConnect package since it can read/write EXCEL
files directly so that you do not have to go through the step of
creating a CSV file.  Really nice when you want to create an Excel
file with multiple worksheets containing different phases of your
analysis.

On Wed, Nov 14, 2012 at 8:45 AM, shwetank  wrote:
> The simplest way, in my opinion is:
>>save .xls file as .csv in ms excel "save as" option. csv means comma
> delimited.
>>now type following command on R console;
> >mydata<-read.csv(file.choose())
>  this will open a dialog box will open and select your .csv
> file.
> now the data will be saved as "mydata" is actually a data frame.
>
> Enjoy,
> regards.
>
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/how-to-import-data-from-excel-to-R-tp966629p4649487.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@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.



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

__
R-help@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.


Re: [R] how to import data from excel to R

2012-11-14 Thread shwetank
The simplest way, in my opinion is:
>save .xls file as .csv in ms excel "save as" option. csv means comma
delimited.
>now type following command on R console;
>mydata<-read.csv(file.choose())
 this will open a dialog box will open and select your .csv
file.
now the data will be saved as "mydata" is actually a data frame. 

Enjoy,
regards.
 



--
View this message in context: 
http://r.789695.n4.nabble.com/how-to-import-data-from-excel-to-R-tp966629p4649487.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread Steve Taylor
Or copy a rectangle of data in Excel, then grab it from the clipboard in R as 
follows:
 
  my.data <- read.table("clipboard",head=TRUE,sep='\t')
cheers,
   Steve
 

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread Charlie Sharpsteen
On Thu, Dec 17, 2009 at 9:24 AM,  wrote:
>
> Hi,
>   I am using R and I want to know how data can be transferred from Excel
> Spread sheet to R for analyzing. I have done like this
>
> mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");
>
>
> but its not working how can i do it


The "R Data Import/Export" manual covers this topic in general:

  http://cran.r-project.org/doc/manuals/R-data.html

Chapter 8 concerns getting data into and out of excel.  This post on
the Learning R blog also covers many available options for importing
directly from Excel files:

  
http://learnr.wordpress.com/2009/10/06/export-data-frames-to-multi-worksheet-excel-file/

Hope this helps!

-Charlie

__
R-help@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread Gabor Grothendieck
Check out these notes:

http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows

and note that within quotes you must double each backslash so one
writes "c:\\mydirectory\\abc.xls" for example.

On Thu, Dec 17, 2009 at 12:24 PM,   wrote:
> Hi,
>   I am using R and I want to know how data can be transferred from Excel
> Spread sheet to R for analyzing. I have done like this
>
> mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");
>
>
> but its not working how can i do it
>
>                                                      regards
>
>                                                    Sarath Sankar V
>                                               Spectrum Softtech Solution
>
> __
> R-help@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@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread David Winsemius


On Dec 17, 2009, at 11:24 AM, sta_2...@spectrum.net.in wrote:


Hi,
  I am using R and I want to know how data can be transferred from  
Excel

Spread sheet to R for analyzing. I have done like this

mydata<-read.table("C:\Documents and Settings\admin\Desktop 
\data.txt");



but its not working how can i do it


You've gotten three distinct suggestions, all of which are probably  
needed and none of which would completely fill in the missing aspects  
of your R-knowledge needed for success:


a) reading xls formatted files is possible with quite a few special  
functions possibly requiring importing packages.

b) reading exported tab or comma delimited files is possible.
c) your file specification would not have succeeded.
d) you did not report the full error message which suggests the you  
should now read the Posting Guide more thoroughly.
e) you should read the documentation in the Import Export Manual.  
(This is probably also illustrated in several of the introductory  
manuals, and we expect you to read at least one before posting  
questions.


Do some homework and then you should have an increase in your store of  
knowledge.


--
David.



 regards

   Sarath Sankar V
  Spectrum Softtech  
Solution


__
R-help@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@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread milton ruser
Hi Sarath, try

"C:\\Documents and Settings\\admin\\Desktop\\data.txt"
or
"C:/Documents and Settings/admin/Desktop/data.txt"

or yet

setwd("your path")
mydata<-read.table("data.txt")
cheers

miltinho

On Thu, Dec 17, 2009 at 12:24 PM,  wrote:

> Hi,
>   I am using R and I want to know how data can be transferred from Excel
> Spread sheet to R for analyzing. I have done like this
>
> mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");
>
>
> but its not working how can i do it
>
>  regards
>
>Sarath Sankar V
>   Spectrum Softtech Solution
>
> __
> R-help@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.
>

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread Joshua Wiley
Hey,

If you want to read it in as a text file, make sure to have Excel save it as
a text file first.  For instance, a tab delimited text file.  Then you could
read it in with

mydata <- read.table("myfile.txt", sep="\t")

HTH,

Josh

On Thu, Dec 17, 2009 at 9:24 AM,  wrote:

> Hi,
>   I am using R and I want to know how data can be transferred from Excel
> Spread sheet to R for analyzing. I have done like this
>
> mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");
>
>
> but its not working how can i do it
>
>  regards
>
>Sarath Sankar V
>   Spectrum Softtech Solution
>
> __
> R-help@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.
>



-- 
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] how to import data from excel to R

2009-12-17 Thread Richardson, Patrick
Well, first of all it doesn't look like you're trying to read an excel file as 
the file you are trying you specify is "data.txt" not "data.xls".

Try:

library(gdata)
?read.xls

HTH,

Patrick




-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of sta_2...@spectrum.net.in
Sent: Thursday, December 17, 2009 12:25 PM
To: r-help@r-project.org
Subject: [R] how to import data from excel to R

Hi,
   I am using R and I want to know how data can be transferred from Excel
Spread sheet to R for analyzing. I have done like this

mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");


but its not working how can i do it

  regards

Sarath Sankar V
   Spectrum Softtech Solution

__
R-help@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.
This email message, including any attachments, is for th...{{dropped:6}}

__
R-help@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] how to import data from excel to R

2009-12-17 Thread sta_2279
Hi,
   I am using R and I want to know how data can be transferred from Excel
Spread sheet to R for analyzing. I have done like this

mydata<-read.table("C:\Documents and Settings\admin\Desktop\data.txt");


but its not working how can i do it

  regards

Sarath Sankar V
   Spectrum Softtech Solution

__
R-help@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.