Re: [R] fortune candidate
On Sun, 17 Dec 2017, J C Nash wrote: From Dirk E. on the R-devel list Many things a developer / power-user would do are very difficult on Windows. It is one of the charms of the platform. On the other hand you do get a few solitaire games so I guess everybody is happy. Thanks, added to the devel version of "fortunes" on R-Forge. Z JN __ R-help@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. __ R-help@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.
[R] fortune candidate
>From Dirk E. on the R-devel list > Many things a developer / power-user would do are very difficult on > Windows. It is one of the charms of the platform. On the other hand you do > get a few solitaire games so I guess everybody is happy. JN __ R-help@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.
Re: [R] Auto Data in the ISLR Package
Dear Eric: Many Thanks abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Department of Mathematics and Statistics* *University of Southern Maine* On Sun, Dec 17, 2017 at 5:25 AM, Eric Bergerwrote: > myAuto <- Auto[ grep("ford|toyota",Auto$name),] > myAuto$Make <- NA > myAuto$Make[grep("ford",myAuto$name)] <- "Ford" > myAuto$Make[grep("toyota",myAuto$name)] <- "Toyota" > > Regards, > Eric > > > On Sun, Dec 17, 2017 at 11:58 AM, AbouEl-Makarim Aboueissa < > abouelmakarim1...@gmail.com> wrote: > >> Dear Eric: >> >> Thank you very much. It works nicely. >> >> *Just one more thing;* how to create a new variable (say, *Make*) with *Make >> = Ford* for the ford brand and *Make = T**oyota* for the toyota brand. >> >> Once again thank you all. >> >> abou >> >> __ >> >> >> *AbouEl-Makarim Aboueissa, PhD* >> >> *Professor of Statistics* >> >> *Department of Mathematics and Statistics* >> *University of Southern Maine* >> >> >> On Sun, Dec 17, 2017 at 3:10 AM, Eric Berger >> wrote: >> >>> myAuto <- Auto[ grep("ford|toyota",Auto$name),] >>> >>> >>> >>> On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunter >>> wrote: >>> I did not care to load the packages -- small reproducible examples are preferable, as the posting guide suggests. But, if I have understood correctly: See, e.g. ?subset Alternatively, you can read up on indexing data frames in any good basic R tutorial. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < abouelmakarim1...@gmail.com> wrote: > Dear All: > > I would like to create a subset data set *with only* all Ford and all > Toyota cars from the Auto data set in ISLR R Package. Thank you very much > in advance. > > Please use the following code to see how is the data look like. > > > install.packages("ISLR") > library(ISLR) > data(Auto) > head(Auto) > > > with many thanks > abou > __ > > > *AbouEl-Makarim Aboueissa, PhD* > > *Professor of Statistics* > > *Department of Mathematics and Statistics* > *University of Southern Maine* > > [[alternative HTML version deleted]] > > __ > R-help@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. > [[alternative HTML version deleted]] __ R-help@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/posti ng-guide.html and provide commented, minimal, self-contained, reproducible code. >>> >>> >> > [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Auto Data in the ISLR Package
myAuto <- Auto[ grep("ford|toyota",Auto$name),] myAuto$Make <- NA myAuto$Make[grep("ford",myAuto$name)] <- "Ford" myAuto$Make[grep("toyota",myAuto$name)] <- "Toyota" Regards, Eric On Sun, Dec 17, 2017 at 11:58 AM, AbouEl-Makarim Aboueissa < abouelmakarim1...@gmail.com> wrote: > Dear Eric: > > Thank you very much. It works nicely. > > *Just one more thing;* how to create a new variable (say, *Make*) with *Make > = Ford* for the ford brand and *Make = T**oyota* for the toyota brand. > > Once again thank you all. > > abou > > __ > > > *AbouEl-Makarim Aboueissa, PhD* > > *Professor of Statistics* > > *Department of Mathematics and Statistics* > *University of Southern Maine* > > > On Sun, Dec 17, 2017 at 3:10 AM, Eric Berger> wrote: > >> myAuto <- Auto[ grep("ford|toyota",Auto$name),] >> >> >> >> On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunter >> wrote: >> >>> I did not care to load the packages -- small reproducible examples are >>> preferable, as the posting guide suggests. >>> >>> But, if I have understood correctly: >>> >>> See, e.g. ?subset >>> >>> Alternatively, you can read up on indexing data frames in any good basic >>> R >>> tutorial. >>> >>> Cheers, >>> Bert >>> >>> Bert Gunter >>> >>> "The trouble with having an open mind is that people keep coming along >>> and >>> sticking things into it." >>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) >>> >>> On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < >>> abouelmakarim1...@gmail.com> wrote: >>> >>> > Dear All: >>> > >>> > I would like to create a subset data set *with only* all Ford and all >>> > Toyota cars from the Auto data set in ISLR R Package. Thank you very >>> much >>> > in advance. >>> > >>> > Please use the following code to see how is the data look like. >>> > >>> > >>> > install.packages("ISLR") >>> > library(ISLR) >>> > data(Auto) >>> > head(Auto) >>> > >>> > >>> > with many thanks >>> > abou >>> > __ >>> > >>> > >>> > *AbouEl-Makarim Aboueissa, PhD* >>> > >>> > *Professor of Statistics* >>> > >>> > *Department of Mathematics and Statistics* >>> > *University of Southern Maine* >>> > >>> > [[alternative HTML version deleted]] >>> > >>> > __ >>> > R-help@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. >>> > >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> R-help@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/posti >>> ng-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> > [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Auto Data in the ISLR Package
Dear Eric: Thank you very much. It works nicely. *Just one more thing;* how to create a new variable (say, *Make*) with *Make = Ford* for the ford brand and *Make = T**oyota* for the toyota brand. Once again thank you all. abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Department of Mathematics and Statistics* *University of Southern Maine* On Sun, Dec 17, 2017 at 3:10 AM, Eric Bergerwrote: > myAuto <- Auto[ grep("ford|toyota",Auto$name),] > > > > On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunter > wrote: > >> I did not care to load the packages -- small reproducible examples are >> preferable, as the posting guide suggests. >> >> But, if I have understood correctly: >> >> See, e.g. ?subset >> >> Alternatively, you can read up on indexing data frames in any good basic R >> tutorial. >> >> Cheers, >> Bert >> >> Bert Gunter >> >> "The trouble with having an open mind is that people keep coming along and >> sticking things into it." >> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) >> >> On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < >> abouelmakarim1...@gmail.com> wrote: >> >> > Dear All: >> > >> > I would like to create a subset data set *with only* all Ford and all >> > Toyota cars from the Auto data set in ISLR R Package. Thank you very >> much >> > in advance. >> > >> > Please use the following code to see how is the data look like. >> > >> > >> > install.packages("ISLR") >> > library(ISLR) >> > data(Auto) >> > head(Auto) >> > >> > >> > with many thanks >> > abou >> > __ >> > >> > >> > *AbouEl-Makarim Aboueissa, PhD* >> > >> > *Professor of Statistics* >> > >> > *Department of Mathematics and Statistics* >> > *University of Southern Maine* >> > >> > [[alternative HTML version deleted]] >> > >> > __ >> > R-help@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. >> > >> >> [[alternative HTML version deleted]] >> >> __ >> R-help@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/posti >> ng-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Auto Data in the ISLR Package
Hi Peter, I looked at the Auto data frame and tested before I sent my reply. The entries in the "name" column are actually models, such as > head(Auto$name) [1] chevrolet chevelle malibu buick skylark 320 plymouth satellite amc rebel sst [5] ford torino ford galaxie 500 What you are suggesting won't work. I agree with your "bedford" example as a problem, but given the size of the result set in this case (~73 rows) it's easy to eyeball the results and see if they're ok. Regards, Eric On Sun, Dec 17, 2017 at 11:00 AM, peter dalgaardwrote: > That probably works in this case, but it would cause grief if another car > make had "ford" somewhere inside its name e.g. "bedford". Safer general > practice is > > Auto[Auto$name %in% c("ford", "toyota"),] > > or similar using subset(). > > -pd > > > On 17 Dec 2017, at 09:10 , Eric Berger wrote: > > > > myAuto <- Auto[ grep("ford|toyota",Auto$name),] > > > > > > > > On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunter > > wrote: > > > >> I did not care to load the packages -- small reproducible examples are > >> preferable, as the posting guide suggests. > >> > >> But, if I have understood correctly: > >> > >> See, e.g. ?subset > >> > >> Alternatively, you can read up on indexing data frames in any good > basic R > >> tutorial. > >> > >> Cheers, > >> Bert > >> > >> Bert Gunter > >> > >> "The trouble with having an open mind is that people keep coming along > and > >> sticking things into it." > >> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > >> > >> On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < > >> abouelmakarim1...@gmail.com> wrote: > >> > >>> Dear All: > >>> > >>> I would like to create a subset data set *with only* all Ford and all > >>> Toyota cars from the Auto data set in ISLR R Package. Thank you very > >> much > >>> in advance. > >>> > >>> Please use the following code to see how is the data look like. > >>> > >>> > >>> install.packages("ISLR") > >>> library(ISLR) > >>> data(Auto) > >>> head(Auto) > >>> > >>> > >>> with many thanks > >>> abou > >>> __ > >>> > >>> > >>> *AbouEl-Makarim Aboueissa, PhD* > >>> > >>> *Professor of Statistics* > >>> > >>> *Department of Mathematics and Statistics* > >>> *University of Southern Maine* > >>> > >>>[[alternative HTML version deleted]] > >>> > >>> __ > >>> R-help@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. > >>> > >> > >>[[alternative HTML version deleted]] > >> > >> __ > >> R-help@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. > >> > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@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. > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Office: A 4.23 > Email: pd@cbs.dk Priv: pda...@gmail.com > > > > > > > > > > [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Auto Data in the ISLR Package
That probably works in this case, but it would cause grief if another car make had "ford" somewhere inside its name e.g. "bedford". Safer general practice is Auto[Auto$name %in% c("ford", "toyota"),] or similar using subset(). -pd > On 17 Dec 2017, at 09:10 , Eric Bergerwrote: > > myAuto <- Auto[ grep("ford|toyota",Auto$name),] > > > > On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunter > wrote: > >> I did not care to load the packages -- small reproducible examples are >> preferable, as the posting guide suggests. >> >> But, if I have understood correctly: >> >> See, e.g. ?subset >> >> Alternatively, you can read up on indexing data frames in any good basic R >> tutorial. >> >> Cheers, >> Bert >> >> Bert Gunter >> >> "The trouble with having an open mind is that people keep coming along and >> sticking things into it." >> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) >> >> On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < >> abouelmakarim1...@gmail.com> wrote: >> >>> Dear All: >>> >>> I would like to create a subset data set *with only* all Ford and all >>> Toyota cars from the Auto data set in ISLR R Package. Thank you very >> much >>> in advance. >>> >>> Please use the following code to see how is the data look like. >>> >>> >>> install.packages("ISLR") >>> library(ISLR) >>> data(Auto) >>> head(Auto) >>> >>> >>> with many thanks >>> abou >>> __ >>> >>> >>> *AbouEl-Makarim Aboueissa, PhD* >>> >>> *Professor of Statistics* >>> >>> *Department of Mathematics and Statistics* >>> *University of Southern Maine* >>> >>>[[alternative HTML version deleted]] >>> >>> __ >>> R-help@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. >>> >> >>[[alternative HTML version deleted]] >> >> __ >> R-help@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. >> > > [[alternative HTML version deleted]] > > __ > R-help@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. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@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.
Re: [R] Auto Data in the ISLR Package
myAuto <- Auto[ grep("ford|toyota",Auto$name),] On Sat, Dec 16, 2017 at 10:28 PM, Bert Gunterwrote: > I did not care to load the packages -- small reproducible examples are > preferable, as the posting guide suggests. > > But, if I have understood correctly: > > See, e.g. ?subset > > Alternatively, you can read up on indexing data frames in any good basic R > tutorial. > > Cheers, > Bert > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > On Sat, Dec 16, 2017 at 11:44 AM, AbouEl-Makarim Aboueissa < > abouelmakarim1...@gmail.com> wrote: > > > Dear All: > > > > I would like to create a subset data set *with only* all Ford and all > > Toyota cars from the Auto data set in ISLR R Package. Thank you very > much > > in advance. > > > > Please use the following code to see how is the data look like. > > > > > > install.packages("ISLR") > > library(ISLR) > > data(Auto) > > head(Auto) > > > > > > with many thanks > > abou > > __ > > > > > > *AbouEl-Makarim Aboueissa, PhD* > > > > *Professor of Statistics* > > > > *Department of Mathematics and Statistics* > > *University of Southern Maine* > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@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. > > > > [[alternative HTML version deleted]] > > __ > R-help@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. > [[alternative HTML version deleted]] __ R-help@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.