write csv of a structure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

write csv of a structure

Pedro páramo
Hi all,

I want to "save" export in a csv or plain text format the results of my
calculations

I use cbind and I obtain what I call "resultprob" if I put deput it shows
me this

dput(resultprob)
structure(c(88.6572680743221, 7250.7), .Dim = 1:2)

> str(resultprob)
 num [1, 1:2] 88.7 7250.7

I use

write_csv(resultprob, file = "resultprob.csv", sep=",")

But this error appears:

Error in write_csv(resultprob, file = "resultprob.csv", sep = ",") :
  unused arguments (file = "resultprob.csv", sep = ",")

What will be happening?

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: write csv of a structure

Ivan Krylov
On Tue, 11 Aug 2020 17:34:31 +0200
Pedro páramo <[hidden email]> wrote:

> Error in write_csv(resultprob, file = "resultprob.csv", sep = ",") :
>   unused arguments (file = "resultprob.csv", sep = ",")

There is utils::write.csv and there is readr::write_csv. Judging by the
parameters you pass, you seem to want to call the former, not the
latter.

Hint: use help() to find out the correct arguments of a function if R
tells you that there was a mistake.

--
Best regards,
Ivan

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.