Skip to content

Cannot write a dataframe to xls or csv Windows 7

4 messages · pmulonge, R. Michael Weylandt, William Dunlap +1 more

#
Hello,
I have  a similar issue , but in my case I am using Windows 7
i try the following command to write a dataframe to xls using the
xlsReadWrite package or the write.csv function
write.xls(DATA,'Reg_IDcleaned.xls')
or I will write.csv replacin the suffix with .csv
I get absolutely no error message and the setwd appears at top of my code
with absolute path
However when I look in the relevant folder ,the xls or cdv outfile is
nowhere to be found.
Is there a gremlin in the computer or what?
Before, this write.xls was working fine and now it stopped, i used the
write.csv to test if it was an error in the package.
So since write.csv also fails to produce the oufile in .csv in the relevant
folder, I am at my witts end




--
View this message in context: http://r.789695.n4.nabble.com/Cannot-read-or-write-to-file-in-Linux-Ubuntu-tp4606457p4643025.html
Sent from the R help mailing list archive at Nabble.com.
#
On Thu, Sep 13, 2012 at 4:05 PM, pmulonge
<research at namibia.pharmaccess.org> wrote:
It seems unlikely, but I suppose it can't be ruled out....
Firstly, please do quote context: most of us don't read nabble and I
have no idea what "similar problem" you're having. (Well, actually, I
clicked the link and I do, but I'm not letting on) Secondly, can you
whip up a reproducible example?

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

I see no reason why

setwd("~") # Replace with appropriate Windows-ism
write.csv(data.frame(1:5, letters[1:5]))

wouldn't work if you have the right permissions, but perhaps you are
doing something funny.

Cheers,
Michael
#
Immediately after the write.xls(..., file="something") run
   normalizePath("something", mustWork=TRUE)
and it should give a full path to the file called "something".

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
Thank you so much,
Yes I need to look up how to make a reproducible example,
William I will try your advice, I believe this will be my salvation here, once I get my computer.

Pancho
On Sep 13, 2012, at 23:59, "William Dunlap" <wdunlap at tibco.com> wrote: