Is there any way to maintain spaces, slashes, and parentheses in variable names when reading these into R? Of course, read.table converts these to periods. However, I know that it's not strictly illegal to have these characters in variable names as I am able to add them using the "variable editor" portion of the "data editor." I need to batch produce dozens of histograms for reporting purposes and my data is loaded with special characters e.g. "Historic Trend (mm/yr)" Adding "Historic.Trend..mm.yr." to my plots is not acceptable for reporting purposes. Do I really need to manually label all of my plots each time I produce them in R or manually change the variable names in the Data Editor? Any help that anyone may be able to provide to allow me to read data without "corrupting" my variable labels would be appreciated. (Forgive me if this is a dumb question, first day in R.) -- View this message in context: http://www.nabble.com/Maintain-Spaces-and-Parentheses-in-Variable-Names-tp21377255p21377255.html Sent from the R help mailing list archive at Nabble.com.
Henrique Dallazuanna
2009-Jan-09 18:29 UTC
[R] Maintain Spaces and Parentheses in Variable Names
Try this: read.table(...., check.names = FALSE) On Fri, Jan 9, 2009 at 3:56 PM, Cloudy56 <clough.jonathan@gmail.com> wrote:> > Is there any way to maintain spaces, slashes, and parentheses in variable > names when reading these into R? > > Of course, read.table converts these to periods. However, I know that it's > not strictly illegal to have these characters in variable names as I am > able > to add them using the "variable editor" portion of the "data editor." > > I need to batch produce dozens of histograms for reporting purposes and my > data is loaded with special characters e.g. "Historic Trend (mm/yr)" > Adding "Historic.Trend..mm.yr." to my plots is not acceptable for reporting > purposes. Do I really need to manually label all of my plots each time I > produce them in R or manually change the variable names in the Data Editor? > > Any help that anyone may be able to provide to allow me to read data > without > "corrupting" my variable labels would be appreciated. (Forgive me if this > is a dumb question, first day in R.) > -- > View this message in context: > http://www.nabble.com/Maintain-Spaces-and-Parentheses-in-Variable-Names-tp21377255p21377255.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > 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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
Apparently Analagous Threads
- Unbalanced parentheses printed by warnings() crash text editor
- [klibc:update-dash] [PATCH] eval: Silence compiler warning about missing parentheses
- [klibc:update-dash] dash: eval: Silence compiler warning about missing parentheses
- [Bug 574] New: nf_conntrack_ftp.c ignores RFC 1123 regarding parentheses in FTP passive mode message 227
- Re: (PR#7005) X11 , plot(...expression(...)): missing parentheses