Re: [R] example of geom_contour() with function argument

2017-10-09 Thread Big Floppy Dog
Thank you very much! So, it appears that a grid has to be created for the function to be used in stat_contour(). Thanks again for this example! It is very helpful (and could be a worthwhile addition to geom_contour's help example). Btw, I was also trying to make the contour plot have shaded

Re: [R] Regular expression help

2017-10-09 Thread Georges Monette
How about this (I'm showing it as a pipe because it's easier to read that way): library(magrittr) "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" %>%   strsplit(' ') %>%   unlist %>%   sub('^[^/]*/*','',.) %>%   sub('^[^/]*/*','',.) %>%   paste(collapse = ' ') Georges Monette --

Re: [ESS] (Aquamacs) Why is text at R prompt read-only, cannot delete? 2

2017-10-09 Thread Ista Zahn
Hi Christian, 1. The subject line appears to be unrelated to the body of your message. 2. Aquamacs configures ESS for you, so why are you trying to load it yourself? 3. Your message itself is very hard to understand. Consider spending some time with a guide such as

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread jdnewmil
library(mvtnorm) # you were misusing "require"... only use require if you plan to library(ggplot2) # test the return value and fail gracefully when the package is missing set.seed( 1234 ) xx <- data.frame( rmvt( 100, df = c( 13, 13 ) ) ) xx2 <- expand.grid( X1 = seq( -5, 5, 0.1 ) # all

Re: [R] Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)

2017-10-09 Thread Jim Lemon
I seriously doubt that you are running the code I sent. What you have probably done is to run your data, which has a different date format, without changing the breaks or the date format arguments. As you haven't provided any example that shows what you are doing, I can't guess what the problem

[ESS] (Aquamacs) Why is text at R prompt read-only, cannot delete? 2

2017-10-09 Thread Christian
Hi, Starting Aquamacs 3.3 on MacbookPro MacOS 10.12.6, I get an error Warning (initialization): An error occurred while loading ‘/Users/hoffmannc/.emacs’: File error: Cannot open load file, No such file or directory, ~/elisp/vendor/ess/lisp/ess-site.el --- My

Re: [R] Adjusted survival curves

2017-10-09 Thread RStudio
Adjusted survival curves. (Sample code here: https://rpubs.com/daspringate/survival ) Deep gratitude to Moderator/Admin! At David Winsemius prompt, more elegant working code:Thanks, Ted :) library(survival) library(survminer) df<-read.csv("F:/R/data/edgr-orig.csv", header = TRUE, sep = ";")

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread Big Floppy Dog
Hi, This is not a HW problem, sadly: I was last in a classroom 30 years ago, and can no longer run off to the instructor :-( I apologize but I cut and paste the wrong snippet earlier and made a typo in doing so, but the result is the same with the more appropriate snippet. require(mvtnorm)

Re: [R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-09 Thread Eric Berger
Hi Christofer, A few comments. 1. Your experiment seems to show (I hope) that the issue may not be a shiny issue. If that is the case you can try to do things in a simpler setting, such as a (non-shiny) R session, say from the shell. i.e. start an interactive R session and enter the load

Re: [R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-09 Thread Christofer Bogaso
Hi Eric, thanks for your further pointer. I have put a line with load() function just as an illustration of a bigger project of mine, which appears failing due to load() function issue. If I comment out that line my shiny app is working correctly locally and globally. otherwise, locally my

Re: [ESS] (Aquamacs) Why is text at R prompt read-only, cannot delete?

2017-10-09 Thread Vitalie Spinu
>> On Mon, Oct 09 2017 17:57, Christian wrote: > No such file or directory, > ~/elisp/vendor/ess/lisp/ess-site.el Isn't the above clear enough? Fixing your path should do it. Vitalie __ ESS-help@r-project.org mailing list

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread David Winsemius
> On Oct 9, 2017, at 6:03 AM, Big Floppy Dog wrote: > > Hello Ulrik, > > I apologize, but I can not see how to provide a pdf in place of the density > function which calculates a KDE (that is, something from the dataset in the > example). Can you please point to the

Re: [R] Regular expression help

2017-10-09 Thread Duncan Murdoch
On 09/10/2017 12:06 PM, William Dunlap wrote: "(^| +)([^/ ]*/?){0,2}", with the first "*" replaced by "+" would be a bit better. Thanks! I think I actually need the *, because theoretically the b part of the word could be empty, i.e. "a//c" would be legal and should become "c". Duncan

Re: [R-es] Incluir símbolo matemático en data frame

2017-10-09 Thread Manuel Spínola
Siguiendo la recomendación de Jesús encontré la solución: columna1 <- c("a", "b", "c") columna2 <- c("\u2265 0.3", 0.5, 0.8) columna3 <- c("\u2265 0.3", 0.6, 0.9) cuadro <- data.frame(columna1, columna2, columna3) kable(cuadro) El 9 de octubre de 2017, 9:26, Jesús Para Fernández <

Re: [R] Regular expression help

2017-10-09 Thread Duncan Murdoch
On 09/10/2017 11:23 AM, Ulrik Stervbo wrote: Hi Duncan, why not split on / and take the correct elements? It is not as elegant as regex but could do the trick. Thanks for the suggestion. There are likely many thousands of lines of data like the two real examples (which had about 5000 and

Re: [R] Regular expression help

2017-10-09 Thread William Dunlap via R-help
"(^| +)([^/ ]*/?){0,2}", with the first "*" replaced by "+" would be a bit better. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Oct 9, 2017 at 8:50 AM, William Dunlap wrote: > > x <- "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" > > gsub("(^| *)([^/

[ESS] (Aquamacs) Why is text at R prompt read-only, cannot delete?

2017-10-09 Thread Christian
Hi, Starting Aquamacs 3.3 on MacbookPro MacOS 10.12.6, I get an error Warning (initialization): An error occurred while loading ‘/Users/hoffmannc/.emacs’: File error: Cannot open load file, No such file or directory, ~/elisp/vendor/ess/lisp/ess-site.el --- My

Re: [R] Regular expression help

2017-10-09 Thread William Dunlap via R-help
> x <- "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" > gsub("(^| *)([^/ ]*/?){0,2}", "\\1", x) [1] " 587 587 587 587" > y <- "aa aa/ aa/bb aa/bb/ aa/bb/cc aa/bb/cc/ aa/bb/cc/dd aa/bb/cc/dd/" > gsub("(^| *)([^/ ]*/?){0,2}", "\\1", y) [1] "cc cc/ cc/dd cc/dd/" Bill Dunlap TIBCO

[R] [R-pkgs] nofrills: Low-Cost Anonymous Functions

2017-10-09 Thread Eugene Ha
Dear R Users, nofrills (0.2.0) has been published on CRAN: https://cran.r-project.org/package=nofrills This lightweight package provides `fn()`, a compact variation of the usual syntax of function declaration, in order to support tidyverse-style quasiquotation of a function’s arguments and body.

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread Big Floppy Dog
Hello Ulrik, I apologize, but I can not see how to provide a pdf in place of the density function which calculates a KDE (that is, something from the dataset in the example). Can you please point to the specific example that might help? Here is what I get: require(mvtnorm) require(ggplot2)

Re: [R] Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)

2017-10-09 Thread Hemant Sain
I'm getting all the rows as NA in Cscore and almost most of the observation in R and F and M are also NA. what can be the reason for this. also suggest me the appropriate solution. On 9 October 2017 at 15:51, Jim Lemon wrote: > Hi Hemant, > Here is an example that might

Re: [R] Regular expression help

2017-10-09 Thread peter dalgaard
> On 9 Oct 2017, at 17:02 , Duncan Murdoch wrote: > > I have a file containing "words" like > > > a > > a/b > > a/b/c > > where there may be multiple words on a line (separated by spaces). The a, b, > and c strings can contain non-space, non-slash characters.

Re: [R] Regular expression help

2017-10-09 Thread Eric Berger
Hi Duncan, You can try this: library(readr) f <- function(s) { t <- unlist(readr::tokenize(paste0(gsub(" ",",",s),"\n",collapse=""))) i <- grep("[a-zA-Z0-9]*/[a-zA-Z0-9]*/",t) u <- sub("[a-zA-Z0-9]*/[a-zA-Z0-9]*/","",t[i]) paste0(u,collapse=" ") } f("f 147/1315/587 2820/1320/587

Re: [R] Regular expression help

2017-10-09 Thread Ulrik Stervbo
Hi Duncan, why not split on / and take the correct elements? It is not as elegant as regex but could do the trick. Best, Ulrik On Mon, 9 Oct 2017 at 17:03 Duncan Murdoch wrote: > I have a file containing "words" like > > > a > > a/b > > a/b/c > > where there may be

[R] Regular expression help

2017-10-09 Thread Duncan Murdoch
I have a file containing "words" like a a/b a/b/c where there may be multiple words on a line (separated by spaces).  The a, b, and c strings can contain non-space, non-slash characters. I'd like to use gsub() to extract the c strings (which should be empty if there are none). A real

[R] Help wanted - R contributed documentation

2017-10-09 Thread Martyn Plummer
The R Foundation is looking for a volunteer to organize the collection of contributed documentation for the R project. The collection is currently hosted on CRAN at https://cran.r-project.org/other-docs.html We want to move it off the CRAN web site. We think that this task would be suitable for

Re: [R-es] Incluir símbolo matemático en data frame

2017-10-09 Thread Manuel Spínola
Muchas gracias Carlos. Pero eso haría que el signo se muestre tal como se deba mostrar , es decir: ≤ Manuel El 9 de octubre de 2017, 1:46, Carlos Ortega escribió: > Puedes incluir estos signos en una columna nueva antes de cada una de las > columnas numéricas. > Que

Re: [R-es] Merge me agrega siempre las columnas

2017-10-09 Thread Jesús Para Fernández
Gracias, Entiendo el resultado, pero claro, si el numero de columnas a agregar coincidentes son muchas, agregarlas obviandolas no es trivial. Creare por lo tanto una fórmula que elimine todas las columans coincidentes tras ser unidas. Gracias de todos modos Jesús

Re: [R-es] Merge me agrega siempre las columnas

2017-10-09 Thread jose luis via R-help-es
Hola Entiendo que donde pusiste k<-c(1,3,8,7)                             querías poner x<-c(1,3,8,7) Si es correcto, creo que el problema es que al ser "y" una variable presente en las dos tablas, o la incluyes como argumento para el cruce o te saldrá "duplicada" (le añade un punto para

Re: [R-es] Merge me agrega siempre las columnas

2017-10-09 Thread Carlos Ortega
Es normal que te esté dando ese resultado. Las columnas "y" de df1 y de df2 no son iguales... Si pruebas con "dplyr" el resultado es este: > library(dplyr) > left_join(df1, df2) Joining, by = c("id", "y") id y z x 1 a1 1 3 NA 2 a2 2 5 NA 3 a3 3 6 NA 4 a4 4 7 7 Que a lo mejor es lo que

Re: [R] Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)

2017-10-09 Thread Jim Lemon
Hi Hemant, Here is an example that might answer your questions. Please don't run previous code as it might not work. I define the break values as arguments to the function (rbreaks,fbreaks,mbreaks) If you want the breaks to work, make sure that they cover the range of the input values, otherwise

[R] Adjusted survival curves

2017-10-09 Thread RStudio
Adjusted survival curves (Thanks to sample code: https://rpubs.com/daspringate/survival ) Thanks to Moderator/Admin's Great Work! For a successful solution I used advice that could be understood: 1. Peter Dalgaard: The code does not work, because the covariates are not factors. 2. Jeff

Re: [R] Manipulations with CO2 dataset on R

2017-10-09 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ludovico > Piccolo > Sent: Sunday, October 8, 2017 4:40 PM > To: r-help@r-project.org > Subject: [R] Manipulations with CO2 dataset on R > > Hi, > I just started a new course this semester on R, I

Re: [R-es] Incluir símbolo matemático en data frame

2017-10-09 Thread Carlos Ortega
Puedes incluir estos signos en una columna nueva antes de cada una de las columnas numéricas. Que el data.frame tuviera esta pinta... Signo_1, Col_1, Signo_2, Col_2, Signo_3, Col_3 "<=", 0.3, ">=", 0.5, "==", 0.8 ">=", 0.8, "<", 0.9, ">", 1 Gracias, Carlos. El 9 de octubre de 2017, 4:02,

Re: [R] example of geom_contour() with function argument

2017-10-09 Thread Ulrik Stervbo
Hi BFD, ?geom_contour() *does* have helpful examples. Your Google-foo is weak: Searching for geom_contour brought me: http://ggplot2.tidyverse.org/reference/geom_contour.html as the first result. HTH Ulrik On Mon, 9 Oct 2017 at 08:04 Big Floppy Dog wrote: > Can someone

Re: [R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-09 Thread Eric Berger
Hi Christofer, The shiny code you have written does not depend on loading the Dat.RData file. I commented out that line and ran your shiny app on my machine and it works fine. What happens if you comment out (or remove) the line load("/home/ubuntu/Dat.RData) Does your shiny app still fail?

[R] example of geom_contour() with function argument

2017-10-09 Thread Big Floppy Dog
Can someone please point me to an example with geom_contour() that uses a function? The help does not have an example of a function, and also I did not find anything from online searches. TIA, BFD ---