Re: [R] Auto Data in the ISLR Package

2017-12-16 Thread Bert Gunter
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 w

[R] Auto Data in the ISLR Package

2017-12-16 Thread AbouEl-Makarim Aboueissa
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)

Re: [R] Generating help files for a function

2017-12-16 Thread Enrico Schumann
On Sat, 16 Dec 2017, Erin Hodgess writes: > Hello everyone! > > I'm in the process of writing a package, and I'm using the lovely "R > Package" book as a guideline. > > However, in the midst of my work, I discovered that I had omitted a > function and am now putting in it the package. Not a prob

Re: [R] Generating help files for a function

2017-12-16 Thread Duncan Murdoch
On 16/12/2017 10:15 AM, Berwin A Turlach wrote: G'day Erin, On Sat, 16 Dec 2017 08:00:38 -0600 Erin Hodgess wrote: I'm in the process of writing a package, and I'm using the lovely "R Package" book as a guideline. However, in the midst of my work, I discovered that I had omitted a function

Re: [R] Generating help files for a function

2017-12-16 Thread Berwin A Turlach
G'day Erin, On Sat, 16 Dec 2017 08:00:38 -0600 Erin Hodgess wrote: > I'm in the process of writing a package, and I'm using the lovely "R > Package" book as a guideline. > > However, in the midst of my work, I discovered that I had omitted a > function and am now putting in it the package. No

Re: [R] Finding center of mass in a hydrologic time series

2017-12-16 Thread Thierry Onkelinx
Slightly faster: sum(cumsum(hyd) <= .5 * sum(hyd)) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality

Re: [R] Generating help files for a function

2017-12-16 Thread Bert Gunter
... and please note for the future and in case Ben's reply does not suffice that such queries should generally go to the r-package-devel mailing list. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Ber

Re: [R] Generating help files for a function

2017-12-16 Thread Ben Tupper
Hi, If you are using roxygen-style function documentation then why not use devtools::document()? Ben > On Dec 16, 2017, at 9:00 AM, Erin Hodgess wrote: > > Hello everyone! > > I'm in the process of writing a package, and I'm using the lovely "R > Package" book as a guideline. > > Howe

[R] Generating help files for a function

2017-12-16 Thread Erin Hodgess
Hello everyone! I'm in the process of writing a package, and I'm using the lovely "R Package" book as a guideline. However, in the midst of my work, I discovered that I had omitted a function and am now putting in it the package. Not a problem. But the problem is the help file. What is the be

Re: [R] Finding center of mass in a hydrologic time series

2017-12-16 Thread Eric Berger
Hi Eric, How about match( TRUE, cumsum(hyd/sum(hyd)) > .5 ) - 1 HTH, Eric On Sat, Dec 16, 2017 at 3:18 PM, Morway, Eric wrote: > The small bit of script below is an example of what I'm attempting to do - > find the day on which the 'center of mass' occurs. In case that is the > wrong term, I

[R] Finding center of mass in a hydrologic time series

2017-12-16 Thread Morway, Eric
The small bit of script below is an example of what I'm attempting to do - find the day on which the 'center of mass' occurs. In case that is the wrong term, I'd like to know the day that essentially cuts the area under the curve in to two equal parts: set.seed(4004) Date <- seq(as.Date('2000-09-