[R] Maintain Spaces and Parentheses in Variable Names

Cloudy56 clough.jonathan at gmail.com
Fri Jan 9 19:42:20 CET 2009


Thank you very much.  That certainly worked.  Somehow I did not see that when
reading the help file, nor could I find it via Google search so I appreciate
your help!   -- JC


Henrique Dallazuanna wrote:
> 
> Try this:
> 
> read.table(...., check.names = FALSE)
> 
> On Fri, Jan 9, 2009 at 3:56 PM, Cloudy56 <clough.jonathan at 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 at 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]]
> 
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/Maintain-Spaces-and-Parentheses-in-Variable-Names-tp21377255p21377996.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list