[R] problem with paste function

Duncan Murdoch murdoch at stats.uwo.ca
Wed Sep 2 21:19:37 CEST 2009


On 9/2/2009 1:28 PM, Phil Spector wrote:
> Fahim -
>     Apparently dataline is a factor, so you'd need to use
> 
>       paste('set g=',as.character(f1))

That shouldn't be necessary:

 > f1 <- factor("abc")
 > paste('set g=', f1)
[1] "set g= abc"

I think we need reproducible code to diagnose this one.

Duncan Murdoch


> 
> 
>  					- Phil Spector
>  					 Statistical Computing Facility
>  					 Department of Statistics
>  					 UC Berkeley
>  					 spector at stat.berkeley.edu
> 
> 
> On Wed, 2 Sep 2009, Fahim Md wrote:
> 
>> Hi there!!
>> I am having trouble with *paste* function. I dont know how to proceed. I
>> tried many options but i failed miserably.
>> I am using a variable f1 to assign a string as below:
>> f1=dataLine[locAffyProbeID];
>> ( the value of f1 is *244901_at* )
>>
>> Then I am using the paste function
>> paste("set g=", f1);
>>
>> instead of getting *set g=244901_at*, I am getting *set g=23*.
>>
>> I am not able to understand why it is so.
>> Can anyone help!!!!!!!Please..
>> Thanks
>>
>> --
>> Mohammad Fahim
>>
>> 	[[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.
>>
> 
> ______________________________________________
> 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