Re: [R] Real Basic Question

2019-09-27 Thread peter dalgaard
> On 26 Sep 2019, at 18:55 , Phillip Heinrich wrote: > > Just when I think I’m starting to get the hang of R I run into something that > sends me back to Go without collecting $200. > > The working directory seems to be correct when I load an .rda file but it is > not there and it is not

[R] stats::lm has inconsistent output when adding constant to dependent variable

2019-09-27 Thread David J. Birke
Dear R community, I just stumbled upon the following behavior in R version 3.6.0: set.seed(42) y <- rep(0, 30) x <- rbinom(30, 1, prob = 0.91) # The following will not show any t-statistic or p-value summary(lm(y~x)) # The following will show t-statistic and p-value summary(lm(1+y~x)) My

Re: [R] stats::lm has inconsistent output when adding constant to dependent variable

2019-09-27 Thread Rui Barradas
Hello, Maybe FAQ 7.31? Check the residuals, they are all "zero" in both cases: fit0 <- lm(y~x) fit1 <- lm(1+y~x) # residuals table(resid(fit0)) # # 0 #30 table(resid(fit1)) # #-5.21223595241838e-16 -4.93038065763132e-31 3.12734157145103e-15 #623

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread Martin Maechler
> Martin Maechler > on Mon, 23 Sep 2019 16:14:36 +0200 writes: > Richard O'Keefe > on Sat, 21 Sep 2019 09:39:18 +1200 writes: >> Ah, *now* we're getting somewhere. There is something >> that *can* be done that's genuinely helpful. >>> From the R(1) manual

Re: [R] stats::lm has inconsistent output when adding constant to dependent variable

2019-09-27 Thread Mark Leeds
Hi: In your example, you made the response zero in every case which is going to cause problems. In glm's, I think they call it the donsker effect. I'm not sure what it's called in OLS. probably a lack of identifiability. Note that you probably shouldn't be using zeros and 1's as the response in a

Re: [R] stats::lm has inconsistent output when adding constant to dependent variable

2019-09-27 Thread Mark Leeds
correction to my previous answer. I looked around and I don't think it's called the donsker effect. It seems to jbe referred to as just a case of "perfect separability.". if you google for" perfect separation in glms", you'll get a lot of information. On Fri, Sep 27, 2019 at 2:35 PM Mark

[R] Raster package crash with segmentation fault

2019-09-27 Thread Marc Girondot via R-help
Dear members, When I load raster 3.0-7 package installed or from source or from binary in r 3.6.1 (macosX 10.14.6), I get a segmentation fault crash: (see below) As someone the same problem and a solution ? Thanks (I have posted this question in R-Sig_GEO list without answer still) >

[R] Error: package 'stats' could not be loaded

2019-09-27 Thread Carlos Weiss
I'm getting an error when using R for the first time. It's a web service written in C#, .NET 4.5, IIS 10.0 running on Windows Server 2019. The file called "stats.dll" (which was a result of installing R 3.1.1) is within the scope of the path variables for all users. Could anyone tell me if this

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread William Michels via R-help
Apologies, Duncan and Martin. I didn't check "R --help" first. You're quite right, lots of embedded hyphens. Best Regards, Bill. W. Michels, Ph.D. On Fri, Sep 27, 2019 at 2:42 PM Duncan Murdoch wrote: > > On 27/09/2019 5:36 p.m., William Michels via R-help wrote: > > Hi Martin, > > > >

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread William Michels via R-help
Hi Martin, '--no-echo' or '--no_echo' Obviously you may prefer the first, but I hope you might consider the second. Best Regards, W. Michels, Ph.D. On Fri, Sep 27, 2019 at 9:04 AM Martin Maechler wrote: > > > Martin Maechler > > on Mon, 23 Sep 2019 16:14:36 +0200

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread Duncan Murdoch
On 27/09/2019 5:36 p.m., William Michels via R-help wrote: Hi Martin, '--no-echo' or '--no_echo' Obviously you may prefer the first, but I hope you might consider the second. Are you serious? That's a terrible suggestion. Run "R --help" and you'll see *no* options with

Re: [R] The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread Jim Lemon
On Sat, Sep 28, 2019 at 2:04 AM Martin Maechler wrote: > > For back compatibility reasons, the old command line option will > continue to work so the many shell and other scripts that use > it, will not stop working. > That's a relief. I was getting worried that we would become: The knights who

Re: [R] Error: package 'stats' could not be loaded

2019-09-27 Thread David Winsemius
I’m having difficulty understanding why you installed R v 3.1.1. That’s five major versions ago. — David Sent from my iPhone > On Sep 26, 2019, at 2:51 AM, Carlos Weiss wrote: > > I'm getting an error when using R for the first time. It's a web service > written in C#, .NET 4.5, IIS 10.0

Re: [R] Real Basic Question

2019-09-27 Thread David Winsemius
Sent from my iPhone > On Sep 27, 2019, at 12:55 AM, Phillip Heinrich wrote: > > Just when I think I’m starting to get the hang of R I run into something that > sends me back to Go without collecting $200. > > The working directory seems to be correct when I load an .rda file but it is >

Re: [R] Real Basic Question

2019-09-27 Thread Rui Barradas
Hello, 1. Try path.expand(). flname <- path.expand("~/Baseball/RetroSheetDocumentation/ari18.test2.rda") 2. To load in the global environment load(flname, envir = .GlobalEnv) 3. But read the docs. From ?load: load() replaces all existing objects with the same names in the current

Re: [R] Plot two values on same axes

2019-09-27 Thread Rich Shepard
On Fri, 27 Sep 2019, David Winsemius wrote: Instead of trying to mix lattice and base functions, you might try using the formula: maxtemp+mintemp ~ sampdate And then: col= c(“red”, “blue”) David, I certainly will. I've not needed R for projects for many months and when I looked through

Re: [R] Plot two values on same axes

2019-09-27 Thread Rich Shepard
On Fri, 27 Sep 2019, Rolf Turner wrote: You may better off using base R graphics, unless there are considerations which demand the use of lattice. Something like this, maybe: plot(maxtemp ~ sampdate, data=watertemp, type="h", col="red", ) points(maxtemp ~ sampdate,

Re: [R] [FORGED] Re: The "--slave" option ==> will become "--no-echo"

2019-09-27 Thread Rolf Turner
On 28/09/19 9:16 AM, Jim Lemon wrote: On Sat, Sep 28, 2019 at 2:04 AM Martin Maechler wrote: For back compatibility reasons, the old command line option will continue to work so the many shell and other scripts that use it, will not stop working. That's a relief. I was getting worried

[R] how to add p values to bar plot?

2019-09-27 Thread Ana Marija
Hi, I created a bar plot with this code: library(ggplot2) df <- data.frame("prop" = c(7.75,70.42), "Name" = c("All Genes","RG Genes")) p<-ggplot(data=df, aes(x=Name, y=prop,fill=Name)) + geom_bar(stat="identity")+ labs(x="", y = "Proportion of cis EQTLs")+ scale_fill_brewer(palette="Greens") +

Re: [R] how to add p values to bar plot?

2019-09-27 Thread Vivek Das
You will need to add stat_compare_means. Take a look at here. http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/76-add-p-values-and-significance-levels-to-ggplots/ library(ggpubr) p + stat_compare_means() Should be fine. Vivek On Fri, Sep 27, 2019 at 7:29 PM Ana Marija

Re: [R] how to add p values to bar plot?

2019-09-27 Thread Vivek Das
Ah, this is a single observation and not pvalue calculation over a distribution. You don’t seem to have a spread. Here your code seemed like it was over all genes(more than 1) vs RG genes(also more than one). But it is basically an observation of difference of 2 values. So it doesn’t need to

Re: [R] how to add p values to bar plot?

2019-09-27 Thread Vivek Das
Well that means already a ratio. Could you show me how the data frame looks like? If they are array of values then you compare the distribution of your ratios like Ratio1 array from “ (#of EQTLs)/(#of genes)” vs Ratio 2 arrays of the “same for the other, RG condition”. ratio1 = c(ratio1Value1,

Re: [R] how to add p values to bar plot?

2019-09-27 Thread Ana Marija
Awesome, thanks! Yes those two numbers on y axis I calculated as (#of EQTLs)/(#of genes) and the same for the other, RG condition. So implicitly I do have a spread just that data was not used to plot this, only those ratios. Is in this case still p value not necessary? On Fri, 27 Sep 2019 at