[R] Uploading CSV file into R

Me dollear1 at illinois.edu
Sat May 14 04:25:27 CEST 2011


OK, I have another question if you guys don't mind helping again. I have all
of the information I need in a csv file, and I've read the csv file into R,
but I'm having some trouble manipulating it. In the past, I've always
manipulated data that was premade for me in the class I'm in, so I think I'm
probably formatting the csv file wrong.

The data is a list of countries with information about their inbound
tourism, homicide rate and GNI per capita. The file has four columns, with
the first being the name of the country, then the year (all 2008 in this
case), then homicide rate, then GNI, then inbound tourism.

My problem comes when I'm trying to separate the different the different
categories. For example, I'll try to isolate GNI per capita by writing
Data$GNI, but R doesn't seem to keep track of which country is assigned with
which GNI score. When I write View(Data$GNI), I just get a table that has
two columns: one column is the numbers 1 through 67, and the second is the
GNI per capita for each country that is that number in the list.

Can anyone help me correctly format the csv file or tell me what else I'm
doing wrong? Thanks a lot.

--
View this message in context: http://r.789695.n4.nabble.com/Uploading-CSV-file-into-R-tp3515237p3521623.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list