Dear all, if I may ask please a question that is likely very naive : shall I write in R > "1:9", it will generate "1 2 3 4 5 6 7 8 9" shall I write > "0.1:0.9", why does it generate only 0.1 ? thank you ! -- bogdan [[alternative HTML version deleted]]
Dear Bogdan, for increments <>1, it needs "by". Try seq(.1,.9,.1) Best, Albrecht -- Albrecht Kauffmann alkauffm at fastmail.fm Am Do, 20. Sep 2018, um 09:26, schrieb Bogdan Tanasa:> Dear all, > > if I may ask please a question that is likely very naive : > > shall I write in R > "1:9", it will generate "1 2 3 4 5 6 7 8 9" > > shall I write > "0.1:0.9", why does it generate only 0.1 ? > > thank you ! > > -- bogdan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Hi> -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of Bogdan Tanasa > Sent: Thursday, September 20, 2018 9:26 AM > To: r-help <r-help at r-project.org> > Subject: [R] about the series of numbers > > Dear all, > > if I may ask please a question that is likely very naive : > > shall I write in R > "1:9", it will generate "1 2 3 4 5 6 7 8 9" > > shall I write > "0.1:0.9", why does it generate only 0.1 ?Because it is said in help page!!! "For other arguments from:to is equivalent to seq(from, to), and generates a sequence from *from* to *to* in steps of 1 or -1." sequence from 0.1 to 0.9 in steps 1 starts at 0.1 but the second item is 1.1 which is bigger than 0.9 therefore the result is only one item 0.1. Cheers Petr> > thank you ! > > -- bogdan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.Osobn? ?daje: Informace o zpracov?n? a ochran? osobn?ch ?daj? obchodn?ch partner? PRECHEZA a.s. jsou zve?ejn?ny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner?s personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/ D?v?rnost: Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a podl?haj? tomuto pr?vn? z?vazn?mu prohl??en? o vylou?en? odpov?dnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/