Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

I need help with a programming language called R.

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
coloradodem2005 Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Aug-29-04 03:01 PM
Original message
I need help with a programming language called R.
I have been looking all over www.r-project.org to try to import a data file from WinEdt and it will say that the file is not there. Does anybody know anything about this?

This is what I type:
dat <- read.table ("D:\Program Files\WinEdt Team\CH01PR19.txt", row.names=1, col.names=c("GPA", "ACT"))

This is the error message:
Error in file(file, "r") : unable to open connection
In addition: Warning message:
cannot open file `D:Program FilesWinEdt TeamCH01PR19.txt'
Printer Friendly | Permalink |  | Top
salvorhardin Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Aug-29-04 03:19 PM
Response to Original message
1. I think you need to...
Edited on Sun Aug-29-04 03:27 PM by salvorhardin
I'm not at all familiar with R but I think your problem here is that you need to use the Unix style path separators.

Try this:

dat <- read.table ("D:/Program Files/WinEdt Team/CH01PR19.txt", row.names=1, col.names=c("GPA", "ACT"))

Reason: The backslash is traditionally used as an escape character in most programming languages. Like in PHP if you wanted to print the string "I've been a very good boy." you would need to escape the special character tick mark like this:

print ("I\'ve been a very good boy.");

I'm not sure of the origins of it but only Microsoft seems to have used the backslash as a path separator. I can't remember if CP/M did too.

Edit: Damn I can't type today.
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 19th 2024, 02:19 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC