Re: [R] The Suggests field in a DESCRIPTION file.

2018-11-17 Thread Rolf Turner
On 11/18/18 11:22 AM, Fox, John wrote: Dear Rolf, "fortunes" needs to be quoted in requireNamespace("fortunes", quietly=TRUE). I hope this helps, John Thanks. I actually figured this out myself, just before getting your message! cheers, Rolf -- Technical Editor ANZJS Department of

Re: [R] The Suggests field in a DESCRIPTION file --- never mind!!!

2018-11-17 Thread Rolf Turner
I figured it out. The package name in the call to requireNamespace() has to be a *text string*. I should've had: fortOK <- requireNamespace("fortunes",quietly=TRUE) So require() takes a package name, but requireNamespace() takes a *string* specifying the package name. Trap for young

Re: [R] The Suggests field in a DESCRIPTION file.

2018-11-17 Thread Fox, John
Dear Rolf, "fortunes" needs to be quoted in requireNamespace("fortunes", quietly=TRUE). I hope this helps, John - John Fox Professor Emeritus McMaster University Hamilton, Ontario, Canada Web:

[R] The Suggests field in a DESCRIPTION file.

2018-11-17 Thread Rolf Turner
I am building a package which contains a function from which I wish to call the fortune() function from the fortunes package --- if that package is available. I have place the line Suggests: fortunes in the DESCRIPTION file. In my code for the function that I am writing (let's call it

Re: [R] Multiplication of regression coefficient by factor type variable

2018-11-17 Thread Bert Gunter
You shouldn't have to do any of what you are doing. See ?predict.lm and note the "newdata" argument. Also, you should spend some time studying a linear model text, as your question appears to indicate some basic confusion (e.g. about "contrasts" ) about how they work. Bert Gunter "The

[R] Multiplication of regression coefficient by factor type variable

2018-11-17 Thread Julian Righ Sampedro
Dear all, In a context of regression, I have three regressors, two of which are categorical variables (sex and education) and have class 'factor'. y = data$income x1 = as.factor(data$sex) # 2 levels x2 = data$age # continuous x3 = as.factor(data$ed) # 8 levels for example, the first entries

Re: [R] which() function help page precision

2018-11-17 Thread Juan Gomez
Hi again (, I am the PO from my own email account) I agree that the word "basically" puts the NA issues aside. But my point is that R subsetting behavior when there are NAs in a logical index is quite tricky to say the less, and deserves the trouble of pointing it out in every place it is