[R] simple data import of .csv

2010-04-10 Thread doconnor

Hello,

I am a complete beginner to R.  I use a mac and want to import and read a
.csv dataset stored as .csv file.

I understand I eventually enter <- read.csv("size.csv", header=T)   , but I
can't get R to find my file, which is called size.csv and located
/Users/davidoconnor/Desktop/Eart-125/size.csv

Thank you very much!

David
-- 
View this message in context: 
http://n4.nabble.com/simple-data-import-of-csv-tp1835620p1835620.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.


[R] selecting certain columns or rows from a .csv

2010-04-10 Thread doconnor

Hello,

I'm using http://n4.nabble.com/selecting-certain-columns-or-rows-from-a-csv-tp1835692p1835692.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] simple data import of .csv

2010-04-10 Thread doconnor

Perfect, thank you!!
-- 
View this message in context: 
http://n4.nabble.com/simple-data-import-of-csv-tp1835620p1835678.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] simple data import of .csv

2010-04-10 Thread doconnor

A related question: how do I make R return only one column or row of the .csv
file.  For example, I have about 1000 rows and three columns - can I import
only certain rows or columns, like just column 1?

Thank you!!!


-- 
View this message in context: 
http://n4.nabble.com/simple-data-import-of-csv-tp1835620p1835683.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] selecting certain columns or rows from a .csv

2010-04-11 Thread doconnor

Thank you

On Sat, Apr 10, 2010 at 7:24 PM, Fahim [via R] <
ml-node+1835760-173770432-226...@n4.nabble.com
> wrote:

> dataFile = read.csv("filename.csv",header= TRUE);
> #suppose u want col 1, col 9 and col 15
> col1 = 1;
> col9 = 9;
> col15 = 15;
> modifiedDataFile1 = dataFile[,c(col1, col9, col15)];
>
> #if u want rows from 1-100 and then 1000-5000
> modifiedDataFile2 = dataFile[c(1:100, 1000:5000), ];
>
> #If u want to select rows and col simultaneously as specified above then
> modifiedDataFile = dataFile[c(1:100, 1000:5000), c(col1, col9, col15)];
>
> Hope this will work.
>
> Thanks
> Fahim Mohammad
> Grad student
> CECS, Univ of Louisville
>
> --
>  View message @
> http://n4.nabble.com/selecting-certain-columns-or-rows-from-a-csv-tp1835692p1835760.html
> To unsubscribe from selecting certain columns or rows from a .csv, click
> here< (link removed) =>.
>
>
>

-- 
View this message in context: 
http://n4.nabble.com/selecting-certain-columns-or-rows-from-a-csv-tp1835692p1835768.html
Sent from the R help mailing list archive at Nabble.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.