But i use a<-10/b , b is some value ,may be 5, maybe 5.5 not in the form xxL ,so how can i do in the situation to judge a ?
-- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-10-18 18:58:48, "Berend Hasselman" <b...@xs4all.nl> wrote: > >On 18-10-2014, at 12:41, PO SU <rhelpmaill...@163.com> wrote: > >> >> >> Dear usRers, >> I want to judge virable is or not a integer? >> e.g. is.integer(1) FALSE because it is a numeric, but i want it's true. >> as.integer may not be used. because i don't know a is 1 or 1.1. >> > >is.integer is surely what you need if you wish to test if a variable is >integer. >See this > ># a <- 1 ># b <- 1L > ># is.integer(a) >[1] FALSE > ># is.integer(b) >[1] TRUE > >See the help for is.integer to see how you can test for a wholenumber, which >might be what you want. > >Berend > ______________________________________________ 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.