[R] unable to move temporary installation when install some packages

2014-09-11 Thread PO SU
Dear expeRts, These days  i and some of my friends often encount   the same problem when installing packages, e.g. when i try to install.packages(stringi), i will get : package ‘stringi’ successfully unpacked and MD5 sums checked Warning in install.packages : unable to move temporary

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PIKAL Petr
Hi You still do not disclose important info about details of your functions. However, when you want to perform indexing like you show, you maybe can get rid of NULL and use zero instead. a-1:5 a[-c(1,3)] [1] 2 4 5 a[-c(0,1,3)] [1] 2 4 5 a[-c(1,0,3)] [1] 2 4 5 a[-c(0,1,0,3,0)] [1] 2 4 5

Re: [R] unable to move temporary installation when install some packages

2014-09-11 Thread Prof Brian Ripley
On 11/09/2014 07:19, PO SU wrote: Dear expeRts, These days i and some of my friends often encount the same problem when installing packages, e.g. when i try to install.packages(stringi), i will get : package ‘stringi’ successfully unpacked and MD5 sums checked Warning in install.packages

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PO SU
It really suprise me that a[-c(0,1,2)] works as a[-c(1,2)]. But, unfortunately, a[-0] still can't work . That 's mean: i want: a-1:3 a[-0] 1 2 3 or a[-NULL] 1 2 3 -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-09-11 02:24:25, PIKAL Petr

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PIKAL Petr
Hi If you insist on this behaviour you need to redefine [ function to suit your needs. You can see there is already plenty of methods for this operator. methods([) [1] [.acf* [.arrow* [.AsIs [.bibentry* [5] [.data.frame [.Date [.difftime

[R] Margins to fill matrix

2014-09-11 Thread Stefan Petersson
Hi, I have two vector of margins. Now I want to create fill matrix that reflects the margins. seats - c(17,24,28,30,34,36,40,44,46,50) mandates - c(107,23,24,19,112,19,25,20) Both vectors adds up to 349. So I want a 10x8 matrix with row sums corresponding to seats and column sums

Re: [R] Building R for better performance

2014-09-11 Thread arnaud gaboury
I got the benchmark script, which I've attached, from Texas Advanced Computing Center. Here are my results (elapsed times, in secs): Where can we get the benchmark script? __ R-help@r-project.org mailing list

[R] How to get JRI package

2014-09-11 Thread madhvi.gupta
Hi, My R Studio version is 3.1.0 but JRI package is not getting installed on it.It is giving the following error. package ‘JRI’ is not available (for R version 3.1.0) Is there any another way to do this? Thanks __ R-help@r-project.org mailing list

Re: [R] R, Big Data and books

2014-09-11 Thread Angel Rodriguez
Sorry for that, Glenn. http://statweb.stanford.edu/~tibs/ElemStatLearn/ Have also a look at this that I've run into: http://codecondo.com/9-free-books-for-learning-data-mining-data-analysis/ Best regards, Angel De: Glenn Doherty [mailto:glennrdohe...@gmail.com] Enviado el: miércoles, 10 de

Re: [R] How to get JRI package

2014-09-11 Thread Pascal Oettli
Hi, As far as I know, there is any package JRI. You need to install rJava. Regards, Pascal On Thu, Sep 11, 2014 at 6:08 PM, madhvi.gupta madhvi.gu...@orkash.com wrote: Hi, My R Studio version is 3.1.0 but JRI package is not getting installed on it.It is giving the following error. package

Re: [R] some question about vector[-NULL]

2014-09-11 Thread Duncan Murdoch
On 10/09/2014, 9:53 PM, PO SU wrote: Tks, i think using logical index is a way, but to do that, i have to keep a vector as long as the original vector. that's, to exclude position 1 and 3 from a-1:5 I have to let b-c(F,T,F,T,T) and exec a[b], not a[-c(1,3)]. which c(1,3) is much

Re: [R] How to get JRI package

2014-09-11 Thread Pascal Oettli
Please check this link, particularly the red line: http://rforge.net/JRI/ Regards, Pascal On Thu, Sep 11, 2014 at 6:44 PM, madhvi.gupta madhvi.gu...@orkash.com wrote: I already have rjava.JRI package is for r java interface On 09/11/2014 02:44 PM, Pascal Oettli wrote: Hi, As far as I

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PO SU
Orignally i don't want to do the if ( length) check because i know that in a 1 loops, after may be 10 or 20 or 100 loops , i will not be empty. so i mean , in the left loops, i would always check something not needed to check which i would not like to do.   -- PO SU mail:

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PO SU
Actually, i  thought  the way: a-1:3 b-NULL or 2 a[-b] will not work if b is NULL A-c(a,1) B-c(b,length(A)) A[-B] will get the same result as if b is NULL get a, if b is 2 get a[-2] I think it works well  in considering memory use or efficiency or code tidy. -- PO SU mail:

Re: [R] sequential input script dataframe process functionality

2014-09-11 Thread rl
On 2014-09-10 10:45, PIKAL Petr wrote: On 2014-09-08 15:47, William Dunlap wrote: d - data.frame(Choices=c(One,Two,One,Three), X=1:4) i - 1 # possible output of menu(unique(d$Choices)) d[ d$Choices[i] == d$Choices, ] # Choices X #1 One 1 #3 One 3 testd -

Re: [R] some question about vector[-NULL]

2014-09-11 Thread Duncan Murdoch
On 11/09/2014, 6:04 AM, PO SU wrote: Actually, i thought the way: a-1:3 b-NULL or 2 a[-b] will not work if b is NULL A-c(a,1) If a is a long vector, that is a very expensive operation, at least as expensive as constructing a logical vector of the same length as a. B-c(b,length(A))

Re: [R] marketing-questionnaire with split-design

2014-09-11 Thread Jim Lemon
On Tue, 9 Sep 2014 04:42:11 PM Norbert Dörrer wrote: Dear Experts I'm quite new to the world of R; so maybe my question is kind of beginners... I am right now trying to analyse questionnaire data (CAWI) for producing a image/positioning map of the competitors of my company; when

Re: [R] marketing-questionnaire with split-design

2014-09-11 Thread Jim Lemon
On Thu, 11 Sep 2014 08:58:54 PM Jim Lemon wrote: Sorry, copying fumble. The last line in the loop should read: sum(nddf[subject,seq(2,10,by=2)])) Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Linkage disequilibrium plot

2014-09-11 Thread Sabine Siegert
Hi, I want to generate a LD plot that looks like the triangle in the lower part of the output of snp.plotter() As I would not use the values of the original LD measure (instead I use a more general measure) I have calulated pairwise correlation on my own. I could arrange the results in a data

Re: [R] some question about vector[-NULL]

2014-09-11 Thread Philippe GROSJEAN
On 11 Sep 2014, at 08:24, PIKAL Petr petr.pi...@precheza.cz wrote: Hi You still do not disclose important info about details of your functions. However, when you want to perform indexing like you show, you maybe can get rid of NULL and use zero instead. a-1:5 a[-c(1,3)] [1] 2 4 5

Re: [R] Margins to fill matrix

2014-09-11 Thread Charles Determan Jr
Do you have an example of what you would like your output to look like? It is a little difficult to fully understand what you are looking for. You only have 18 values but are looking to fill at 10x8 matrix (i.e. 80 values). If you can clarify better we may be better able to help you. Charles

Re: [R] Margins to fill matrix

2014-09-11 Thread Stefan Petersson
I have : rs - c(3, 2, 3, 4) cs - c(4, 5, 3) And want: matrix [,1] [,2] [,3] [1,] 120 [2,] 101 [3,] 111 [4,] 121 The rowSums in the above matrix is equal to sum(rs) and colSums is equal to sum(cs). It's sort of a matrix expansion where the margins are known

Re: [R] Building R for better performance

2014-09-11 Thread Anspach, Jonathan P
I'm out of the office today, but will resend it tomorrow. Jonathan Anspach Intel Corp. Sent from my mobile phone. On Sep 11, 2014, at 3:49 AM, arnaud gaboury arnaud.gabo...@gmail.com wrote: I got the benchmark script, which I've attached, from Texas Advanced Computing Center. Here are my

Re: [R] Building R for better performance

2014-09-11 Thread Henrik Bengtsson
You'll find R-benchmark-25.R, which I assume is the same and the proper pointer to use, at http:// http://r.research.att.com/benchmarks/ r.research.att.com http://r.research.att.com/benchmarks//benchmarks/ http://r.research.att.com/benchmarks/ Henrik I'm out of the office today, but will resend

Re: [R] some question about vector[-NULL]

2014-09-11 Thread Duncan Murdoch
On 11/09/2014 3:29 AM, Philippe GROSJEAN wrote: On 11 Sep 2014, at 08:24, PIKAL Petr petr.pi...@precheza.cz wrote: Hi You still do not disclose important info about details of your functions. However, when you want to perform indexing like you show, you maybe can get rid of NULL and use

Re: [R] some question about vector[-NULL]

2014-09-11 Thread Philippe GROSJEAN
..°})) ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons University, Belgium ( ( ( ( ( .. On 11 Sep 2014,

[R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread raz
Hi, ​I got the following data frame: dat1 - read.table(text=a,b 1,A1 2,A1 3,A1 4,A1 5,A1 6,A2 7,A2 8,A2 9,A2 10,A2 11,B1 12,B1 13,B1 14,B1 15,B1,sep=,,header=T) ​ ​I would like to add a new column dat1$new based on column b (dat$b) in which values will be substituted according to their unique

Re: [R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread David L Carlson
Note that in the data you sent, b is a factor: str(dat1) 'data.frame': 15 obs. of 2 variables: $ a: int 1 2 3 4 5 6 7 8 9 10 ... $ b: Factor w/ 3 levels A1,A2,B1: 1 1 1 1 1 2 2 2 2 2 ... So all you need is dat1$new - as.numeric(dat1$b) table(dat1$new) table(dat1$new) 1 2 3 5 5 5

Re: [R] create new column by replacing multiple unique values in existing column

2014-09-11 Thread John McKown
On Thu, Sep 11, 2014 at 10:49 AM, raz barvazd...@gmail.com wrote: Hi, I got the following data frame: dat1 - read.table(text=a,b 1,A1 2,A1 3,A1 4,A1 5,A1 6,A2 7,A2 8,A2 9,A2 10,A2 11,B1 12,B1 13,B1 14,B1 15,B1,sep=,,header=T) I would like to add a new column dat1$new based

Re: [R] R, Big Data and books

2014-09-11 Thread Mohan Radhakrishnan
This too. Applied Predictive Modeling Max Kuhn • Kjell Johnson Thanks, Mohan On Tue, Sep 9, 2014 at 10:03 PM, Subba Rao raspb...@tanucoo.com wrote: Hi, I am interested in R programming in the Big Data space. Are there any books that would be a good starting point for this career path?

Re: [R] Question about searchTwitter{twitteR}

2014-09-11 Thread Cory N
You are only able to search twitter history for a short period of time. gnip.com and similar companies offer historical tweets for sale. cn On Sunday, September 7, 2014 9:21:34 AM UTC-5, Axel Urbiz wrote: Hello, The function searchTwitter() with the arguments supplied as below would

[R] incorrect number of dimensions

2014-09-11 Thread Marie-Eve St-Onge
Dear all, I'm trying the following experiment simulation, but I'm receiving this error: probs()Error in x[j, 4] : incorrect number of dimensions however, the simulation works fine outside the function statement{}. What am I doing wrong? # Create some fake data and call the function: df -

Re: [R] Building R for better performance

2014-09-11 Thread Anspach, Jonathan P
Yes, that's the original. Then TACC increased the matrix sizes for their tests. Jonathan Anspach Intel Corp. Sent from my mobile phone. On Sep 11, 2014, at 9:18 AM, Henrik Bengtsson h...@biostat.ucsf.edumailto:h...@biostat.ucsf.edu wrote: You'll find R-benchmark-25.R, which I assume is the

Re: [R] How to plot soil moisture data as a contour plot

2014-09-11 Thread Thiago V. dos Santos
David, Thanks a lot for your sugestion, it solved my problem! Greetings, -- Thiago V. dos Santos PhD student Land and Atmospheric Science University of Minnesota http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm Phone: (612) 323 9898 On Wednesday, September 10,

Re: [R] incorrect number of dimensions

2014-09-11 Thread David L Carlson
Look below to see what happens to your formatting when you use html. Don't use html. Why do you use x='df' in defining the function df is a data frame with 5 observations and 4 variables. 'df' is a character vector of length 1. Your function is looking for a data frame (or matrix) with at

Re: [R] Margins to fill matrix

2014-09-11 Thread David L Carlson
You want r2dtable(): ?r2dtable set.seed(42) a - r2dtable(1, seats, mandates) addmargins(a[[1]]) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,]23106212 17 [2,]8011 11021 24 [3,]80527114

[R] How to test for open pdf file on Windows before calling cairo_pdf ?

2014-09-11 Thread Kevin Wright
On Windows: The pdf(file1.pdf) command will throw an error if the file1.pdf is open in a viewer. For example: pdf(file1.pdf) plot(1:10) dev.off() shell.exec(file1.pdf) pdf(file1.pdf) # Causes an error As suggested by the help page for file.access(), I normally use try(pdf(file1.pdf)) to test

Re: [R] Margins to fill matrix

2014-09-11 Thread David Winsemius
On Sep 11, 2014, at 5:13 AM, Stefan Petersson wrote: I have : rs - c(3, 2, 3, 4) cs - c(4, 5, 3) And want: matrix [,1] [,2] [,3] [1,] 120 [2,] 101 [3,] 111 [4,] 121 The rowSums in the above matrix is equal to sum(rs) and colSums is equal to

[R] weird install package error

2014-09-11 Thread Yuan Luo
Hi, I am getting an error installing the MASS package. Googling suggests restarting R, but it didn't help. Anyone has a clue? Many thanks, Yuan install.packages(MASS) Installing package into ‘/PHShome/yl960/R/3.0’ (as ‘lib’ is unspecified) trying URL

Re: [R] Margins to fill matrix

2014-09-11 Thread Stefan Petersson
Yes! That's excactly what I need. Thank You so much! Den 11 sep 2014 21:20 skrev David L Carlson dcarl...@tamu.edu: You want r2dtable(): ?r2dtable set.seed(42) a - r2dtable(1, seats, mandates) addmargins(a[[1]]) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,]231

Re: [R] How to test for open pdf file on Windows before calling cairo_pdf ?

2014-09-11 Thread Henrik Bengtsson
A poor mans solution would be to try to temporarily delete or move the file, depending exactly what you wish to do. You can also try: library(R.utils) pathname - Arguments$getWritablePathname(file2.pdf, mustNotExist=FALSE) which does lots of assertions of write permissions of new and existing

[R] mice - undefined columns selected

2014-09-11 Thread Jeremy Miles
I've got a problem with the mice package that I don't understand. Here's the code: library(mice) d - read.csv(https://dl.dropboxusercontent.com/u/24381951/employment.csv;, as.is=TRUE, row.names=1)d.imp - mice(data=d, m=1) Result is: Error in `[.data.frame`(data, , jj) : undefined columns

[R] using pdf(file=) encount a Chinese garbled

2014-09-11 Thread PO SU
Dear expeRts,     When i use the following codes:     pdf(file=1.pdf,width=15)     plot(1:3,main=你好)     dev.off() #There were 12 warnings (use warnings() to see them)   I find that 你好 can't show correctly in pdf file, but  i just   plot(1:3,main=你好) to R plot viewer, it's ok .   Is there anyone

Re: [R] using pdf(file=) encount a Chinese garbled

2014-09-11 Thread Jinsong Zhao
On 2014/9/11 21:10, PO SU wrote: Dear expeRts, When i use the following codes: pdf(file=1.pdf,width=15) plot(1:3,main=你好) dev.off() #There were 12 warnings (use warnings() to see them) I find that 你好 can't show correctly in pdf file, but i just plot(1:3,main=你好) to R

RE: [R-es] separar un archivo por a�os en diferentes archivos

2014-09-11 Thread Isidro Hidalgo
¿En qué formato está: texto plano, separado por tabulaciones, de anchura fija, EXCEL? ¿No puedes leerlo entero, filtrar por año y grabar cada parte? Un saludo Isidro Hidalgo Arellano Observatorio Regional de Empleo Consejería de Empleo y Economía http://www.jccm.es -Mensaje original-

Re: [R-es] separar un archivo por años en diferentes archivos

2014-09-11 Thread Jorge Ayuso Rejas
Otra manera sería usar la función split. Que devuelve una lista de data.frame. Para expotar luego cada elemento puedes usar lapply, ejemplo: data(iris) lista-split(iris,iris$Species) lapply(names(lista),function(x) write.table(x = lista[[x]],file = paste0(x,.txt)) ) Saludos El 11 de septiembre

[R-es] Fwd: SpatialPolygonsDataFrame

2014-09-11 Thread Laura Isabel Luna
Estimados, estoy creando un SpatialPolygonsDataFrame para crear el polygons, debo crear de a uno los polygon, tengo 26 poligonos y quiero saber si puedo escribir esto de una sola vez sin hacerlo uno para cada uno, Ejemplo: Sr1= Polygon(Calamuchita[,1:2]) Sr2= Polygon(Capital[,1:2])

Re: [R-es] separar un archivo por años en diferentes archivos

2014-09-11 Thread daniel
Si bien prefiero algo como lo propuesto por Jorge, siguiendo tu planteo creo que lo siguiente tiene que funcionar: filename-test1.csv DBa-read.table(filename,sep=;,header=TRUE) # en el archivo que enviastes el separador es ; no , anios-unique(DBa$Year) for(i in anios) {

Re: [R-es] separar un archivo por años en diferentes archivos

2014-09-11 Thread palazon
Hola: En casos como estos no hay que olvidar que el sistema operativo un+x, olvidé casi todo los que sabía del /command/ de microsoft, nos ofrece procedimienetos muy simples para realizar tareas rutinarias. En este caso creo que lo más rápido es, dede una terminal, en el directorio de datos:

Re: [R-es] separar un archivo por años en diferentes archivos

2014-09-11 Thread Carlos Ortega
Hola Marta, Si el código exacto que utilizaste es el que has compartido, hay un error... Te falta cerrar un corchete. Y he incluido un detalle para que los ficheros tengan como nombre los años... ​#--​ ​​filename-test1.csv DBa-read.csv(filename,sep=*;* ,header=TRUE)

Re: [R-es] Manejo de imágenes con R

2014-09-11 Thread Víctor Aramayo
Muchas gracias a todos por su orientación. Me queda claro algunos puntos adicionales que debo explorar para mejorar mis rutinas. Saludos, buen día. V El 10 de septiembre de 2014, 18:00, Juan Diego Alcaraz-Hernández jdalca...@gmail.com escribió: Hola Victor La pregunta es muy amplia, echale