Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
That worked. Thank you, especially for that last one! So, for others who might encounter this same situation: 1. Install RTools from here: https://cran.r-project.org/bin/windows/Rtools/Rtools34.exe Trying to install Rtools from inside RStudio will result in an "it's not available for 3.4.2" mess

Re: [R] "prob" package alternative

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 3:46 PM, Tiby Kantrowitz wrote: > > Thanks. I found that, and installed it and got the same message. Here: > > RTools version 3.4 > > install.packages("fAsianOptions_3010.tar.gz", I don't see a path to that file's location. The expansion from pkg_version.tar.gz might be

Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
Thanks. I found that, and installed it and got the same message. Here: RTools version 3.4 install.packages("fAsianOptions_3010.tar.gz", dependencies=TRUE, repos=NULL, type = "source") Installing package into ‘C:/Users/Tlk7/Documents/R/win-library/3.4’ (as ‘lib’ is unspecified) Warning: invalid pa

Re: [R] "prob" package alternative

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 2:14 PM, Tiby Kantrowitz wrote: > > Rtools is not available for the current version of R. Really? If true, I'm surprised and not able to help. I do see an Rtools34.exe at https://cran.r-project.org/bin/windows/Rtools/ -- David. > > What I'm looking for is an alternative

Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
Rtools is not available for the current version of R. What I'm looking for is an alternative package or how others have managed to create workarounds. On Thu, Nov 2, 2017 at 4:25 PM, David Winsemius wrote: > > > On Nov 2, 2017, at 1:09 PM, Tiby Kantrowitz wrote: > > > > Yes, that is exactly wh

Re: [R] repeat a function

2017-11-02 Thread Eric.Pueyo
Hi Petr, Many thanks for your response. Basically I want to create a probability matrix to be used in a trinomial tree going forward. This is the reason why I thought to build the matrix around 0 would be much more efficient. I need to loop through because the probabilities will depend on my

Re: [R] "prob" package alternative

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 1:09 PM, Tiby Kantrowitz wrote: > > Yes, that is exactly what I was doing two days ago. > > Warning in install.packages : > installation of package ‘fAsianOptions_3010.79.tar.gz’ had non-zero exit > status > > Which is what a reading of the explanation for why "prob" wa

Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
Yes, that is exactly what I was doing two days ago. Warning in install.packages : installation of package ‘fAsianOptions_3010.79.tar.gz’ had non-zero exit status Which is what a reading of the explanation for why "prob" was retired leads one to expect. Do you have some other suggestion about ho

Re: [R] "prob" package alternative

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 12:07 PM, Tiby Kantrowitz wrote: > > Yes. That's the version I've been discussing that has non-zero exit status. > That situation is why CRAN retired the prob package. It's possible you > installed that library earlier in development and it's been "carried" along. > It no

Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
Yes. That's the version I've been discussing that has non-zero exit status. That situation is why CRAN retired the prob package. It's possible you installed that library earlier in development and it's been "carried" along. It no longer installs, now. The problems with all of this seem to have sta

Re: [R] "prob" package alternative

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 11:15 AM, Tiby Kantrowitz wrote: > > The issue is fAsianOptions. Is there a version that works with the latest > version of R? If not, which version of it works with which version of R and > where can it be found? I tried several at the archive already. sessionInfo() R ve

Re: [R] "prob" package alternative

2017-11-02 Thread Tiby Kantrowitz
The issue is fAsianOptions. Is there a version that works with the latest version of R? If not, which version of it works with which version of R and where can it be found? I tried several at the archive already. Alternatively, is there another package that behaves similarly to prob? On Wed, No

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 10:03 AM, Ed Siefker wrote: > > I don't really understand. I mean, I understand the solution is > print(ggplot(...)). But why is that required in a function and not at > the console? The REPL design of the interactive console is offered the user as a convenience, but I ag

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Duncan Murdoch
On 02/11/2017 1:03 PM, Ed Siefker wrote: I don't really understand. I mean, I understand the solution is print(ggplot(...)). But why is that required in a function and not at the console? Shouldn't I be able to rely on what I do at the console working in a script? Is this inconsistent behavior

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Richard M. Heiberger
FAQ 7.22 Open the file indicated by system.file("../../doc/FAQ") and scroll down to 7.22 On Thu, Nov 2, 2017 at 1:03 PM, Ed Siefker wrote: > I don't really understand. I mean, I understand the solution is > print(ggplot(...)). But why is that required in a function and not at > the console? >

Re: [R] Cox Regression : Spline Coefficient Interpretation?

2017-11-02 Thread Kevin E. Thorpe
Your output is mangled beyond interpretation. However, when it comes to interpreting splines in general, you cannot easily convert the individual beta coefficients into, say HR by exponenitating them. The collection of beta coefficients describe the relationship between the continuous variable

Re: [R] repeat a function

2017-11-02 Thread Bert Gunter
Petr et al. : I only wish to comment on Petr's remark; I have nothing useful to say about the subject of this thread. "AFAIK if a function is defined within another function (which is your case) it cannot be called directly so it is necessary to define it in global environment." Right, a deliber

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Ed Siefker
I don't really understand. I mean, I understand the solution is print(ggplot(...)). But why is that required in a function and not at the console? Shouldn't I be able to rely on what I do at the console working in a script? Is this inconsistent behavior by design? On Thu, Nov 2, 2017 at 11:54

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread David Winsemius
> On Nov 2, 2017, at 9:27 AM, Ed Siefker wrote: > > I have a function: > > myplot <- function (X) { >d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) >png(paste("img/", X, ".png", sep="")) >ggplot(d, aes(x=condition, y=count, color=condition)) + >geom_poi

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread PIKAL Petr
Hi You have to print it. just add print(all ggplot stuff) inside the function. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ed Siefker > Sent: Thursday, November 2, 2017 5:27 PM > To: r-help > Subject: [R] ggplot inside function d

[R] ggplot inside function doesn't plot

2017-11-02 Thread Ed Siefker
I have a function: myplot <- function (X) { d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) png(paste("img/", X, ".png", sep="")) ggplot(d, aes(x=condition, y=count, color=condition)) + geom_point(position=position_jitter(w=0.1,h=0)) + scale_y_log10

Re: [R] repeat a function

2017-11-02 Thread PIKAL Petr
Hi Eric I did not see any answer and frankly speaking I cannot provide you with canned help. AFAIK if a function is defined within another function (which is your case) it cannot be called directly so it is necessary to define it in global environment. > fff <- function(x) { + myf <- functio

Re: [R] Cox Regression : Spline Coefficient Interpretation?

2017-11-02 Thread Bert Gunter
Always reply to the list. I do not do private consulting. (I have cc'ed this to the list). I still think this belongs on stackexchange, not r-help. I think you need to read up on the mathematics of spline bases. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people kee

[R] SamplingStrata R package

2017-11-02 Thread Chris S
Hi all I am hoping to use the SamplingStrata R package for a dataset describing a population of businesses wherein I have information on the type of business, as well as, for designated employment number bands, number of employees and business turnover information. So ideally the stratification wi

Re: [R] Correct subsetting in R

2017-11-02 Thread peter dalgaard
> On 1 Nov 2017, at 18:03 , Elahe chalabi via R-help > wrote: > > But they row.names() cannot give me the IDs > Is "training" extracted from "data" using standard data frame indexing? If so, data[row.names(training), "ID"] should give you the relevant values. If not, then you are in troubl