[R] Exporting column names with spaces with write.csv() XXXX

Jim Lemon drjimlemon at gmail.com
Sun Sep 6 04:57:58 CEST 2015

Hi Dan,
I don't get this behavior with R-3.2.2:

names(da.df)<-c("no good","no good at all")
> da.df
  no good no good at all
1       1              4
2       2              5
3       3              6

gives me this:

"no good","no good at all"

Are you sure that R didn't add the periods when you created the data frame?
They would then be written into the CSV file.


On Sun, Sep 6, 2015 at 12:09 PM, Dan Abner <dan.abner99 at gmail.com> wrote:

> Hi all,
> I have a number of columns with spaces in the column names exactly as
> I want them in R. When I go to export the data table to csv using
> write.csv(), the fn adds periods in place of the spaces.
> Is there a way to suppress the addition of the periods?
> Thanks,
> Dan
> ______________________________________________
> R-help at r-project.org 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.

	[[alternative HTML version deleted]]

More information about the R-help mailing list