[R] Remove all spaces from a string so it can be used by assign()

Greg Snow Greg.Snow at imail.org
Sat Jul 4 03:59:57 CEST 2009


The only people who should use the assign function are those who fully understand why you should never use the assign function.

If you tell us where the string is coming from and what you are trying to accomplish, then maybe we can help you accomplish it in a better way.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Kurt Smith
> Sent: Friday, July 03, 2009 4:57 AM
> To: r-help at r-project.org
> Subject: [R] Remove all spaces from a string so it can be used by
> assign()
> 
> 
> Hi
> 
> I have a string "56 Fe [1]" that I would like to use as a variable name
> by using "assign" however I think the spaces and brackets might be
> causing R some trouble.
> 
> How can I change the string so that it just becomes 56Fe1 and can be
> used as a variable name.
> 
> 
> Thank You
> 
> Kurt
> 
> _________________________________________________________________
> 
> [[elided Hotmail spam]]
> 
> 
> 	[[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.




More information about the R-help mailing list