Re: [R] Formula in a model

2013-09-11 Thread Paulito Palmes
Hi, I have a data.frame with dimension 336x336 called *training*, and another one called *observation* which is 336x1. I combined them as one table using table=data.frame(training, observation). table now has 336x337 dimension with the last column as the observation to learn using the training

[R] to retrieve specific data from a matrix

2013-09-11 Thread Elaine Kuo
Dear list, I want to retrieve a specific data from a matrix with 3000 columns. The matrix has island ID as its rows and species ID as its columns. There are 20 rows and 3000 columns in the matrix. (Island ID: Species 1- Species 20/ species ID: Species 1- Species 3000) The contents of the matrix

Re: [R] to retrieve specific data from a matrix

2013-09-11 Thread Berend Hasselman
On 11-09-2013, at 09:38, Elaine Kuo elaine.kuo...@gmail.com wrote: Dear list, I want to retrieve a specific data from a matrix with 3000 columns. The matrix has island ID as its rows and species ID as its columns. There are 20 rows and 3000 columns in the matrix. (Island ID: Species 1-

Re: [R] Problems to show X-labels when plotting small values

2013-09-11 Thread Charles Novaes de Santana
Dear Jim, Thank you very much for your suggestion! It worked perfectly! Thanks for clarifying how things work. Best regards, Charles On Wed, Sep 11, 2013 at 3:49 AM, Jim Lemon j...@bitwrit.com.au wrote: On 09/11/2013 09:06 AM, Charles Novaes de Santana wrote: Dear all, I am following

Re: [R] Formula in a model

2013-09-11 Thread Gerrit Eichner
Hello, Paulito, first, I think you haven't received an answer yet because you did not provide commented, minimal, self-contained, reproducible code as the posting guide does request it from you. Second, see inline below. On Wed, 11 Sep 2013, Paulito Palmes wrote: Hi, I have a data.frame

Re: [R] assigning the class of an object

2013-09-11 Thread peter dalgaard
On Sep 10, 2013, at 23:49 , Rolf Turner wrote: Hmmm. I did: x - 42 save(x,file=Robject.RData) rm(list=ls()) obj_name - load(Robject.RData) class(get(obj_name)) - myClass x and got: [1] 42 attr(,class) [1] myClass (also got the familiar error message). When I did it your

Re: [R] Fitting Arima Model to Daily Time Series

2013-09-11 Thread Jose Iparraguirre
Hi Paul, There are different packages in R to fit an ARIMA model. I would use the forecast package. In your case, perhaps you would want to explore SARIMA models to include seasonal components? Anyhow, the first port of call could be the auto.arima() function to select the best fitting

Re: [R] RStudio Server init script

2013-09-11 Thread peter dalgaard
On Sep 11, 2013, at 07:53 , Bembi Prima wrote: I have seen ?Startup and already update .RProfile in home folder, but as I already said it just affected user's Rprofile, not the global one. So you didn't read the parts about Rprofile.site? -- Peter Dalgaard, Professor Center for Statistics,

Re: [R] include variable of a dataframe in other dataframe

2013-09-11 Thread ernesto villarino
Hello Ian. I explained wrong myself. summary (data.all.evp) Year Month LongLat z Min. :1959 Jan:124200 Min. :-74.0 Min. :36.0 Min. :-5615.00 1st Qu.:1970 Feb:124200 1st Qu.:-52.0 1st Qu.:43.0 1st Qu.:-3451.25

Re: [R] ggplot interactions

2013-09-11 Thread Robert Lynch
On Tue, Sep 10, 2013 at 11:33 PM, Robert Lynch robert.b.ly...@gmail.comwrote: I am sorry to ask what I am sure is a simple question but I am stuck trying to figure out how different parts of ggplot2 calls interact I am plotting using the following code ggplot(Chem.comp, aes(Course, GRADE))

[R] resample from data frame: unlinked columns

2013-09-11 Thread Rosario Garcia Gil
Hello I am trying to resample from this data set (see below). The function I am using so far is doing it by considering A and B columns as linked. I used this function. NUCh_rep-replicate(500,data[sample(1:nrow(data),replace=T),],simplify=F) What I need is to resample (500 times) with

[R] Imputation for space-time satellite data

2013-09-11 Thread Eddie Smith
Dear list, I am trying to do a space-time imputation for time series satellite imageries. Any recommendation for a good package to use. I am new to R. Thank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] resample from data frame: unlinked columns

2013-09-11 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rosario Garcia Gil Sent: Wednesday, September 11, 2013 12:21 PM To: r-help@r-project.org Subject: [R] resample from data frame: unlinked columns Hello I am trying to

Re: [R] to retrieve specific data from a matrix

2013-09-11 Thread arun
Hi, set.seed(24) mat1- matrix(sample(0:1,20*100,replace=TRUE),ncol=100,dimnames=list(paste0(Species,1:20),paste0(Species,1:100)))  which(mat1[1,]==1) #or which(!is.na(match(mat1[1,],1))) A.K. - Original Message - From: Elaine Kuo elaine.kuo...@gmail.com To: r-help@r-project.org

[R] superpose violin and boxplot in ggplot

2013-09-11 Thread PIKAL Petr
Dear all I am struggling a bit with tricky violinplot. I found how to superpose boxplots correctly to violinplots. p-ggplot(Cars93, aes(x=Origin, y=Price, fill=Type, colour=Type)) p+geom_violin()+ geom_boxplot(aes(fill=NULL), position=position_dodge(width=.9), width=.3) but if I wanted to

[R] how to read data from MSExcel into R

2013-09-11 Thread Charles Thuo
how can one read data from MSEXcel into R especially in a case where one does not have administrator rights to install additional packages. In short how to read data from MSExcel into R with base packages only. [[alternative HTML version deleted]]

Re: [R] resample from data frame: unlinked columns

2013-09-11 Thread arun
Hi, Using ur code: dat1- read.table(text=A  B 5  257  259 10    257  259 10.1  257  259 4  257  259 9  257  259 2  257  259 8  257  259 1  257  259 8.1    257  259 8.2    257  259 7 

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Charles Determan Jr
If there isn't multiple sheets you can use the 'gdata' package and read.xls(). Otherwise you could re-save the file as a csv file and load that file with read.csv() assuming not multiple sheets again which a csv cannot contain. Regards, Charles On Wed, Sep 11, 2013 at 8:01 AM, Charles Thuo

[R] R Online Workshops October 7-11

2013-09-11 Thread Muenchen, Robert A (Bob)
Learn R and/or data mangement at home October 7 through 11 http://r4stats.com/2013/09/11/learn-r-andor-data-management-from-home-october-7-11/ == Bob Muenchen (pronounced Min'-chen) Accredited Professional Statistician(tm) Manager,

Re: [R] how to convert a list into a data frame.

2013-09-11 Thread PIKAL Petr
How did you read it? Normally data from Excel are in data.frame Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Charles Thuo Sent: Wednesday, September 11, 2013 3:22 PM To: r-help@r-project.org Subject: [R] how to

Re: [R] superpose violin and boxplot in ggplot

2013-09-11 Thread Ben Bolker
PIKAL Petr petr.pikal at precheza.cz writes: Dear all I am struggling a bit with tricky violinplot. I found how to superpose boxplots correctly to violinplots. p-ggplot(Cars93, aes(x=Origin, y=Price, fill=Type, colour=Type)) [snip] How I could change colour of boxplots to single

Re: [R] how to convert a list into a data frame.

2013-09-11 Thread Jeff Newmiller
But a data.frame is a special type of list, so you could both be right. The best way to communicate clearly about these questions is to provide reproducible example R code. --- Jeff NewmillerThe

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Jeff Newmiller
The assertion that you need administrator privileges to install packages is false. You can install them into a directory under your Documents directory for your own use. You only need a administrator privileges to modify the packages located in the software installation directory.

Re: [R] Shiny error: connection reset by peer

2013-09-11 Thread Dimitri Liakhovitski
Thank you so much, it worked with Chrome! On Wed, Sep 11, 2013 at 10:15 AM, Rmh r...@temple.edu wrote: shiny uses browser features that internet explorer doesn't have. use either firefox or chrome. enter http://localhost:8100 to quit shiny, enter the escspe key in the R gui Sent from

Re: [R] Formula in a model

2013-09-11 Thread Paulito Palmes
Hello Gerrit, Thanks for the explanation. Let me give a specific example. Assume Temp (column 4) is the output and the rest of the columns are input is the training features. Note that I only use the air quality data for illustration purpose. T input-output mapping may not make sense in the

[R] (no subject)

2013-09-11 Thread eliza botto
Now?dput(gg) list(structure(list(coefficients = structure(c(1, 0.0747202722085956, 0.359646782818708, 0.298384925903065, -0.443967849195675), .Names = c(x0, x, xx, y, yy)), residuals = structure(c(-0.302776084510551, 0.183247980798144, -0.337231904223223, 0.199348794823859, 0.290269994519382,

Re: [R] list to matrix

2013-09-11 Thread PIKAL Petr
Hi Do not post HTML. Why you did not populate your list directly with coefficients by let say coef(lm.result)? Anyway, you can reveal structure of individulal list component by str(your.object[[1]]). After that you can extract coefficient component and use sapply/lapply probably with rbind.

Re: [R] Running Loops

2013-09-11 Thread arun
Hi, Try: set.seed(24) yall- as.data.frame(matrix(sample(1:1e5,5000*10,replace=FALSE),ncol=10))  set.seed(49)   lst1-replicate(100,yall[sample(1:nrow(yall),100,replace=FALSE),],simplify=FALSE)  names(lst1)- paste0(yall,1:100) lapply(seq_along(lst1),function(i)

Re: [R] int vector

2013-09-11 Thread Duncan Murdoch
On 11/09/2013 11:21 AM, Giles Crane wrote: class int seems to interact oddly with fix() and dotchart(). Reading a .csv file when there are no decimal points in an item, results in a data.frame having a column of class int. The mode, however, is numeric. fix() does not recognize int vectors,

Re: [R] Shiny error: connection reset by peer

2013-09-11 Thread Rmh
shiny uses browser features that internet explorer doesn't have. use either firefox or chrome. enter http://localhost:8100 to quit shiny, enter the escspe key in the R gui Sent from my iPhone On Sep 11, 2013, at 9:59, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I am

Re: [R] rgl snapshot on headless server

2013-09-11 Thread Duncan Murdoch
On 11/09/2013 11:44 AM, Andreas Maunz wrote: I am running Xvfb now with -fbdir /some/path and -extension RANDR but rgl.snapshot is still not working. Any other idea? Since I can display the webGL successfully in firefox (so comes out correct), I assume there should be some way of converting

Re: [R] windowing

2013-09-11 Thread arun
Hi, Try: library(plyr)  ddply(df,.(x1),summarize,x=cumsum(x2)) #   x1  x #1   1  1 #2   1  3 #3   1  6 #4   1 10 #5   1 15 #6   1 21 #7   1 28 #8   1 36 #9   1 45 #10  1 55 #11  2 11 #12  2 23 #13  2 36 #14  2 50 #15  2 65 #16  2 81 #17  2 98 #or using a1  df2-

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Torvon
José, I get the following error message: m1-clm(sym_bin ~ phq_index, data=data2) m2-clm(sym_bin ~ 1, data=data2) anova(m1,m2,test=Chisq) Error in anova.clm(m1, m2, test = Chisq) : only 'clm' and 'clmm' objects are allowed My dependent variable is binary, so I don't know what the problem

Re: [R] Matrix mulitplication

2013-09-11 Thread arun
Hi, Try: set.seed(445) A- matrix(sample(1:20,124*5,replace=TRUE),ncol=5) set.seed(42) B- matrix(sample(1:25,12*5,replace=TRUE),ncol=5)  res- sapply(seq_len(nrow(A)),function(i) colSums(A[i,]*t(B)))  dim(res) #[1]  12 124 A.K. From: eliza botto

Re: [R] ggplot interactions

2013-09-11 Thread Ista Zahn
Hi Robert, It is really hard to follow this without the data or a reproducible example. Also your attachments did not come through. Please read the posting guide and re-formulate your question to make it easier to help you. Finally, note that there is a separate ggplot2 mailing list at

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Jose Iparraguirre
Hi Eiko, How about this? anova (m1, m2, test=Chisq) See: ?anova.glm Regards, José Prof. José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Torvon Sent: 11 September 2013 16:48 To:

[R] Running Loops

2013-09-11 Thread jfrei006
I have a data set called yall with 5000 rows, I want to randomly sub sample 100 rows 100 times. This is what I have so far: yall-read.csv(Z:\\SOFTEL\\North Key Largo project\\Canopy_Height\\random_age_strat\\Young\\Abv2ft_young.csv) *yall1 - yall[sample(1:nrow(yall), 100, replace=FALSE),]

[R] About qmap package

2013-09-11 Thread Jaya Pudashine
Dear all, I am trying to use qmap package for bias correction in R. If anybody had used that before or using it currently, I would like to discuss about a few matters. I would be thankful for your help Thanking in advance -- Jaya [[alternative HTML version deleted]]

Re: [R] include variable of a dataframe in other dataframe

2013-09-11 Thread ernesto villarino
It works !!! you are super !!! thank you !! :) On Wed, Sep 11, 2013 at 10:22 AM, Ernesto Villarino villarino.erne...@gmail.com wrote: Hello Ian. I explained wrong myself. summary (data.all.evp) Year Month LongLat z Min. :1959 Jan

[R] meta-analysis of annualized event rate

2013-09-11 Thread petretta
r-help@r-project.org Dear all, I use R 2.15.2 for Windows 8 I ask if it is possible perform a meta-analysis of annualized event rate from several studies reporting 1) number of patients enrolled (N) 2) mean lenght of follow-up time (mo) 3) annualized event rate (AER) (expressed as %

[R] merge multi part polygons

2013-09-11 Thread Maria Fernanda Bonetti
I need to extract climatic variables of many shapefiles. I managed to do it, but doing one at a time (I have to do this for 3000 species). Well, I did the following: first I downloaded the rasters of BIOCLIM bios -getData (Worldclim var = bio, res = 2.5, T = download) Ok, then I went with shapes

[R] How to split a plot into vertical subregions with width proportional to length of a character string?

2013-09-11 Thread isabella
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }Hello, I am trying to create a plot whose x-axis is wide enough to accommodate the following: a) a character string on the left side (i.e., Text 1); b) a known range of values in the middle (i.e.,

Re: [R] ggplot interactions

2013-09-11 Thread Robert Lynch
I am sorry to ask what I am sure is a simple question but I am stuck trying to figure out how different parts of ggplot2 calls interact I am plotting using the following code ggplot(Chem.comp, aes(Course, GRADE)) + geom_boxplot(notch = TRUE,aes(fill = COHORT))+ labs(y =Grade Points in

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Ista Zahn
I don't think you need admin rights to install R packages. Did you try it? Best, Ista On Wed, Sep 11, 2013 at 9:01 AM, Charles Thuo tcmui...@gmail.com wrote: how can one read data from MSEXcel into R especially in a case where one does not have administrator rights to install additional

[R] R/S-PLUS Course schedule in US - XLSolutions Corp

2013-09-11 Thread Sue Turner
XLSolutions is working our October-November-December course schedule and now seeking your input for your prefered location and courses. September 2013 R/S-PLUS courses are available online http://www.xlsolutions-corp.com/courselistlisting.aspx (1) R-PLUS: A Point-and-Click Approach to R (2)

[R] Chi-square values in GLM model comparison

2013-09-11 Thread Torvon
Hello -- I am comparing two GLMs (binomial dependent variable) , the results are the following: m1-glm(symptoms ~ phq_index, data=data2) m2-glm(symptoms ~ 1, data=data2) Trying to compare these models using anova (m1, m2) I do not obtain chi-square values or a chi-square difference test;

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Marc Schwartz
Torvon, There is some confusion in your postings, as in your first posting the models were GLM's but with the default gaussian family (not binomial) since the 'family' argument was not present in the glm() call and in the second post you have references to clm() which is for ordinal response

Re: [R] (no subject)

2013-09-11 Thread PIKAL Petr
Hi By HTML posting dput is scrambled and impossible to use. Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of eliza botto Sent: Wednesday, September 11, 2013 4:44 PM To: r-help@r-project.org Subject: [R] (no subject)

Re: [R] Chi-square values in GLM model comparison

2013-09-11 Thread Rune Haubo
There is no argument 'test' to anova.clm hence the error message. The likelihood ratio statistic (or, alternatively, G^2 statistic or Deviance statistic) has an asymptotic chi-square distribution, so it is the size of that statistic your reviewers are asking for. It is printed in the anova output

Re: [R] int vector

2013-09-11 Thread PIKAL Petr
Hi data, data, data. Use dput(head(data,10)) if the data frame is too big. zdrz - structure(list(sklon = c(10, 10, 10, 10, 20, 20, 20, 20, 20, 40, 40, 40, 40, 95, 95), ot = c(0.8, 1.5, 4, 10, 15, 1.5, 4, 10, 15, 1.5, 4, 10, 15, 4, 15), doba = c(140, 111, 42.8, 20.3, 15, 88, 38.25,

Re: [R] Fitting Arima Model to Daily Time Series

2013-09-11 Thread Jose Iparraguirre
Paul Good you ask because as far as I can remember (some people in the forum are experts on both time series and how R handles time series), it's not advisable to use the ts() function in the base package when dealing with daily observations (because of leap years, mostly). Therefore, you need

Re: [R] list to matrix

2013-09-11 Thread arun
Hi, Try: set.seed(48) lst1-replicate(3,data.frame(y=rnorm(50),z=runif(50),x=sample(10:15,50,replace=TRUE)),simplify=FALSE)  t(sapply(lst1,function(u) coef(lm(y~0+x+z,data=u  #change accordingly #   x  z #[1,] -0.01020553  0.3852990 #[2,] -0.01157726  0.3986898 #[3,] 

Re: [R] rgl snapshot on headless server

2013-09-11 Thread Andreas Maunz
I am running Xvfb now with -fbdir /some/path and -extension RANDR but rgl.snapshot is still not working. Any other idea? Since I can display the webGL successfully in firefox (so comes out correct), I assume there should be some way of converting it on the server side to some (vector) graphic

Re: [R] merge multi part polygons

2013-09-11 Thread Bert Gunter
I would suggest you post this on the r-sig-ecology or r-sig-geo lists. These seem both more relevant (r-help is for general R programming questions, mostly) and more likely to have participants with suitable expertise. Cheers, Bert On Wed, Sep 11, 2013 at 12:32 PM, Maria Fernanda Bonetti

Re: [R] Subtracting elements of a vector from each other stepwise

2013-09-11 Thread Ben Harrison
If I were Michael (OP) right now, I think my head would be spinning. As a newbie myself, I know how hard it is to read R code for the first time, so could it also be part of the newsgroup etiquette to at least partially explain provided code to newbies? I agree that the interactive help '?'

Re: [R] Need to learn or get R tutor in Minneapolis

2013-09-11 Thread Ben Harrison
On 10/09/13 06:45, sewal...@umn.edu wrote: Please advise Can't help you in Minneapolis, though surely your university has a statistics department? To learn R there are many online tutorials and video guides. The latest is a large collection from the Google developers:

Re: [R] How to split a plot into vertical subregions with width proportional to length of a character string?

2013-09-11 Thread Jim Lemon
On 09/12/2013 03:51 AM, isabe...@ghement.ca wrote: BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }Hello, I am trying to create a plot whose x-axis is wide enough to accommodate the following: a) a character string on the left side (i.e., Text 1);

[R] Bar plot help

2013-09-11 Thread Moshiur Rahman
Hi R-helpers, Can anyone help me giving instructions/package sources to make a simple bar plot with mean and standard error of variables [Orange colour (which has four PCs) and Irid colour (which has two PCs)] that I'd like to plot in x-axis and the values in y-axis? The diet should be as legend

Re: [R] Subtracting elements of a vector from each other stepwise

2013-09-11 Thread Jeff Newmiller
It is worth asking for clarification sometimes, but I have to admit that I don't have much sympathy in this case because there isn't much code involved and typing in the code (or copy/pasting it line-by-line) and experimenting with it is crucial to the process of learning R. Picking out one

[R] how to allocate more memory?

2013-09-11 Thread Ramona Lall
Hello all, I am running mixed model on a large dataset and I get the following warning messages: Reached total allocation of 1535Mb: see help(memory.size) and Calloc could not allocate memory (705648 of 8 bytes) How do I get around this? Thanks! [[alternative HTML version deleted]]

Re: [R] Combining information from two matrices

2013-09-11 Thread arun
Hi, May be this helps: mat1- matrix(c(1,1,0,0,0,1,0,1,0),ncol=3,dimnames=list(paste(Plant,1:3), paste(Pollinator,1:3)),byrow=TRUE)  mat2- matrix(c(1,1,0,1,0,1,0,1,0),ncol=3,dimnames=list(paste(Plant,c(1,4,5)), paste(Pollinator,c(1,2,4))),byrow=TRUE) dat1- as.data.frame(mat1)  dat2-

Re: [R] sparse PCA using nsprcomp package

2013-09-11 Thread array chip
Hi Christian, Thank you so much for sharing your thoughts, I was a real pleasure to read and learn! Approximately when do you expect the new release of the package? Best, John From: Christian Sigg r-h...@sigg-iten.ch Cc: r-help@r-project.org