Hi.
I don't know how did you create data frame X but if you check str(X) you
will see that you have one or more factors inside.
Try using stringsAsFactors=FALSE options while creating data frame.

Hope this helps.

Andrija

On Thu, Jul 26, 2012 at 3:23 PM, namit <saileshchowdary@gmail.com> wrote:

> Hi Friends,
>
>
> I  have  a data frame X, and I want to add “%” & “$” in row  4 and 5
> respectively. when I’m trying using below logic, I’m getting warning
> message.
> Can anyone  help me out on this.
>
>
> X:
> Summary       G Y       R       T
> Accts        582        644     0       1226
> AcctCov      230        165     0       395
> Cov%          40        26      0       32
> UnCov%       60 74      0       68
> EqVol11$MM8.5   10.6    0       19.1
>
> Using this logic:
>
> Z16[5,2:5]<-paste("$",Z16[5,2:5],sep="")
> Z16[3,2:5]<-paste(Z16[3,2:5],"%",sep="")
> Z16[4,2:5]<-paste(Z16[4,2:5],"%",sep="")
>
> Getting this Warning: In `[<-.factor`(`*tmp*`, iseq, value = c(3L, 1L, 2L,
> 4L, NA))
>                                             invalid factor level, NAs
> generate
>
>
> Final result:
>
> Summary   G     Y       R       T
> Accts   582     644     0       1226
> AcctCov 230     165     0       395
> Cov%    40%     26%     0%      32%
> UnCov%  60%     74%     0%      68%
> EqVol11$MM$8.50         $10.60  $0      $19.10
>
>
> Thanks in Advance.
>
> Thanks,
> Namit
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Getting-warning-message-tp4637928.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.
>

	[[alternative HTML version deleted]]

