[R] Selecting numbers not divisible by 3

David Winsemius dwinsemius at comcast.net
Thu Mar 27 20:50:54 CET 2014


On Mar 27, 2014, at 7:48 AM, Prabhakar Ghorpade wrote:

> Hi,
> How do I find help on %%

?'%%'   # Need to quote "specials" 

Also look at:

?'<-'

?'%in%

?'function'

-- 
David.

> 
> Regards,
> Prabhakar
> 
> 
> On Thu, Mar 27, 2014 at 4:56 PM, Jorge I Velez <jorgeivanvelez at gmail.com>wrote:
> 
>> Hi there,
>> 
>> Try
>> 
>> X[X %% 3 == 0]
>> 
>> HTH,
>> Jorge.-
>> 
>> 
>> On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade <
>> dr.prabhakar08 at gmail.com> wrote:
>> 
>>> Hi,
>>> here's my code
>>> 
>>> X <- 1:100
>>> 
>>> I want to select number divisible by 3 out of them how can I select it?
>>> 
>>> ( I tried following
>>> X <- 1:100
>>> DIV <- Y - > X/3
>>> 
>>> But I am getting whole number and number with fractions. WHole intgers are
>>> my number of interest from original X. How can I traceback to number
>>> divisbile by 3. ?)
>>> 
>>> Thanks
>>> 
>>> Kind Regards,
>>> Prabhakar
>>> 
>>> 
>>> 
>>> --
>>> Dr.Ghorpade Prabhakar B.
>>> Ph.D. Scholar ( Animal Biochemistry)
>>> Indian Veterinary Research Institute.
>>> India
>>> 
>>>        [[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.
>>> 
>> 
>> 
> 
> 
> -- 
> Dr.Ghorpade Prabhakar B.
> Ph.D. Scholar ( Animal Biochemistry)
> Indian Veterinary Research Institute.
> India
> 
> 	[[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.

David Winsemius
Alameda, CA, USA




More information about the R-help mailing list