Hi, I'm trying to upload two CSV files into R, and I'm having some trouble. I've used the instructions I've found on the Web, but they haven't helped so far. I'm worried this could be because I'm using a Mac. The two data sets are here: http://data.un.org/Data.aspx?d=WDI&f=Indicator_Code%3aNY.GNP.PCAP.PP.CD http://data.un.org/Data.aspx?d=UNODC&f=tableCode%3a1 Thanks for your help. Let me know if you need more information. -- View this message in context: http://r.789695.n4.nabble.com/Uploading-CSV-file-into-R-tp3515237p3515237.html Sent from the R help mailing list archive at Nabble.com.
On May 11, 2011, at 18:54 , Me wrote:> Hi, I'm trying to upload two CSV files into R,What kind of misconception leads you to consider a simple read operation as an "upload", I wonder.> and I'm having some trouble. > I've used the instructions I've found on the Web, but they haven't helped so > far.Not very informative.> I'm worried this could be because I'm using a Mac.Not likely, so am I....> > The two data sets are here: > http://data.un.org/Data.aspx?d=WDI&f=Indicator_Code%3aNY.GNP.PCAP.PP.CD > http://data.un.org/Data.aspx?d=UNODC&f=tableCode%3a1 >> > DD <- read.csv("Downloads/UNdata_Export_20110511_130705015.csv") > summary(DD)Country.or.Area Year Value Value.Footnotes Algeria : 29 Min. :1980 Min. : 180 Mode:logical Argentina : 29 1st Qu.:1988 1st Qu.: 1282 NA's:5050 Australia : 29 Median :1995 Median : 3645 Austria : 29 Mean :1995 Mean : 7517 Bangladesh: 29 3rd Qu.:2002 3rd Qu.: 9825 Belgium : 29 Max. :2008 Max. :65050 (Other) :4876>> Thanks for your help. Let me know if you need more information.-- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
On May 11, 2011, at 12:54 PM, Me wrote:> Hi, I'm trying to upload two CSV files into R,Those are not csv files. They are webpages with query interfaces. They present the option of downloading the data as zipped files in various formats.> and I'm having some trouble. > I've used the instructions I've found on the Web, but they haven't > helped so > far. I'm worried this could be because I'm using a Mac. > > The two data sets are here: > http://data.un.org/Data.aspx?d=WDI&f=Indicator_Code > %3aNY.GNP.PCAP.PP.CD > http://data.un.org/Data.aspx?d=UNODC&f=tableCode%3a1 > > Thanks for your help. Let me know if you need more information. > > -- > View this message in context: http://r.789695.n4.nabble.com/Uploading-CSV-file-into-R-tp3515237p3515237.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.David Winsemius, MD West Hartford, CT
when uploading csv file to R, the file.csv should save as".csv" from". xls",if u just modify suffix of files, files cannot be read . BTW,who know the problem i meet, "strsplit(txt$Sentence,"?|?|?|?|?")" how to understand this order~> txt=read.csv("1988.csv",colClasses="character") > sentences=strsplit(txt$Sentence,"?|?|?|?|?")Error in strsplit(txt$Sentence, "?|?|?|?|?") : non-character argument