Recent R Analysis of Fish Trade Data

3 views
Skip to first unread message

Matthew Bascom

unread,
Aug 18, 2009, 7:24:04 PM8/18/09
to hel...@googlegroups.com
Hi All,
 
I have two questions.  First, I am having trouble updating the version of R I'm currently using.  (2.8.1)  I downloaded the .gz file, but I'm not sure what to do with it.  Secondly, I came across this neat code yesterday and went right to running the analysis.  But the program is not reading in the data set. 
 
It doesn't appear that the program requires any special packages.  But for some reason I'm having trouble reading the .csv file into the program.  I tried putting the .csv file at the front of C://, but it didn't work.  Any thoughts? Thanks! 
 
- Matt
 
 
Attached is the data in both txt and csv format, and the R code as a txt document. 



--
Export Analytics Inc.
http://www.exportanalytics.com
fish.txt
fish.csv
importexportfishcode.txt

Mark Knecht

unread,
Aug 18, 2009, 7:56:06 PM8/18/09
to Matthew Bascom, hel...@googlegroups.com
Try

data <- read.csv("c://Bascom//fish.csv", header=TRUE)

Earl

unread,
Aug 20, 2009, 2:33:18 AM8/20/09
to Bay Area R Helpers
you mention c://, so it sounds like you are using windows, but you
also mentioned a tgz file, which is linux specific. Which OS are you
using?

also, you can use the getwd() function to see what directory you are
in, and either set a new working directory with setwd() or write a
path relative to your working directory

eg, if you have the csv file in your c:\ directory under windows, you
can either read.csv('c:/blah.csv', etc) or setwd('c:/') and read.csv
('blah.csv', etc)
>  fish.txt
> 4KViewDownload
>
>  fish.csv
> 4KViewDownload
>
>  importexportfishcode.txt
> 2KViewDownload
Reply all
Reply to author
Forward
0 new messages