Hello, Can someone help me to understand the meaning of the following R line? list(fk5 ~ .) Thanks, Renata ----------------------------------------- Email sent from www.virginmedia.com/email Virus-checked using McAfee(R) Software and scanned for spam
> Can someone help me to understand the meaning of the following R line? > > list(fk5 ~ .)fk5 ~. is a formula, most likely used by a regression (or similar model). fk5 is the response variable, and the dot is a placeholder for 'whatever was on that side of the formula before'. (This is usually used for updating models.) list() places the formula in a list, obviously. It's hard to provide more meaning without the context. (Also, mailing list etiquette suggests you should provide a more informative subject line than 'need help'.) Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
See ?formula ?terms.formula or ask the author of the line (it doesn't make much sense to use '.' unless you have a 'data' argument to pass to terms()). On Wed, 30 Jul 2008, renata.camargo05 at ntlworld.com wrote:> Hello, > > Can someone help me to understand the meaning of the following R line? > > list(fk5 ~ .) > > Thanks, Renata > > ----------------------------------------- > Email sent from www.virginmedia.com/email > Virus-checked using McAfee(R) Software and scanned for spam > > ______________________________________________ > 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi Dbfile contains "bin" "TCC_TCA" "TCA_CR" "TCC_CR" "Time" "sn.rnc" 1 301 38 365 (08/28/08 00:00:02) "50.20" 2 302 39 358 (08/28/08 00:00:07) "50.20" 3 319 43 377 (08/28/08 00:00:12) "50.20" 4 312 37 367 (08/28/08 00:00:17) "50.20" 5 332 40 382 (08/28/08 00:00:22) "50.20" 6 312 39 362 (08/28/08 00:00:27) "50.20" 7 303 47 368 (08/28/08 00:00:32) "50.20" 8 296 42 361 (08/28/08 00:00:37) "50.20" 9 299 43 353 (08/28/08 00:00:42) "50.20" 10 301 42 361 (08/28/08 00:00:47) "50.20" I did Df<-read.table("Dbfile",header=TRUE,sep="\t") I am getting Df "bin" "TCC_TCA" "TCA_CR" "TCC_CR" "Time" "sn.rnc" 1 301 38 365 (08/28/08 00:00:02) "50.2" 2 302 39 358 (08/28/08 00:00:07) "50.2" 3 319 43 377 (08/28/08 00:00:12) "50.2" 4 312 37 367 (08/28/08 00:00:17) "50.2" 5 332 40 382 (08/28/08 00:00:22) "50.2" 6 312 39 362 (08/28/08 00:00:27) "50.2" 7 303 47 368 (08/28/08 00:00:32) "50.2" 8 296 42 361 (08/28/08 00:00:37) "50.2" 9 299 43 353 (08/28/08 00:00:42) "50.2" 10 301 42 361 (08/28/08 00:00:47) "50.2" I dnt know why I am getting in this way(0 is missing ) But I want exact values of sn.rnc. How can I get Thanks K.Ravichandra Thanks K.Ravichandra [[alternative HTML version deleted]]
If you do ?read.table you would most likely find the answer on your own. Have a look at the description of the as.is and colClasses argument. The column sn.rnc has been automatically recognised as being numeric. After Df1<-read.table("Dbfile",colClasses="character",header=TRUE) you will see 50.20 in the column "sn.rnc". But beware: that column now has class "character" and NOT "numeric". Do class[Df1[,"sn.rnc"]) to see for yourself. Berend -- View this message in context: http://www.nabble.com/need-help-tp19230876p19231149.html Sent from the R help mailing list archive at Nabble.com.
Hi> str<-"50.20"> as.numeric(str)[1] 50.2>But I want 50.20 as o/p How can I get Thanks K.Ravichandra [[alternative HTML version deleted]]
Kurapati, Ravichandra (Ravichandra) wrote:> Hi > > > >> str<-"50.20" > >> as.numeric(str) > > [1] 50.2 > > > > > But I want 50.20 as o/pFor output formatting, see ?formatC, for example. Uwe Ligges> > > How can I get > > > > Thanks > > K.Ravichandra > > > > > > > [[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.