[R] Getting warning message

arun smartpink111 at yahoo.com
Mon Jul 30 23:33:02 CEST 2012


Hello,

Your str() is different from mine.  It has G,Y,R, and T as factors.  You can do one thing, add stringsAsFactors=FALSE in read.table().  Even without it, I don't have any problems as this will only affect the Summary column.  


Z16<-read.table(text="
 Summary     G     Y R      T
      Accts 582.0 644.0 0 1226.0
    AcctCov 230.0 165.0 0  395.0
       Cov%  40.0  26.0 0   32.0
     UnCov%  60.0  74.0 0   68.0
 EqVol11$MM   8.5  10.6 0   19.1 
",header=TRUE,sep="",stringsAsFactors=FALSE)
str(Z16)
#'data.frame':    5 obs. of  5 variables:
# $ Summary: chr  "Accts" "AcctCov" "Cov%" "UnCov%" ...
# $ G      : num  582 230 40 60 8.5
# $ Y      : num  644 165 26 74 10.6
# $ R      : int  0 0 0 0 0
# $ T      : num  1226 395 32 68 19.1


 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="") 
 Z16
#     Summary     G      Y   R      T
#1      Accts   582    644   0   1226
#2    AcctCov   230    165   0    395
#3       Cov%   40%    26%  0%    32%
#4     UnCov%   60%    74%  0%    68%
#5 EqVol11$MM $$8.5 $$10.6 $$0 $$19.1
A.K.



----- Original Message -----
From: arun <smartpink111 at yahoo.com>
To: namit <saileshchowdary at gmail.com>
Cc: 
Sent: Thursday, July 26, 2012 5:52 PM
Subject: Re: [R] Getting warning message



HI Namit,

Have you looked into str()?  It might give more information regaring the problem.  

A.K.

----- Original Message -----
From: namit <saileshchowdary at gmail.com>
To: r-help at r-project.org
Cc: 
Sent: Thursday, July 26, 2012 1:27 PM
Subject: Re: [R] Getting warning message

Hi Arun,

Bymistake it kept X instead of Z16.



--
View this message in context: http://r.789695.n4.nabble.com/Getting-warning-message-tp4637928p4637983.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.



More information about the R-help mailing list