Re: [R] Opening or activating a URL to access data, alternative to browseURL

2016-10-11 Thread Duncan Murdoch
On 11/10/2016 7:59 AM, Ryan Utz wrote: Bob/Duncan, Thanks for writing. I think some of the things Bob mentioned might work, but I'm still not quite getting there. Below is the example I'm working with: It worked for me when I replaced the browseURL call with a readLines call, as I suggested

Re: [R] Documenting a function using roxygen2

2016-10-11 Thread Jeff Newmiller
I was under the impression that the comment block is attached to the global object that immediately follows the comment block, so this placement is NOT optional. -- Sent from my phone. Please excuse my brevity. On October 11, 2016 6:46:51 AM PDT, Thierry Onkelinx

[R] Error in reading netcdf files into R

2016-10-11 Thread mamuash bukana
Dear all, I have installed necessary packages such as ncdf4 and RNetCDF. But still my machine can't read netcdf files into R. Below are the file formats and the respective errors: > open.nc("cru.ts3.23.1901.2014.tmx.dat.nc") Error: No such file or directory >

Re: [R] multiple uses ifelse function

2016-10-11 Thread S Ellison
> -Original Message- > testseq<-seq(1:20) > testchange<-ifelse(testseq<=4,'x',testseq) > testchange<-c(ifelse(testseq<=4,'x',testseq),ifelse(testseq>=5,'y',testseq)) > > The last instruction causes the vector 'testchange' to change dimensions, Of course it does. ifelse(test, yes, no)

Re: [R] Output formatting in PDF

2016-10-11 Thread Jeff Newmiller
Or package "knitr". Note that knitr can be used with LaTeX or markdown syntax, but from your description the former would be advised. -- Sent from my phone. Please excuse my brevity. On October 11, 2016 1:59:59 AM PDT, Enrico Schumann wrote: >On Tue, 11 Oct 2016,

Re: [R] Documenting a function using roxygen2

2016-10-11 Thread Thierry Onkelinx
Dear Georg, My 2 eurocents. - I'd place the Roxygen header just above the function instead of instead the function. That makes your function more readable. - Use only tags that Roxygen knows about. - Use version controle instead of the version, created and updated tags. - You can specify the

[R] Documenting a function using roxygen2

2016-10-11 Thread G . Maubach
Hi All, I began to document my functions using roxygen2. This is an example of a function I would like to write for training and testing purposes: t_simple_table <- function(variable, useNA = TRUE, print = FALSE) { #' @title Create a

Re: [R] Output formatting in PDF

2016-10-11 Thread Preetam Pal
Hey Enrico, LaTex is not possible actually. On Tue, Oct 11, 2016 at 2:29 PM, Enrico Schumann wrote: > On Tue, 11 Oct 2016, Preetam Pal writes: > > > Hi, > > > > Can you please help me with the following output formatting: > > I am planning to

Re: [R] Output formatting in PDF

2016-10-11 Thread Dominik Schneider
You may be able to do everything you need with the cowplot package. On Tue, Oct 11, 2016 at 4:26 AM, Preetam Pal wrote: > Hey Enrico, > LaTex is not possible actually. > > On Tue, Oct 11, 2016 at 2:29 PM, Enrico Schumann > wrote: > > > On Tue, 11

Re: [R] Opening or activating a URL to access data, alternative to browseURL

2016-10-11 Thread Ryan Utz
Bob/Duncan, Thanks for writing. I think some of the things Bob mentioned might work, but I'm still not quite getting there. Below is the example I'm working with: #1 browseURL('http://pick18.discoverlife.org/mp/20m?plot= 2=Hypoprepia+fucosa=33.9+-83.3=2011,2012, 2013=build_txt:') # This opens

Re: [R] multiple uses ifelse function

2016-10-11 Thread Jorge Cimentada
Hi Letter, This should do it: testchange <- ifelse(testseq <= 4,'x', ifelse(testseq >= 5, 'y', testseq)) Read it as: if testseq <=4, print x, ifelse test seq >=5, print y, any other case, print testseq. [[alternative HTML version deleted]] __

Re: [R] Recoding lists of categories of a variable

2016-10-11 Thread peter dalgaard
On 11 Oct 2016, at 01:32 , S Ellison wrote: >> Well, I think that's kind of overkill. > Depends whether you want to recode all or some, and how robust you want the > answer to be. > recode() allows you to recode a few levels of many, without dependence on > level

Re: [R] multiple uses ifelse function

2016-10-11 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jorge > Cimentada > Sent: Tuesday, October 11, 2016 11:47 AM > To: message > Cc: r-help@R-project.org > Subject: Re: [R] multiple uses ifelse function > > Hi Letter, > > This

Re: [R] Recoding lists of categories of a variable

2016-10-11 Thread S Ellison
> If you are concerned about missing levels -- which I agree is legitimate -- > then > the following simple modification works (for > **factors** of course): > > > d <- factor(letters[1:2],levels= letters[1:3]) d > [1] a b > Levels: a b c > > f <- factor(d,levels = levels(d), labels =

Re: [R] date comparison doesn't match value

2016-10-11 Thread Simon, Heather
Thanks Jim and others who have responded to this post! Jim, this is exactly what happened. I was having some trouble with date comparisons which turned out to be a time zone conversion issue even though the two dates I was comparing both said they were EST, when you subtracted one from the

Re: [R] Recoding lists of categories of a variable

2016-10-11 Thread Bert Gunter
> Hardly a showstopper though; we're in timtowdi territory here and we're > allowed a bit of personal preference. Absolutely. I appreciate your constructive comments, however. Cheers, Bert __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] Hclust

2016-10-11 Thread David L Carlson
Not for hclust() since it provides results for all clusters from 1 to n (the number of observations). Adding a point can change the definition of the clusters. You could use cutree() to assign the observations to clusters for a particular number of clusters, but then you must decide what rule

Re: [R] Output formatting in PDF

2016-10-11 Thread Duncan Mackay
Hi There is also the basic option of using the grid package and viewports. You can then place the plots where you want and annotate them pdf(file= paste0("01", ".pdf"), height = 3.5, width = 7, paper = "special", onefile = TRUE, family =

[R] which properly to avoid pointer copy Tcl Tk? 'externalptr'

2016-10-11 Thread Cleber N.Borges
hello, I'm trying to disable an tkentry widget with a tkcheckbutton using an R function via the command flag. but I get an error regardding copy of the pointer: 'externalptr' which properly way to avoid this? thanks, cleber > library( tcltk ) > tp <- tktoplevel() > > chk

[R] Output formatting in PDF

2016-10-11 Thread Preetam Pal
Hi, Can you please help me with the following output formatting: I am planning to include 2 plots and some general description in a one-page PDF document, such that - I'll leave some appropriate margin on the PDF- say, 1.5 inches top,right, bottom and left (will decide based on overall

Re: [R] turning comma separated string from multiple choices into

2016-10-11 Thread Bob Rudis
Take a look at tidyr::separate() On Fri, Oct 7, 2016 at 12:57 PM, silvia giussani wrote: > Hi all, > > > > could you please tell me if you find a solution to this problem (in > Subject)? > > > > June Kim wrote: > >>* Hello,* > >> > >>* I use google docs' Forms to

Re: [R] Question about ggplot2 symbol and legend change

2016-10-11 Thread Thierry Onkelinx
Dear Luis, Please don't post in HTML, it mangles the code. You want something like p + scale_shape_manual(values = c(16, 2)) Untested as you failed to provide a reproducible example. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and

Re: [R] Output formatting in PDF

2016-10-11 Thread Enrico Schumann
On Tue, 11 Oct 2016, Preetam Pal writes: > Hi, > > Can you please help me with the following output formatting: > I am planning to include 2 plots and some general description in a one-page > PDF document, such that > >- I'll leave some appropriate margin on the PDF-

[R] multiple uses ifelse function

2016-10-11 Thread message
Readers, Could someone please explain how to apply the function 'ifelse' to change a vector, for various conditions? testseq<-seq(1:20) testchange<-ifelse(testseq<=4,'x',testseq) testchange<-c(ifelse(testseq<=4,'x',testseq),ifelse(testseq>=5,'y',testseq)) The last instruction causes the

Re: [R-es] Alto rendimiento

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Carlos Gil Bellosta ¿Cómo está usted? En estos lados de América del sur comienza la primavera, desde la ventana miro la parra contando las posibles uvas, siempre aparece un ave que se arrima a la ventana o incluso llegan hasta la computadora como si supiesen usarla. Ahora en R. En

Re: [R-es] Alto rendimiento

2016-10-11 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Spark correría en tantos hilos como estuviese configurado a utilizar (con límite en los existentes). La promesa de sparklyr es que se trata de una mera interfaz que delega el procesamiento de datos en Spark. Spark paralelizaría (que de eso trata). Un saludo, Carlos J. Gil

Re: [R-es] Alto rendimiento

2016-10-11 Thread Carlos Ortega
Hola, Son muchas cosas juntas... por separar: - Las librerías de Microsoft. - ¿Te refieres a las que soporta su versión de R: "Open R"? - Están modificadas para que en Windows puedas utilizar fácilmente varios cores (varios hilos) utilizando una librería de Intel que se

Re: [R-es] Alto rendimiento

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Carlos Ortega Comprendo que hay que tener el paquete compilado para acceder al alto rendimiento, por lo cuál si está todo preparado para trabajar en un clúster y para aprovechar múltiples hilos, no habría problemas, calculo que si una librería no tiene esa tecnología no traería

Re: [R-es] Colapsar una matriz con NA en una única fila

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Oscar Benitez Yo utilizo algo como lo siguiente: Datos<- Datos[ !is.na(Datos$DatoX),]#Solo dejo filas en las que las tratamiento son diferentes de cero Javier Rubén Marcuzzi De: Oscar Benitez Enviado: martes, 11 de octubre de 2016 15:22 Para: R-help-es Asunto: [R-es] Colapsar

[R-es] Colapsar una matriz con NA en una única fila

2016-10-11 Thread Oscar Benitez
Hola Consulto por un problema que no consigo resolver. Tengo un dataframe con muchas columnas todas de texto. Cada columna tiene solamente un valor válido y el resto son NAs. También cada fila tiene un único valor válido. Quiero colapsar ese data frame en uno que tenga solamente una fila y todas

Re: [R-es] Colapsar una matriz con NA en una única fila

2016-10-11 Thread Carlos Ortega
Hola, Esto te puede valer... > # Crear un df con NAs y solo un elemento por columna no NA > df <- as.data.frame(matrix(data = NA, nrow = 10, ncol = 5 )) > set.seed(1) > df2 <- apply(df, 2, function(x) { x[sample(1:10,1)] <- rnorm(1); x}) > df2 V1 V2 V3 V4

Re: [R-es] Alto rendimiento

2016-10-11 Thread Carlos Ortega
Hola, - Si tu "paso 3" te refieres a un algoritmo que no está en MLlib, este algoritmo se ejecutaría en el "Master" sin distribuir. El problema vendría de si tiene suficiente capacidad para procesar todo lo que le devuelva el "paso 2". - Lo que comentas de Microsoft, ¿no pagas

Re: [R-es] Alto rendimiento

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Carlos Ortega Comprendo, si se ejecuta en el master no se distribuye y no habría problemas, salvo la capacidad de cálculo en máquina, que por más optimización de código la memoria y el proceso son necesarios y no se pueden esquivar. Los servicios me Microsoft son desde gratis a

Re: [R-es] Colapsar una matriz con NA en una única fila

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Oscar Benitez Use la solución de Carlos Ortega, mi solución busca cuándo no tienen NA, pero si están en distinta fila a usted le sirve y yo lo descarto. Javier Rubén Marcuzzi De: javier.ruben.marcu...@gmail.com Enviado: martes, 11 de octubre de 2016 19:29 Para: Oscar Benitez CC:

Re: [R-es] Colapsar una matriz con NA en una única fila

2016-10-11 Thread javier.ruben.marcuzzi
Estimado Oscar Benitez Tendría que probarlo, pero el código que yo le envié no está para copiar y pegar, lo que esta entre [] filtra una Var, no las tres, para las tres al mismo tiempo debe completar el código entre [ …] Algo tipo: lista <- lista[!is.na(lista$Var1) & !is.na(lista$Var2),]