[TriLUG] R code problem

Matt Nash via TriLUG trilug at trilug.org
Mon Sep 16 12:23:22 EDT 2019


Isn't the second arg to write.csv supposed to be the filename to write to?
Looks like you have the dataframe var repeated.

On Mon, Sep 16, 2019, 12:03 M.R. via TriLUG <trilug at trilug.org> wrote:

> In case there are some R users among the readership:
>
> After reading in .csv file [It has the class: dataframe] and subsetting
> the columns down to 16 from 71, I want to write a backup .csv with the
> following code.
>
> At one time something close to the code below worked, but now it does
> not. Any ideas?
>
> CODE SNIPPET:
> pth.out =
> "d:/dox/projects/politics/voter_stats/ncvoter_Statewide/vtr-data-results/"
> setwd(pth.out)
> #getwd() # testing the path
> fyl.out = "vtr_all_01.csv" # 7.6 e6 records/rows, 71 variables/columns
> # all of the above did work.
>
> # now:
> write.csv(fyl.out, fyl.out)                  # sep == ,
> # fails: writes two cells or 30 bytes, not the entire dataframe.
> And I do not know why
>
> Any thoughts?
>
> Mike R.
>
> --
> This message was sent to: Matt Nash <mattnashbrowns at gmail.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> https://www.trilug.org/mailman/options/trilug/mattnashbrowns%40gmail.com
> Welcome to TriLUG: https://trilug.org/welcome


More information about the TriLUG mailing list