[R] (no subject)

Jim Lemon drjimlemon at gmail.com
Tue May 26 14:26:16 CEST 2015


Hi venkadesan,
Assuming that the Name column is now a factor (and the data set is a
data frame named "mydata"), try:

mydata$Name<-as.character(mydata$Name)

If you mean that you want to display column A with percentage signs:

paste(mydata$A,"%",sep="")

You can use the "format" function to display the final three columns
with thousand separators:

format(mydata$B,big.mark=",")

Note that the result will be a character variable, not a number.

Jim


On Tue, May 26, 2015 at 9:41 PM, venkadesan venky <venkynov10 at gmail.com> wrote:
> Hello guys,
>
> I have data set like this
>
> Name   A         B         C        D
> Venky  12       157       168     209
> Kalai    65       8899     889     998
> balaji    98       877       8787   9888
> .
> .
> .
>
> i want to change Name column as a Charcter and A column as a percentage and
> B and C column as a thousand seperators
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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