[R] Add local image as inline embedded Image

2017-04-06 Thread Archit Soni
Hi All, I am using mailR package to send emails by attaching my local image files. However the image still refers to my file location and never truly embeds the image in the email. This came up in testing when my colleague was getting a red cross instead of an image. Any thoughts to resolve

Re: [R] readr to generate tibble from a character matrix

2017-04-06 Thread David L Carlson
Ulrik's solution gives you factors. To get them as characters, add as.is=TRUE: > m %>% +as_tibble() %>% +lapply(type.convert, as.is=TRUE) %>% +as_tibble() # A tibble: 4 × 5 A B C D E 1 a e i 1 11.2 2 b f j 2 12.2 3 c

Re: [R] Is there a way to get R script line number

2017-04-06 Thread Bert Gunter
I believe the answer is: No. "Line number" is an ambiguous concept. Does it mean physical line on a display of a given width? a line of code demarcated by e.g. ; a step in the execution of script (that might display over several physical lines?) However, various IDE's have and display "line

[R] Is there a way to get R script line number

2017-04-06 Thread Brad P
Hello, Is there a way to get the current line number in an R script? As a silly example, if I have the following script and a function called getLineNumber (suppose one exists!), then the result would be 3. 1 # This is start of script 2 3 print( getLineNumber() ) 4 5 # End of script Thanks for

Re: [R] readr to generate tibble from a character matrix

2017-04-06 Thread Ben Tupper
Hi, Thanks for this solution! Very slick! I see what you mean about the two calls to as_tibble(). I suppose I could do the following, but I doubt it is a gain... mm <- lapply(colnames(m), function(nm, m) type.convert(m[,nm], as.is = TRUE), m=m) names(mm) <- colnames(m) as_tibble(mm) # # A

Re: [R] average at specific hour "endpoints" of the day

2017-04-06 Thread Jeff Newmiller
On Thu, 6 Apr 2017, Massimo Bressan wrote: hello given my reproducible example #--- date<-seq(ISOdate(2017,1, 1, 0), by="hour", length.out = 48) v1<-1:48 df<-data.frame(date,v1) #-- "date" and "df" are functions in base R... best to avoid hiding them by re-using those names in the global

Re: [R-es] Servicios en la nube

2017-04-06 Thread Carlos Ortega
Hola, Sí, es el "IBM DataScience Experience", nos lo enseñaron en una reunión conjunta de R e IBM. http://datascience.ibm.com/ En modo trial y creo que es perpetua el uso (al menos por ahora) tienes RStudio, Spark y recientemente han incorporado H2O. Este modo trial tiene 2Gb de capacidad.

Re: [R-es] Suavizado espacial por adyacencia

2017-04-06 Thread Carlos Ortega
Hola, Mira esto: https://github.com/dkahle/ggmap Gracias, Carlos Ortega www.qualityexcellence.es El 6 de abril de 2017, 12:59, "Raúl Vaquerizo" < rvaquer...@analisisydecision.es> escribió: > Hola, > > ¿Conocéis algún paquete de R (que no sea raster) que permita hacer > suavizados espaciales

Re: [R] readr to generate tibble from a character matrix

2017-04-06 Thread Ulrik Stervbo
Hi Ben, type.convert should do the trick: m %>% as_tibble() %>% lapply(type.convert) %>% as_tibble() I am not too happy about to double 'as_tibble' but it get the job done. HTH Ulrik On Thu, 6 Apr 2017 at 16:41 Ben Tupper wrote: > Hello, > > I have a workflow

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Sebastien Moretti
This is far from portable programming but as R looks to search for /etc/localtime it is simpler for me do like that. I will not patch R source code to make "make check" step works. Then for my own code, I will use x <- as.POSIXct(strptime("2002-02-02 02:02", "%Y-%m-%d %H:%M")) or

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Jeff Newmiller
I cannot imagine a less desirable solution. This is the opposite of portable programming. -- Sent from my phone. Please excuse my brevity. On April 6, 2017 5:29:08 AM PDT, Sebastien Moretti wrote: >I have just found the solution. > >We have a custom Linux

Re: [R] A question on modeling brain growth using GAM

2017-04-06 Thread Simon Wood
> > gamObj=gam(brainVolume~ s(correctedAge) + s(subjIndexF, bs="re") + > s(subjIndexF, correctedAge, bs="re"), method="REML", data=mydata), > where subjIndexF is a factor for each subject. I was thrown an error > saying "more coefficients than data". > --- I'm not sure exactly how many scans

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Jeff Newmiller
You always need to set your timezone somehow when converting to POSIXt. Technically the method for doing this varies by OS, but on all environments I have worked with you can set the default timezone with something like Sys.setenv( TZ="Etc/GMT+5" ) In your example, some timezones supporting

[R] readr to generate tibble from a character matrix

2017-04-06 Thread Ben Tupper
Hello, I have a workflow yields a character matrix that I convert to a tibble. Here is a simple example. library(tibble) library(readr) m <- matrix(c(letters[1:12], 1:4, (11:14 + 0.2)), ncol = 5) colnames(m) <- LETTERS[1:5] x <- as_tibble(m) # # A tibble: 4 × 5 # A B C D

Re: [R] plotting gam plots from mgcv package

2017-04-06 Thread Simon Wood
See 'shade' parameter in ?plot.gam (mgcv) On 06/04/17 00:34, Husam El Alqamy wrote: Dear List I am fitting some GAM models using the package mgcv. When plotting the response curves of the individual predictors using gam.plot I get a dotted line of the confidence interval around the fitted line.

Re: [R] conditional regression with mgcv

2017-04-06 Thread Simon Wood
My guess is that the model has identifiability problems and that this is then causing a problem (not caught properly) in the model fitting optimizer. Is there any chance you could send data that produces the problem (off list) and I can try it out (I will only use any data for this

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Sebastien Moretti
I have just found the solution. We have a custom Linux distribution that allows us to have several R (+ glibc and others) versions in parallel for tools related to our job domain. We have another etc/ folder for those tools and R looks for the localtime file there, not in /etc/. So linking

Re: [R] A question on modeling brain growth using GAM

2017-04-06 Thread Simon Wood
If 'subjIndexF' is a factor for subject, then s(subjIndexF, bs="re") will produce a random effect for subject. i.e. each subject will be given its own random intercept term, which is a way that repeated measures data like this are often handled. The reason for the s(subjIndexF, bs="re")

Re: [R-es] Servicios en la nube

2017-04-06 Thread Javier Marcuzzi
Estimados Hay otro servicio ofrecido por IBM, no tengo experiencia en utilizarlo, si desea ver algo al respecto encontré un video de su utilización con RStudio en https://www.youtube.com/watch?v=leKCMu9TrEI Javier Rubén Marcuzzi De: Carlos Ortega Enviado: miércoles, 5 de abril de 2017 17:02

[R-es] Suavizado espacial por adyacencia

2017-04-06 Thread Ra�l Vaquerizo
Hola, ¿Conocéis algún paquete de R (que no sea raster) que permita hacer suavizados espaciales por adyacencia? Dispongo de un modelo que distribuye de forma irregular los residuos en base a una distribución geográficas y me gustaría que aquellas zonas donde no dispongo información "se contagien"

[R] average at specific hour "endpoints" of the day

2017-04-06 Thread Massimo Bressan
hello given my reproducible example #--- date<-seq(ISOdate(2017,1, 1, 0), by="hour", length.out = 48) v1<-1:48 df<-data.frame(date,v1) #-- I need to calculate the average of variable v1 at specific hour "endpoints" of the day: i.e. at hours 6.00 and 22.00 respectively the desired

Re: [R] taking a small piece of large tiff

2017-04-06 Thread Ranjan Maitra
Hello Louisa, THis is not a R solution but would it not be easier to use ImageMagick to do what you are wanting to do? Look up https://www.imagemagick.org/script/index.php HTH, Ranjan On Wed, 5 Apr 2017 08:23:51 +0100 Louisa Reynolds via R-help wrote: > Ok. I have a

[R] Using R Markdown for creating reproducible manuscripts – new blog post from eLife Labs

2017-04-06 Thread Emily Packer
[With apologies for cross-posting] Hi all, We have today published a blog post on eLife Labs about how scientists can use the dynamic document language, R Markdown, for creating reproducible manuscripts. At eLife, we aim to make the communication of results more beneficial for the scientific

Re: [R] as.POSIXct character string is not in a standard unambiguous format

2017-04-06 Thread Sebastien Moretti
Hi Ben Thanks for your answer I have already tried this, as well as x <- as.POSIXct(strptime("2002-02-02 02:02", "%Y-%m-%d %H:%M")) It works! But it does not fix it widely for all tests used during the "make check" step at compile time. Unless I patch all of them. There is something with

Re: [R] ggplot2 question plot mean/error bars

2017-04-06 Thread PIKAL Petr
Hi Put geom point call to the end of the commands p<-ggplot(q3[as.character(q3$D)%in%c("D1","D2"),],aes(x=t,y=b.mean,group=D,col=D,fill=D)) p+ geom_line() + geom_errorbar(width=.2,aes(ymin=b.mean-b.se,ymax=b.mean+b.se)) + scale_shape_manual(values = c(16,21)) +