I can't seem to figure out why I'm getting this error. The output is copied right off the screen. Notice how in some cases the back slash is missing. In other cases, it can't read a file that I know is there. Thanks in advance > library(foreign) > hrout <- read.spss("c:\\hrab200.sav") Error in read.spss("c:\\hrab200.sav") : unable to open file > library(foreign) > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My Documents\Baseball\Baseball Research\hr time series paper\new time series hr paper\hrab200.sav") Error in read.spss("C:Documents and SettingsDavid KaplanMy DocumentsBaseballBaseball Researchhr time series paper\new time series hr paperhrab200.sav") : unable to open file > library(foreign) > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My Documents\hrab200.sav"} Error: syntax error in "hrout <- read.spss("C:\Documents and Settings\David Kaplan\My Documents\hrab200.sav"}" > hrout <-read.spss("C:\\Documents and Settings\David Kaplan\My Documents\hrab200.sav") Error in read.spss("C:\\Documents and SettingsDavid KaplanMy Documentshrab200.sav") : unable to open file -- =======================================================================David Kaplan, Ph.D. Professor Department of Educational Psychology University of Wisconsin - Madison Educational Sciences, Room 1061 1025 W. Johnson Street Madison, WI 53706 email: dkaplan at education.wisc.edu Web: http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm Phone: 608-262-0836 Fax: 608-262-0843
On Thu, 28 Sep 2006, David Kaplan wrote:> I can't seem to figure out why I'm getting this error. The output is > copied right off the screen. Notice how in some cases the back slash is > missing. In other cases, it can't read a file that I know is there.This is rw-FAQ 2.16 and FAQ 7.8 Since you seem unfamiliar with the FAQs, their study will reward you.> Thanks in advance > > > > > library(foreign) > > hrout <- read.spss("c:\\hrab200.sav") > Error in read.spss("c:\\hrab200.sav") : unable to open file > > library(foreign) > > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My > Documents\Baseball\Baseball Research\hr time series paper\new time > series hr paper\hrab200.sav") > Error in read.spss("C:Documents and SettingsDavid KaplanMy > DocumentsBaseballBaseball Researchhr time series paper\new time series > hr paperhrab200.sav") : > unable to open file > > library(foreign) > > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My > Documents\hrab200.sav"} > Error: syntax error in "hrout <- read.spss("C:\Documents and > Settings\David Kaplan\My Documents\hrab200.sav"}" > > hrout <-read.spss("C:\\Documents and Settings\David Kaplan\My > Documents\hrab200.sav") > Error in read.spss("C:\\Documents and SettingsDavid KaplanMy > Documentshrab200.sav") : > unable to open file > > > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060929/5848d0b7/attachment.pl
Hi>From Faq7.8 How do file names work in Windows? As R uses C-style string handling, \ is treated as an escape character, so that for example one can enter a newline as \n. When you really need a \, you have to escape it with another \. Thus, in filenames use something like "c:\\data\\money.dat". You can also replace \ by / ("c:/data/money.dat"). HTH Petr On 28 Sep 2006 at 23:16, David Kaplan wrote: Date sent: Thu, 28 Sep 2006 23:16:23 -0500 From: David Kaplan <dkaplan at education.wisc.edu> To: r-help at stat.math.ethz.ch Subject: [R] What is wrong with this input> I can't seem to figure out why I'm getting this error. The output is > copied right off the screen. Notice how in some cases the back slash > is missing. In other cases, it can't read a file that I know is > there. > > Thanks in advance > > > > > library(foreign) > > hrout <- read.spss("c:\\hrab200.sav") > Error in read.spss("c:\\hrab200.sav") : unable to open file > > library(foreign) > > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My > Documents\Baseball\Baseball Research\hr time series paper\new time > series hr paper\hrab200.sav") Error in read.spss("C:Documents and > SettingsDavid KaplanMy DocumentsBaseballBaseball Researchhr time > series paper\new time series hr paperhrab200.sav") : > unable to open file > > library(foreign) > > hrout <- read.spss("C:\Documents and Settings\David Kaplan\My > Documents\hrab200.sav"} Error: syntax error in "hrout <- > read.spss("C:\Documents and Settings\David Kaplan\My > Documents\hrab200.sav"}" > > hrout <-read.spss("C:\\Documents and Settings\David Kaplan\My > Documents\hrab200.sav") Error in read.spss("C:\\Documents and > SettingsDavid KaplanMy Documentshrab200.sav") : > unable to open file > > > > -- > =====================================================================> == David Kaplan, Ph.D. Professor Department of Educational Psychology > University of Wisconsin - Madison Educational Sciences, Room 1061 1025 > W. Johnson Street Madison, WI 53706 > > email: dkaplan at education.wisc.edu > Web: > http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm > Phone: 608-262-0836 Fax: 608-262-0843 > > ______________________________________________ > R-help at stat.math.ethz.ch 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.Petr Pikal petr.pikal at precheza.cz