Also keep in mind that R uses "/" to separate directories, not
"\" (as Windows does in general). This is true even for Windows
R.
----- Original Message -----
From: "Steve Purpura" <stevepurpura(a)yahoo.com
To: <emwilk(a)buffalo.edu
Cc:
<pdsenese(a)buffalo.edu>du>; <zelig(a)latte.harvard.edu
Sent: Thursday, May 13, 2004 6:12 PM
Subject: RE: [zelig] Zelig Question - Loading Data
Eric,
You may have more success with setting the working directory
of {R}
directly. The "setwd" command sets the
working directory, and
I've enclosed
an example of its use. Just specify the name of the
directory
of your data
file for the variable "wd".
> library(foreign)
> wd<-"z:/Documents and Settings/Steve/My Documents/UW
POLS503/Assignment 2"
setwd(wd)
f.laitin<-read.dta('repdata.dta')
attach(f.laitin)
Steve
-----Original Message-----
From: owner-zelig(a)latte.harvard.edu
[mailto:owner-zelig@latte.harvard.edu]
On Behalf Of emwilk(a)buffalo.edu
Sent: Thursday, May 13, 2004 2:56 PM
To: zelig(a)latte.harvard.edu
Cc: pdsenese(a)buffalo.edu
Subject: [zelig] Zelig Question - Loading Data
To Whom It May Concern:
I've run into a problem loading data into Zelig and
unfortunately, have
been unable to resolve the problem on my own or with
the aid
of the
help option. Any assistance would be greatly
appreciated.
The problem may be a result of my ignorance of the proper
working
directory. I have been using the same directory that
the
sample data
(ie turnout, mid, etc.) is contained within
(library\Zelig\data).
While i have been able to load the sample data with
the data()
command,
I have not had any luck at loading my data using the
instructions for
tab, space or comma delimited data.
The problem may also arise from an incorrect data format. The
data was
originally a Stata file. Using Stat Transfer, I
transfered
the file
into ASCII delimited. Perhaps this is incorrect. I
have
tried using
the instructions for loading Stata .dta files directly
into
Zelig but
have also run into problems. Again, with that stata
file in
the
Zelig\data directory I typed the command:
library(foreign)
stata.data <- read.dta("states.dta")
and recieved the following error message:
Error in read.dta("states.dta") : unable
to open file
I have taken missing data and string variables into account so
I don't
think that this is the problem.
The Error Message I keep receiving is
Error in file(file, "r") : unable to
open connection
In addition: Warning message:
cannot open file `states.csv'
Again, I've been using the commands:
>read.csv("states.csv") and/or read.csv("statesb.csv", header
= TRUE,
na.strings = " ") for comma delimited data
and
read.table("states.txt")
but keep getting the (file, "r") error message.
Any advice as to what might be the problem would be greatly
appreciated. If you need more information as to how I've been
trying
to open my data, please let me know. Thanks in
advance.
Sincerely,
Eric M. Wilk
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options:
http://lists.hmdc.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options:
http://lists.hmdc.harvard.edu/?infoZelig program
information:
http://gking.harvard.edu/zelig/
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options:
http://lists.hmdc.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/