R programming language resources › Forums › General chat › Unable to write data into file
- This topic has 1 reply, 2 voices, and was last updated 11 years, 7 months ago by
bryan.
- AuthorPosts
- May 20, 2013 at 12:11 am #946
NoviceDataMiner
MemberHey folks,
I am completely new to R programming and have been trying some stuff and am stuck at some places. I am not sure if this the right place to direct my queries. If not, please correct me.
Meanwhile, I had a doubt while trying to write my data using R. I created a simple list and and am trying to write that data into a .txt file that I have already created on my Desktop. My code and error looks as follows:
> data7 = scan ()
1: 23 17 12.5 11 17 12 14.5 9 11 9 12.5 14.5 17 8 21
16:
Read 15 items
> write(data7, file = ‘Desktop/data7.txt’, sep = ‘,’)However, I get the following error:
Error in file(file, ifelse(append, “a”, “w”)) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, “a”, “w”)) :
cannot open file ‘Desktop/data7.txt’: No such file or directoryI am using Mac OS.
Does anyone have any clues?
Thanks in advance,
Chai
June 28, 2013 at 3:43 pm #969 - AuthorPosts
- You must be logged in to reply to this topic.