[R] Mailing List

2016-04-20 Thread Ogbos Okike
Dear All, I am using R to do my work and thank you very much for developing, maintaining and making such excellent software available to anyone that is interested enough to ask for it. I have registered at Nabble. I was wondering the right forum for me to send my help request. I have tried

Re: [R] Data reshaping with conditions

2016-04-20 Thread Jim Lemon
Hi sri, I think that I see what you mean. Your statements: x = Count_A_less_than_max of (Count type B) y = Count_A_higher_than_max of (Count type B). I took to mean that you wanted a logical value for x and y. Looking more closely at your initial message, I see that you wanted _all_ values of A

Re: [R] overlay two facet_grid

2016-04-20 Thread Ulrik Stervbo
It sounds like you want to use grid.arrange() from gridExtra: https://cran.r-project.org/web/packages/gridExtra/vignettes/arrangeGrob.html Hope this helps, Ulrik On Thu, 21 Apr 2016 at 00:52 Jeff Newmiller wrote: > >

Re: [R] Data reshaping with conditions

2016-04-20 Thread Jim Lemon
Hi sri, As your problem involves a few logical steps, I found it easier to approach it in a stepwise way. Perhaps there are more elegant ways to accomplish this. svdat<-read.table(text="Count id name type 117 335 sally A 19 335 sally A 167 335 sally B 18 340 susan A 56 340 susan A 22 340 susan B

Re: [R] installation problem on Ubuntu

2016-04-20 Thread Jeff Newmiller
Have you read the CRAN instructions for installing on Ubuntu? Have you read the Posting Guide that mentions the R-sig-debian mailing list and that if you need help compiling R this is not the right list? -- Sent from my phone. Please excuse my brevity. On April 20, 2016 9:36:51 AM PDT, Paul

Re: [R] overlay two facet_grid

2016-04-20 Thread Jeff Newmiller
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Overlaying aesthetics is possible. Overlaying graphs is not. Without sample data, concrete examples will be unlikely to appear, so read the above link and pay attention to the dput function. -- Sent from my

[R] overlay two facet_grid

2016-04-20 Thread ch.elahe via R-help
Hi all, Does anyone know how to overlay two facet_grids? I have two facet grids as following: ggplot(data=df,aes(x=TE,y=TR,color="orange"))+geom_point()+facet_grid(FS+TRJ~OR+INV,labeller=label_both)+xlim(0,200)+ylim(0,1)

Re: [R] Parsing and counting expressions in .txt-files

2016-04-20 Thread Bert Gunter
also check out this CRAN task view: https://cran.r-project.org/web/views/NaturalLanguageProcessing.html Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

Re: [R] Parsing and counting expressions in .txt-files

2016-04-20 Thread Bert Gunter
I suggest you go through some R tutorials to learn about R's capabilities. Some recommendations can be found here: https://www.rstudio.com/online-learning/#R To answer your specific query: ?scan ## Because you do not specify file format. ?grep ?regexp ## to use regular expressions to find

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread Jeff Newmiller
The usual culprit in messy code is posting in HTML format. That usually leads to stripping of the formatting by the mailing list and a notice that that occurred, but I don't see that warning here. I still think posting plain text format would fix the problem. -- Sent from my phone. Please

Re: [R] Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?

2016-04-20 Thread Henrik Bengtsson
On Wed, Apr 20, 2016 at 1:25 AM, Martin Maechler wrote: >> Henrik Bengtsson >> on Tue, 19 Apr 2016 14:04:11 -0700 writes: > > > Using the Matrix package, how can I create a row-oriented sparse > > Matrix from scratch

Re: [R] Splitting Numerical Vector Into Chunks

2016-04-20 Thread William Dunlap via R-help
> i <- seq_len(length(x)-1) > split(x, cumsum(c(TRUE, (x[i]==0) != (x[i+1]==0 $`1` [1] 0.144872972504 0.850797178400 $`2` [1] 0 0 0 $`3` [1] 0.199304859380 2.063609410700 0.939393760782 0.838781367540 $`4` [1] 0 0 0 0 0 $`5` [1] 0.374688091264 0.488423999452 0.783034615362 0.626990428900

Re: [R] Splitting Numerical Vector Into Chunks

2016-04-20 Thread Ista Zahn
Perhaps x <- split(x, x == 0) Best, Ista On Wed, Apr 20, 2016 at 9:40 AM, Sidoti, Salvatore A. wrote: > Greetings! > > I have several large data sets of animal movements. Their pauses (zero > magnitude vectors) are of particular interest in addition to the speed

Re: [R] Merging Data Sets with Full Outer Join

2016-04-20 Thread Ista Zahn
Kunden <- Kunden_2011 Kunden <- merge(Kunden, Kunden_2012, by = "Debitor", all = TRUE) etc. See ?merge for details. Best, Ista On Wed, Apr 20, 2016 at 2:23 AM, wrote: > Hi All, > > I would like to match some datasets. Both deliver variables AND cases >

Re: [R] Merging Data Sets with Full Outer Join

2016-04-20 Thread David Winsemius
> On Apr 19, 2016, at 11:23 PM, g.maub...@weinwolf.de wrote: > > Hi All, > > I would like to match some datasets. Both deliver variables AND cases > which might or might not be present in all datasets: > > This sequence > > Kunden <- Kunden_2011 > Kunden <- merge(Kunden, Kunden_2012, >

[R-es] Script sin resultados

2016-04-20 Thread Manuel Máquez
Carlos: Nuevamente te agradezco tu respuesta y más aún por la rapidez de la misma. Voy a poner en práctica tu sugerencia, posteriormente te comentaré los resultados. Hasta luego y muchas gracias. Atentamente, *MANOLO MÁRQUEZ P.* [[alternative HTML version deleted]]

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread A A via R-help
Thanks for the help. Sorry, I am not sure why it looks like that in the mailing list - it looks much more neat on my end (see attached file). On Wednesday, April 20, 2016 2:01 PM, Berend Hasselman wrote: > On 20 Apr 2016, at 13:22, A A via R-help

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread A A via R-help
Thanks for the response. Yes, in that situation a solution of x = 1 would be just as good as x = 1000 or any other value of x for me (but in my problem the matrix has nonzero rank, so I can't just randomly choose a vector and have it be a solution). If it helps, what I'm interested in is the R

[R] Parsing and counting expressions in .txt-files

2016-04-20 Thread Alexander Nikles
Dear Community, I hope that I have the right category selected because I am relatively new to the "R" world. I come with a relatively challenging problem in the luggage. I would like to realize, that "R" reads text files (there are several hundred pieces in my folder) sequentially, and screens

[R] Splitting Numerical Vector Into Chunks

2016-04-20 Thread Sidoti, Salvatore A.
Greetings! I have several large data sets of animal movements. Their pauses (zero magnitude vectors) are of particular interest in addition to the speed distributions that precede the periods of rest. Here is an example of the kind of data I am interested in analyzing: x <-

Re: [R] project test data into principal components of training dataset

2016-04-20 Thread olsen
For the records, a slightly hacky answer, by modifying the ggbiplot function, is provided now here: http://stackoverflow.com/questions/36603268/how-to-plot-training-and-test-validation-data-in-r-using-ggbiplot On 18/04/16 17:20, olsen wrote: > Hi there, > > I've a training dataset and a test

[R] Merging Data Sets with Full Outer Join

2016-04-20 Thread G . Maubach
Hi All, I would like to match some datasets. Both deliver variables AND cases which might or might not be present in all datasets: This sequence Kunden <- Kunden_2011 Kunden <- merge(Kunden, Kunden_2012, by.x = "Debitor", by.y = "Debitor") Kunden <- merge(Kunden, Kunden_2013,

[R] installation problem on Ubuntu

2016-04-20 Thread Paul Tremblay
I needed to update R so I could install ggplot. I am running Ubuntu 12.04. I cannot upgrade Ubuntu because I am using a work computer. I tried upgrading the normal way: sudo apt-get update sudo apt-get install r-base r-base-dev But this only installed an earlier version. Finally I tried

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread A A via R-help
Thanks for the advice. I fixed the function and ran it on my systems just to see if it would work; for the first set of A and b, I got a valid solution, but for the second set, I got the error "Error in complete.cases(x, y, wt) : not all arguments have the same length".  On Wednesday,

Re: [R-es] ¿Es "R" recomendable como lenguaje para alguien que quiere empezar a programar?....

2016-04-20 Thread rubenfcasal
Ola a todos, Doy por hecho que a la persona no le interesa especialmente la estadística... Mientras escribía el correo, ya se adelantaron Antonio y Carlos Gil, coincidiría con ellos... Tengo visto herramientas gráficas y cursos para empezar a programar (en general) que

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread Berend Hasselman
> On 20 Apr 2016, at 13:22, A A via R-help wrote: > > > > > I have a situation in R where I would like to find any x (if one exists) that > solves the linear system of equations Ax = b, where A is square, sparse, and > singular, and b is a vector. Here is some code

Re: [R-es] ¿Es "R" recomendable como lenguaje para alguien que quiere empezar a programar?....

2016-04-20 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Algo que desconcierta a quienes aprenden R es que no existe una manera obvia (y preferiblemente única) de hacer las cosas. En Python, por ejemplo, se trata de que sea así (véase https://www.python.org/dev/peps/pep-0020/). R es caótico, desordenado y está plagado de sublenguajes

Re: [R-es] ¿Es "R" recomendable como lenguaje para alguien que quiere empezar a programar?....

2016-04-20 Thread Antonio Maurandi López
yo siempre que alguien me hace esa pregunta le hablo de Phyton. me parece sencillo y claro, muy potente y hay muchos cursos iniciales..., es muy popular, y el paso a R es tb fácil. El 20/04/16 a las 18:21, Carlos Ortega escribió: Hola, Quería preguntaros por vuestra opinión aunque esta

Re: [R-es] ¿Es "R" recomendable como lenguaje para alguien que quiere empezar a programar?....

2016-04-20 Thread Javier Marcuzzi
Estimado Carlos Yo creo que no. En mi caso de pequeño tenía una computadora y los juegos estaban en casette o comprábamos revistas con los códigos. Pero cuándo aprendí ya tenía algo más de edad, y es la base de datos, programación fue en la universidad con Fortran en genética, y yo a mi

[R-es] ¿Es "R" recomendable como lenguaje para alguien que quiere empezar a programar?....

2016-04-20 Thread Carlos Ortega
Hola, Quería preguntaros por vuestra opinión aunque esta discusión pueda ser algo "offtopic". Para alguien que quiere empezar a programar, ¿recomendaríais R?. Visto que "R" aun siendo un lenguaje que nació con una orientación muy específica, ya se usa como de propósito general, quizás podría ser

Re: [R] installation of dplyr

2016-04-20 Thread Ben Tupper
Increasing memory resolved the issue for me. Thanks again, Ben > On Apr 19, 2016, at 4:10 PM, Hadley Wickham wrote: > > You normally see these errors when compiling on a vm that has very > little memory. > Hadley > > On Tue, Apr 19, 2016 at 2:47 PM, Ben Tupper

Re: [R] Reading Multiple Output Variables

2016-04-20 Thread Jeff Newmiller
The word "analysis" is too vague. If you are referring to lm regression, you can specify Y as a matrix instead of a vector. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Also, please disable HTML in your email when sending to this list, since it will

Re: [R] Use multiple cores on Linux

2016-04-20 Thread Jeff Newmiller
The answer to your question is yes. You might consider using the parallel package., and I would suggest starting with a simpler test case to learn how it works and incrementally adding complexity of packages and data handling. -- Sent from my phone. Please excuse my brevity. On April 20,

[R] Reading Multiple Output Variables

2016-04-20 Thread jody.kelly
Hi all, I am trying to read multiple out variables for a sensitivity analysis. Currently using one output value as follows: Y<-(E1) However I need to run analysis against 12 values of Y. So E1-E12. My matrix will be: Inputs are Column=4, Rows = 40 i.e. 40 rows of 4 input variables in

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread Jeff Newmiller
This is kind of like asking for a solution to x+1=x+1. Go back to linear algebra and look up Singular Value Decomposition, and decide if you really want to proceed. See also ?svd and package irlba. -- Sent from my phone. Please excuse my brevity. On April 20, 2016 4:22:34 AM PDT, A A via

Re: [R] Solving sparse, singular systems of equations

2016-04-20 Thread William Dunlap via R-help
This is not a solution but your lsfit attempt #Error in lsfit(A, b) : only 3 cases, but 4 variables lsfit(A,b) gave that error because lsfit adds a column of 1 to its first argument unless you use intercept=FALSE. Then it will give you an answer (but I think it converts your sparse matrix

Re: [R] Add a vertical arrow to a time series graph using ggplot and xts

2016-04-20 Thread Giorgio Garziano
Please see updates to df2 assignment as shown below. library(xts) # primary #library(tseries) # Unit root tests library(ggplot2) library(vars) library(grid) dt_xts<-xts(x = 1:10, order.by = seq(as.Date("2016-01-01"), as.Date("2016-01-10"), by = "1 day"))

[R] Use multiple cores on Linux

2016-04-20 Thread Miluji Sb
I am trying to run the following code in R on a Linux cluster. I would like to use the full processing power (specifying cores/nodes/memory). The code essentially runs predictions based on a GAM regression and saves the results as a CSV file for multiple sets of data (here I only show two). Is it

[R] Data reshaping with conditions

2016-04-20 Thread sri vathsan
Dear All, I am trying to reshape the data with some conditions. A small part of the data looks like below. Like this there will be more data with repeating ID. Count id name type 117 335 sally A 19 335 sally A 167 335 sally B 18 340 susan A 56 340 susan A 22 340 susan B 53 340 susan B 135 351

Re: [R] Merge sort

2016-04-20 Thread Duncan Murdoch
On 20/04/2016 7:38 AM, Gaston wrote: I indeed used is.na() to check length, as I was not sure weather lenght() was a simple query or would go through the whole vector to count the elements. length() is a simple query, and is very fast. The other problem in your approach (which may not be a

Re: [R] Merge sort

2016-04-20 Thread Gaston
I indeed used is.na() to check length, as I was not sure weather lenght() was a simple query or would go through the whole vector to count the elements. So to sum up, function calls are expensive, therefore recursion should be avoided, and growing the size of a vector (which is probably

Re: [R-es] Script sin resultados

2016-04-20 Thread Carlos Ortega
Hola, Si he entendido lo que quieres hacer, el conseguir cuántos 0, 1, 2.. hay por columna, se me ocurre esta alternativa. #--- col_ref <- 0:max(bas) res_df <- 0 for(i in 1:ncol(bas)) { print(i) tmp_val <- as.data.frame(table(bas[,i]))

Re: [R] Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?

2016-04-20 Thread Martin Maechler
> Henrik Bengtsson > on Tue, 19 Apr 2016 14:04:11 -0700 writes: > Using the Matrix package, how can I create a row-oriented sparse > Matrix from scratch populated with some data? By default a > column-oriented one is created and I'm aware of

Re: [R] Problem with X11

2016-04-20 Thread Lorenzo Isella
Hello! Today on debian testing R 3.2.5 was delivered among the updates. The X11 problem is no longer there. Cheers Lorenzo On Tue, Apr 19, 2016 at 02:28:44PM -0400, Tom Wright wrote: I don't have my debian box available so can't confirm. But I would try $apt-get install libpng On Tue, Apr 19,