[R] Selecting numbers not divisible by 3
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@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.
[R] Selecting numbers not divisible by 3
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 -- Dr.Ghorpade Prabhakar B. Ph.D. Scholar ( Animal Biochemistry) Indian Veterinary Research Institute. India [[alternative HTML version deleted]] __ 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.
Re: [R] Selecting numbers not divisible by 3
On 27-03-2014, at 10:23, Prabhakar Ghorpade dr.prabhaka...@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. ?) Please don’t send messages twice. X - 1L:100L X[which(X%%3L==0L)] and this gives the same results X - 1:100 X[which(X%%3==0)] and beware of R FAQ 7.31 for more complicated situations. Berend And please don’t post in html as you are requested to do. __ 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.
Re: [R] Selecting numbers not divisible by 3
Hi there, Try X[X %% 3 == 0] HTH, Jorge.- On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade dr.prabhaka...@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@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. [[alternative HTML version deleted]] __ 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.
Re: [R] Selecting numbers not divisible by 3
Hi One option is seq(3,100,3) or you can use rounded numbers for comparison ?round Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Prabhakar Ghorpade Sent: Thursday, March 27, 2014 8:47 AM To: r-help@r-project.org Subject: [R] Selecting numbers not divisible by 3 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@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. Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům. Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému. Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat. Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu. V případě, že je tento e-mail součástí obchodního jednání: - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu. - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou. - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech. - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá. This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients. If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system. If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner. The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email. In case that this e-mail forms part of business dealings: - the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning. - if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation. - the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects. - the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient. __ 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.
Re: [R] Selecting numbers not divisible by 3
Hello, Something like that? R X - 1:100 R Y - X %% 3 R Y - ifelse(Y==0, TRUE, FALSE) R X[Y] [1] 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 [26] 78 81 84 87 90 93 96 99 HTH, Pascal On Thu, Mar 27, 2014 at 6:23 PM, Prabhakar Ghorpade dr.prabhaka...@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 -- Dr.Ghorpade Prabhakar B. Ph.D. Scholar ( Animal Biochemistry) Indian Veterinary Research Institute. India [[alternative HTML version deleted]] __ 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. -- Pascal Oettli Project Scientist JAMSTEC Yokohama, Japan __ 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.
Re: [R] Selecting numbers not divisible by 3
Hello, Inline. Em 27-03-2014 11:32, Pascal Oettli escreveu: Hello, Something like that? R X - 1:100 R Y - X %% 3 R Y - ifelse(Y==0, TRUE, FALSE) The ifelse here is not needed, you can simply do Y - Y == 0 Rui Barradas R X[Y] [1] 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 [26] 78 81 84 87 90 93 96 99 HTH, Pascal On Thu, Mar 27, 2014 at 6:23 PM, Prabhakar Ghorpade dr.prabhaka...@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 -- Dr.Ghorpade Prabhakar B. Ph.D. Scholar ( Animal Biochemistry) Indian Veterinary Research Institute. India [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] Selecting numbers not divisible by 3
Pascal, Jorge, Berend, Pikal and Rui. Thanks all it helps. On Thu, Mar 27, 2014 at 8:18 PM, Prabhakar Ghorpade dr.prabhaka...@gmail.com wrote: Hi, How do I find help on %% Regards, Prabhakar On Thu, Mar 27, 2014 at 4:56 PM, Jorge I Velez jorgeivanve...@gmail.comwrote: Hi there, Try X[X %% 3 == 0] HTH, Jorge.- On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade dr.prabhaka...@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@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 -- Dr.Ghorpade Prabhakar B. Ph.D. Scholar ( Animal Biochemistry) Indian Veterinary Research Institute. India [[alternative HTML version deleted]] __ 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.
Re: [R] Selecting numbers not divisible by 3
Hi, How do I find help on %% Regards, Prabhakar On Thu, Mar 27, 2014 at 4:56 PM, Jorge I Velez jorgeivanve...@gmail.comwrote: Hi there, Try X[X %% 3 == 0] HTH, Jorge.- On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade dr.prabhaka...@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@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@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.
Re: [R] Selecting numbers not divisible by 3
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 jorgeivanve...@gmail.comwrote: Hi there, Try X[X %% 3 == 0] HTH, Jorge.- On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade dr.prabhaka...@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@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@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 __ 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.
Re: [R] Selecting numbers not divisible by 3
?%% PLEASE read an Introduction to R (ships with R) or an online tutorial of your choice before posting further. You then will not have to waste nearly as much time (yours and ours) posting and waiting for answers! Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Thu, Mar 27, 2014 at 7:48 AM, Prabhakar Ghorpade dr.prabhaka...@gmail.com wrote: Hi, How do I find help on %% Regards, Prabhakar On Thu, Mar 27, 2014 at 4:56 PM, Jorge I Velez jorgeivanve...@gmail.comwrote: Hi there, Try X[X %% 3 == 0] HTH, Jorge.- On Thu, Mar 27, 2014 at 6:46 PM, Prabhakar Ghorpade dr.prabhaka...@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@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@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. __ 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.