[R] R-3.3.2 on October 31

2016-10-05 Thread peter dalgaard
Just a quick heads-up, mostly for those who want to keep their packages up to date with respect to updates of R: We intend to have a patch release on October 31. Nickname and detailed schedule will be made available on developer.r-project.org in due course. For the R Core Team Peter Dalgaard

[R] A note on == versus logical operators for logical comparisons

2016-10-05 Thread Bert Gunter
Folks: This post was suggested by a recent post of Fabien Verger. In it, he used a != b as an exclusive-or operator for two logical vectors, a and b. As R already has an exlcusive-or operator, I suggested xor(a,b), which is implemented as (x | y) & !(x & y) i.e. through purely logical operators.

[R] R-3.3.2 on October 31

2016-10-05 Thread Peter Dalgaard
Just a quick heads-up, mostly for those who want to keep their packages up to date with respect to updates of R: We intend to have a patch release on October 31. Nickname and detailed schedule will be made available on developer.r-project.org in due course. For the R Core Team Peter Dalgaard

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Bob Rudis
No need to bring in so many dependencies for a simple ggplot2 marplot: ds <- stack(ds) ggplot(ds[ds$values==1,], aes(ind)) + geom_bar() On Wed, Oct 5, 2016 at 10:17 AM, Thierry Onkelinx wrote: > Here is a ggplot2, tidyr, dplyr solution > > library(tidyr) > library(dplyr) > library(ggplot2) > ds

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Ulrik Stervbo
I have a version looking like the original request even library(tidyr) library(ggplot2) var1 <- c(1,0,1,0,0,1,1,1,0,1) var2 <- c(0,1,1,1,1,0,0,0,0,0) var3 <- c(1,1,1,1,1,1,1,1,0,1) ds <- data.frame(var1, var2, var3) ds %>% gather() %>% group_by(key) %>% filter(value > 0) %>% mutate(fake_y = c(1

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Bob Rudis
(s/marplot/barplot) On Wed, Oct 5, 2016 at 10:35 AM, Bob Rudis wrote: > No need to bring in so many dependencies for a simple ggplot2 marplot: > > ds <- stack(ds) > ggplot(ds[ds$values==1,], aes(ind)) + geom_bar() > > On Wed, Oct 5, 2016 at 10:17 AM, Thierry Onkelinx < > thierry.onkel...@inbo.be

Re: [R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Thierry Onkelinx
Here is a ggplot2, tidyr, dplyr solution library(tidyr) library(dplyr) library(ggplot2) ds %>% gather() %>% group_by(key) %>% summarize(total = sum(value)) %>% ggplot(aes(x = key, y = total)) + geom_bar(stat = "identity") ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Re

[R] Antwort: RE: How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread G . Maubach
Hi Bob, Hi John, Hi readers, many thanks for your reply. I did barplot(colSums(dataset %>% select(FirstVar:LastVar))) and it worked fine. How would I do it with ggplot2? Kind regards Georg Von:"Fox, John" An: "g.maub...@weinwolf.de" , Kopie: "r-help@r-project.org" Datum: 05.

Re: [R] How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread Fox, John
Dear Georg, How about barplot(colSums(ds)) ? Best, John - John Fox, Professor McMaster University Hamilton, Ontario Canada L8S 4M4 Web: socserv.mcmaster.ca/jfox > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of > g.maub.

[R] How to plot a bunch of dichotomous code variables in one plot using ggplot2

2016-10-05 Thread G . Maubach
Hi All, I have a bunch of dichotomous code variables which shall be plotted in one graph using one of their values, this is "1" in this case. The dataset looks like this: -- cut -- var1 <- c(1,0,1,0,0,1,1,1,0,1) var2 <- c(0,1,1,1,1,0,0,0,0,0) var3 <- c(1,1,1,1,1,1,1,1,0,1) ds <- data.frame(var

Re: [R] What does lm() output coefficient mean when it's been given a categorical predictor of string values?

2016-10-05 Thread Michael Dewey
See inline On 04/10/2016 16:39, mviljamaa wrote: I'm using lm() for a model that has a predictor that has two values {poika, tyttö} (boy and girl in Finnish). I make a model with this categorical variable: fit1 <- lm(dta$X.U.FEFF..mpist. ~ dta$sukup + dta$HISEI + dta$SES) You will find your

Re: [R] Problem installing rgdal.

2016-10-05 Thread Michael Sumner
>From source I always consult Edzer's Travis configurations such as: https://github.com/edzer/spacetime/blob/master/.travis.yml For really bleeding edge and all the other hard install libs on Docker I just go straight to the rockerverse: ht

Re: [R] Problem installing rgdal.

2016-10-05 Thread Rolf Turner
On 05/10/16 20:47, Rainer M Krug wrote: Rolf Turner writes: On 05/10/16 12:56, ProfJCNash wrote: Can you build/install the source package? I had a problem once where my libraries were "too recent" for the R package, but I could build against my installed base. In any event, it may point out

Re: [R] Problem installing rgdal.

2016-10-05 Thread Rainer M Krug
Rolf Turner writes: > On 05/10/16 12:56, ProfJCNash wrote: >> Can you build/install the source package? I had a problem once where my >> libraries were "too recent" for the R package, >> but I could build against my installed base. In any event, it may point out >> the source of the problem. >>