Re: [R] Log analysis with R

2013-01-04 Thread Ramprakash Ramamoorthy
I thought mailing lists are very professional and filled with boring people. But hey, R mailing list is pure fun and has lots of humour elements ;) So yeah, making it clear, logs as in the text dump spit out by your software applications, servers and network elements. Let me add to my query. This

Re: [R] help "reshaping" dataframe

2013-01-04 Thread Jim Lemon
On 01/05/2013 10:15 AM, Andrea Goijman wrote: ... Hi Andrea, This may be what you want: occ.data<-data.frame(year=rep(2003,20),Ruta=rep(202,20), + Point=c(3,4,1,1,2,3,4,1,4,5,1,3,4,5,1,4,5,10,7,8), + Site=c(rep(2021,17),rep(2022,3)), + specie=c("MICH","MICH","MISA","MOBO","MOBO","MOBO","MOBO",

Re: [R] Iterative loop using "repeat"

2013-01-04 Thread Jim Lemon
On 01/04/2013 10:13 PM, mary wrote: Hi, I'm Marianna I'm trying to apply the command "repeat" to my matrix but the repeat process doesn't work as I would. In particular I would like to apply the function robustm () _that I have created_ to my two matrices, if the difference between the two matr

Re: [R] MT940 and MT942

2013-01-04 Thread Ben Bolker
Suzen, Mehmet gmail.com> writes: > > Hello List, > > Are there any R package that can process MT940/942? > > Thanks > > mem I find it hard to say because I have no idea what those formats are (although googling suggests they're banking codes). library("sos") and using findFn() on "MT940

Re: [R] Working with Matrix

2013-01-04 Thread David Winsemius
On Jan 4, 2013, at 10:46 AM, Christofer Bogaso wrote: > Thanks all for your help. However I was looking for following type of > operation: > > Mat1 <- Mat2 <- matrix(1:20, 4, 5); Mat2[1,5] <- 200 > Mat = rbind(Mat1, Mat2) > apply(Mat, 2, function(x) return(all(x[1:4] == x[5:8]))) > > However I

Re: [R] How to plot multiple time series with different time base in same plot?

2013-01-04 Thread Gabor Grothendieck
On Fri, Jan 4, 2013 at 5:53 PM, Matthijs Daelman wrote: > Hi > > I have to time series with a different time base. > > The first has only sporadic datapoints: > 2011-02-01 15.29130 > 2011-02-08 17.60278 > 2011-02-15 17.99737 > 2011-02-22 25.43690 > > The other has a daily datapoint: > 2011-02-01 3

Re: [R] How to plot multiple time series with different time base in same plot?

2013-01-04 Thread Mario Bourgoin
Hi Matthijs, Look at the code in the attached file and try it out. Best, Mario On Fri, Jan 4, 2013 at 5:53 PM, Matthijs Daelman wrote: > Hi > > I have to time series with a different time base. > > The first has only sporadic datapoints: > 2011-02-01 15.29130 > 2011-02-08 17.60278 > 2011-02-15

[R] How to plot multiple time series with different time base in same plot?

2013-01-04 Thread Matthijs Daelman
Hi I have to time series with a different time base. The first has only sporadic datapoints: 2011-02-01 15.29130 2011-02-08 17.60278 2011-02-15 17.99737 2011-02-22 25.43690 The other has a daily datapoint: 2011-02-01 342.34 2011-02-02 68.45 2011-02-03 130.47 2011-02-04 129.86 2011-02-05 81.98 20

[R] help "reshaping" dataframe

2013-01-04 Thread Andrea Goijman
List, I want to reshape my data, but I'm not sure how to do it... it might be a simple task, but don't know which package does this. "occ.data" (see below) is how my original data are arranged, and I know that with melt() I can reshape it like "y" (see below). However, I just want to build a matri

Re: [R] Iterative loop using "repeat"

2013-01-04 Thread Mario Bourgoin
Hi Mary, Some things are clear from your code fragment: - S_X is a variable external to your function, and is possibly a variable accessible to robustm. - Unless calling robustm changes S_X or abs(b1[i,i]-b)[i,i])<=0.001 is always true for all S_X and all i, your repeat statement, and so your func

Re: [R] non-consing count

2013-01-04 Thread David Winsemius
On Jan 4, 2013, at 7:30 AM, Sam Steingold wrote: Hi, to count vector elements with some property, the standard idiom seems to be length(which): --8<---cut here---start->8--- x <- c(1,1,0,0,0) count.0 <- length(which(x == 0)

Re: [R] New Version of R?

2013-01-04 Thread Ben Bolker
Erin Hodgess gmail.com> writes: > > Dear R People: > > I'm not sure if I should be asking here or R-devel, but here goes: > > Will there be a new version of R coming out in the next few weeks, please? > > I'm setting up for the spring semester and want the students to have > the latest versio

Re: [R] New Version of R?

2013-01-04 Thread John Sorkin
Erin, We recently received an email message saying version 3.0 was coming soon. As I remember it, there will be a number of important improvements, but no major changes in functionality. Version 2.xx will probably be fine for your class. John John David Sorkin M.D., Ph.D. Chief, Biostatistics

Re: [R] Using bquote to create names a for a list

2013-01-04 Thread Bert Gunter
On Fri, Jan 4, 2013 at 12:45 PM, Saptarshi Guha wrote: > Hello, > > How would i use bquote to create names for a list. > You don't. -- Bert (If you wish to ask how to change names in a list, or some other such thing, then ask that.) > e.g. to create list(a=10) > > bquote(list(.(X)=10), list(

[R] New Version of R?

2013-01-04 Thread Erin Hodgess
Dear R People: I'm not sure if I should be asking here or R-devel, but here goes: Will there be a new version of R coming out in the next few weeks, please? I'm setting up for the spring semester and want the students to have the latest version. Thanks very much, Sincerely, Erin -- Erin Hod

[R] FW: Index out SNP position

2013-01-04 Thread David L Carlson
I think you mean between column 1 and 2 of A? Why is 36003918 not included? It is clearly between 35838396 and 36151202 in the first row of A. My earlier solution should work fine. Just create a new matrix AX that has the columns switched so that the start is always column 1 and use that to identi

[R] Using bquote to create names a for a list

2013-01-04 Thread Saptarshi Guha
Hello, How would i use bquote to create names for a list. e.g. to create list(a=10) bquote(list(.(X)=10), list(X="a")) does not work. The best i could come up with is bquote({ a=list(10);names(a)=.(X); a}, list(X="a")) which is quite ugly. Is there an elegant way to solve this? Regards Sa

Re: [R] Log analysis with R

2013-01-04 Thread jim holtman
those were definitely different 'logs' than I was thinking about. On Fri, Jan 4, 2013 at 1:50 PM, peter dalgaard wrote: > > On Jan 4, 2013, at 18:41 , jim holtman wrote: > >> what type of logs are you trying to process? > > Oregon pine? > >> what is their format? > > Cylindrical? > >> what inform

Re: [R] Log analysis with R

2013-01-04 Thread P Ehlers
In Canada we use sawmills to process logs. Or we carve them into totem poles. Or we carve dugout canoes. Of course, sometimes we burn them in order to keep warm. Peter Ehlers On 2013-01-04 10:50, peter dalgaard wrote: On Jan 4, 2013, at 18:41 , jim holtman wrote: what type of logs are you tr

Re: [R] Can you help me please

2013-01-04 Thread arun
HI, If you want to extract the month as in the format you mentioned in the original post: Month<-format(dat1[,1],format="%b")  head(Month) #[1] "Jan" "Jan" "Jan" "Jan" "Jan" "Jan" library(ISOweek)  Week<-date2ISOweek(dat1[,1]) Week1<-gsub(".*\\-(.*)\\-.*","\\1",Week)  head(Week1) #[1] "W01" "W01

Re: [R] plm random effect: the estimated variance of the individual effect is negative

2013-01-04 Thread matteo ognibene
Thanks Giovanni, but I already tried with the others "random.method" and it doesn't work anyway. Do you think is it possible change the if statement in the plm formula, to set the value to 0 if sigma<0 ? Because if I insert a dummy variabile in the formula R gives me this error: > Error in if (

Re: [R] Can you help me please

2013-01-04 Thread arun
HI Fares, Sorry, that I misunderstand your question. Probably, this works for you. date1<- seq.Date(as.Date("1jan2003",format="%d%b%Y"),as.Date("1jan2013",format="%d%b%Y"),by="day")    length(date1) #[1] 3654  set.seed(51)  donation<-sample(1000:300,3654,replace=FALSE)  dat1<-data.frame(date1

Re: [R] Log analysis with R

2013-01-04 Thread peter dalgaard
On Jan 4, 2013, at 18:41 , jim holtman wrote: > what type of logs are you trying to process? Oregon pine? > what is their format? Cylindrical? > what information do you want from them? Tensile strength? ;-) (Or: Base-10, 5-digit mantissa, geometric mean) > On Fri, Jan 4, 2013 at 6:33 A

Re: [R] Working with Matrix

2013-01-04 Thread Christofer Bogaso
Thanks all for your help. However I was looking for following type of operation: Mat1 <- Mat2 <- matrix(1:20, 4, 5); Mat2[1,5] <- 200 Mat = rbind(Mat1, Mat2) apply(Mat, 2, function(x) return(all(x[1:4] == x[5:8]))) However I believe there must be some smarter method using ***mapply()*** or someth

[R] Predicting New Data -

2013-01-04 Thread rydood
I am having trouble predicting new data with a model created from package mboost: > mb1<-glmboost(as.formula(formula1),data=data_train,control=boost_control(mstop=400,nu=.1)) > f.predict<-predict(mb1,newdata=data_train) Error in scale.default(X, center = cm, scale = FALSE) : length of 'center'

Re: [R] R2OpenBUGS question with differential equations

2013-01-04 Thread Andras Farkas
Thomas,   thanks for your reply. I will switch to desolve. Unfortunatelly, the differential equation can not be re-written to an analytical solution in this case (to the best of my knowledge) because it is a non-linear process, which may not have an exact analytical solution. Thank you   Andras

Re: [R] Can you help me please

2013-01-04 Thread arun
HI Fares, You could try this: dat1<- read.table(text=" date  donation 3jan2003   20235 4jan2003   25655 5jan2003   225860 6jan2003   289658 7jan2003   243889 8jan2003   244338 9jan2003   243889 ",sep="",header=TRUE,stringsAsFactors=FALSE) The post is not very specific as to what you need.

Re: [R] Log analysis with R

2013-01-04 Thread jim holtman
what type of logs are you trying to process? what is their format? what information do you want from them? On Fri, Jan 4, 2013 at 6:33 AM, Ramprakash Ramamoorthy wrote: > Hello all, > > Need some suggestions on interesting use cases with R in the > field of log processing. Any help wou

[R] SpatialPolygon with the max value gets no color assigned in spplot function when using "at" parameter

2013-01-04 Thread Jan Hornych
Hi, I would like to do coloring of map regions based on the region values "weight". The approach I am taking is first to break regions into equal intervals, classIntervals(spdf$weight,4)$brks #4 intervals in this case and coloring all regions within the interval with the same color col = brewer

Re: [R] count appearence of zero in a vector

2013-01-04 Thread Suzen, Mehmet
On 4 January 2013 17:47, Bert Gunter wrote: > Inline. > > On Fri, Jan 4, 2013 at 7:44 AM, Suzen, Mehmet wrote: >> >> I am always reserved about types and not sure how R auto casting works >> internally. >> In a large code using many different packages, I think being reserved >> about >> this woul

Re: [R] count appearence of zero in a vector

2013-01-04 Thread Bert Gunter
Inline. On Fri, Jan 4, 2013 at 7:44 AM, Suzen, Mehmet wrote: > I am always reserved about types and not sure how R auto casting works > internally. > In a large code using many different packages, I think being reserved about > this would not hurt. > > Also, are there anyway to force R to be "st

Re: [R] Integrating Java, C++ and R

2013-01-04 Thread Dirk Eddelbuettel
On 4 January 2013 at 16:57, Suzen, Mehmet wrote: | On 4 January 2013 11:36, Royden Fernandes wrote: | > Hi, | > | > I am able to integrate C++ and R through RInside library. However when I | | Questions regarding RInside should go to the rcpp-devel mailing list. | http://lists.r-forge.r-project.

Re: [R] non-consing count

2013-01-04 Thread Suzen, Mehmet
On 4 January 2013 16:53, jim holtman wrote: > Is performance a concern? How often are you going to do it and what > other parts of your script also take longer? Why are you concerned > about allocating/discarding two vectors? I think Sam's question was about additional memory introduced by whi

[R] group variables in classes

2013-01-04 Thread catalin roibu
Dear R users, I want to group the d values in classes. If I use this script I have a problem. classes <- function(x, n){ s <- seq(0, ceiling(max(x)), by = n) factor(n*findInterval(x, s), levels = s) } z<-sapply(tapply(t$d,t$plot,function(x) classes(t$d, 4)),table) z<-cbind(z) Thank you! Initia

Re: [R] Integrating Java, C++ and R

2013-01-04 Thread Suzen, Mehmet
On 4 January 2013 11:36, Royden Fernandes wrote: > Hi, > > I am able to integrate C++ and R through RInside library. However when I Questions regarding RInside should go to the rcpp-devel mailing list. http://lists.r-forge.r-project.org/mailman/listinfo/rcpp-devel ___

Re: [R] non-consing count

2013-01-04 Thread Jorge I Velez
Hi Ista, I was doing about something similar when I saw your post, so I took your code and did some timings: > system.time(replicate(100, count.0 <- length(which(x == 0 user system elapsed 5.590 0.173 5.834 > system.time(replicate(100, count.1 <- sum(x == 0))) user syste

Re: [R] non-consing count

2013-01-04 Thread jim holtman
What is the concern if it works? you can also do sum(x==0) Is performance a concern? How often are you going to do it and what other parts of your script also take longer? Why are you concerned about allocating/discarding two vectors? On Fri, Jan 4, 2013 at 10:30 AM, Sam Steingold wrote: > H

Re: [R] non-consing count

2013-01-04 Thread Ista Zahn
Hi Sam, Here is one alternative, which is at least faster: system.time(count.0 <- length(which(x == 0))) system.time(count.1 <- sum(x == 0)) all.equal(count.0, count.1) Best, Ista On Fri, Jan 4, 2013 at 10:30 AM, Sam Steingold wrote: > Hi, > to count vector elements with some property, the sta

Re: [R] non-consing count

2013-01-04 Thread Suzen, Mehmet
My 2 cents: AFAIK both which and length are from C compiled code: http://cran.r-project.org/doc/manuals/r-release/R-ints.html#g_t_002eInternal-vs-_002ePrimitive so they must be quite efficient ie .Primitive and .Internal. Probably combination of this with a pattern in C would be more memory effi

[R] (no subject)

2013-01-04 Thread Karine HEERAH
Hi, I am using the nls function and it stops because the number of iterations exceeded 50, but i used the nls.control argument to allow for 500 iterations. Do you have any idea why it's not working? fm1 <- nls(npe ~ SSgompertz(npo, Asym, b2, b3), data=f,control=nls.control(maxiter=500)) Error i

Re: [R] mboost vs gbm

2013-01-04 Thread rydood
The default shrinkage (learning rate) for mboost is much higher than for gbm. -- View this message in context: http://r.789695.n4.nabble.com/mboost-vs-gbm-tp4637518p4654637.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pro

Re: [R] count appearence of zero in a vector

2013-01-04 Thread arun
As long as there are no negative numbers, method2 and 3 works:  test[1]<- -1 length(which(test==0)) #[1] 6  length(which(test<1)) #[1] 7  length(which(test < .Machine$double.xmin)) #[1] 7 length(which(abs(test)<1)) #[1] 6  length(which(abs(test) < .Machine$double.xmin)) #[1] 6 A.K. - Orig

[R] t-1 value utilize to get t value in R

2013-01-04 Thread HyunGyo Kim
Hello. This is my dataset. id order(t) A Previous A 1 1 0 NA 1 2 1 0 1 3 1 1 1 4 0 1 1 5 0 0 2 1 1 NA 2 2 0 1 3 1 1 NA 3 2 1 1 3 3 0 1 3 4 0 0 Id is individual. (ex.1=Mike, 2=Sandy) Order(t) is order of individual's behavior. A is idividual's behavior(ex. buying is 1 otherwise 0) at

Re: [R] "By" function Frame Conversion (with Multiple Indices)

2013-01-04 Thread arun
Hi, You could try this: dat1<-read.table(text=" id,age,weight,height,gender 1,22,180,72,m 2,13,100,67,f 3,5,40,40,f 4,6,42,,f 5,12,98,66, 6,50,255,60,m ",sep=",",header=TRUE,stringsAsFactors=FALSE,na.strings="") list1<-by(dat1[c("weight","height")],dat1[c("age","gender")],colMeans,na.rm=TR

[R] Iterative loop using "repeat"

2013-01-04 Thread mary
Hi, I'm Marianna I'm trying to apply the command "repeat" to my matrix but the repeat process doesn't work as I would. In particular I would like to apply the function robustm () _that I have created_ to my two matrices, if the difference between the two matrices is less than 0.001, R give me ba

[R] Log analysis with R

2013-01-04 Thread Ramprakash Ramamoorthy
Hello all, Need some suggestions on interesting use cases with R in the field of log processing. Any help would be greatly appreciated. -- With Thanks and Regards, Ramprakash Ramamoorthy, India, +91 9626975420 [[alternative HTML version deleted]] _

[R] Integrating Java, C++ and R

2013-01-04 Thread Royden Fernandes
Hi, I am able to integrate C++ and R through RInside library. However when I use a jni call as my UI is through java it crashes at C++ side. My files are JNICallingClass.C: JNIEXPORT void JNICALL Java_CallR_run (JNIEnv* env, jobject callr){

Re: [R] a question about the computation of expression

2013-01-04 Thread meng
Thanks. At 2013-01-04 17:41:23,"Jorge I Velez" wrote: Dear meng, Check I understood correctly, the Ryacas package might do what you want. Check its vignette at http://cran.r-project.org/web/packages/Ryacas/vignettes/Ryacas.pdf Best, Jorge.- On Fri, Jan 4, 2013 at 5:59 PM, meng <>

Re: [R] a question about the computation of expression

2013-01-04 Thread meng
No,I have no x1 and x2 values. At 2013-01-04 17:32:24,"PIKAL Petr" wrote: >Hi > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of meng >> Sent: Friday, January 04, 2013 8:00 AM >> To: R help >> Subject: [R] a question

Re: [R] count appearence of zero in a vector

2013-01-04 Thread Suzen, Mehmet
I am always reserved about types and not sure how R auto casting works internally. In a large code using many different packages, I think being reserved about this would not hurt. Also, are there anyway to force R to be "strongly typed" similar to Occaml etc... mem On 4 January 2013 16:35, arun

Re: [R] Working with Matrix

2013-01-04 Thread Suzen, Mehmet
Hello Rui/Jorge, This is shorter, and probably needs less memory for large matrices as you create an other copy by defining nas: matrixOp <- function(m1, m2, op=`+`) { rows <- min(nrow(m1), nrow(m2)) cols <- ncol(m1) op(m1[1:rows, 1:cols], m2[1:rows, 1:cols]) } Best, mem On 4 January 2013 1

[R] non-consing count

2013-01-04 Thread Sam Steingold
Hi, to count vector elements with some property, the standard idiom seems to be length(which): --8<---cut here---start->8--- x <- c(1,1,0,0,0) count.0 <- length(which(x == 0)) --8<---cut here---end--->8--- however, this approac

Re: [R] plm random effect: the estimated variance of the individual effect is negative

2013-01-04 Thread Millo Giovanni
Matteo, I fully agree with David: please read the posting guide. Anyway, the error message says it all: "the estimated variance of the individual effect is negative". See e.g. the "basic panel" chapter (10 or 11) in Wooldridge's "Econometric Analysis of XS and Panel Data" to understand why this m

Re: [R] Index out SNP position

2013-01-04 Thread David L Carlson
So given B > cbind(B, apply(B, 1, diff)) [,1] [,2][,3] [1,] 35838396 36151202 312806 [2,] 35838674 35838584 -90 [3,] 36003908 35838674 -165234 [4,] 36004090 36003908-182 [5,] 36150188 36003992 -146196 Row 1 is start/end and rows 2 through 5 are end/start so you only want

Re: [R] Working with Matrix

2013-01-04 Thread Jorge I Velez
Muito obrigado, Rui. Cleaner and simpler than my approach. Regards, Jorge.- On Sat, Jan 5, 2013 at 12:08 AM, Rui Barradas <> wrote: > Hello, > > Using part of your code, it's possible to do without Reduce, have foo > (fun, below) do the job. > > fun <- function(x, y, FUN = `+`){ > if(nrow(x)

Re: [R] Working with Matrix

2013-01-04 Thread Rui Barradas
Hello, Using part of your code, it's possible to do without Reduce, have foo (fun, below) do the job. fun <- function(x, y, FUN = `+`){ if(nrow(x) < nrow(y)){ nas <- matrix(NA, ncol = ncol(x), nrow = nrow(y) - nrow(x)) x <- rbind(x, nas) }else{ nas <- matrix(NA,

Re: [R] Working with Matrix

2013-01-04 Thread Neal H. Walfield
At Fri, 4 Jan 2013 17:17:40 +0530, Christofer Bogaso wrote: > > Hello again, > > Let say I have 2 matrices which equal number of columns but different > number of rows like: > > Mat1 <- matrix(1:20, 4, 5) > Mat2 <- matrix(1:25, 5, 5) > > Now for each column 1-to-5 I need to fetch the correspond

Re: [R] plm random effect: the estimated variance of the individual effect is negative

2013-01-04 Thread matteo ognibene
You're right David, I'm really sorry. I deactivated html, hope now it works. > R 2.15.2 plm() function on Windows 7. I have a problem with the variance estimation in a random effect model I used this formula to get my result, and it works: > reg <- deltaF ~ L1.deltaF + L2.deltaF + deltaCDS + L

Re: [R] Working with Matrix

2013-01-04 Thread Jorge I Velez
Dear Christofer, You can try the following: # proccess the matrices foo <- function(m1, m2){ if(ncol(m1) != ncol(m2)) stop('number of columns should be equal') if(nrow(m1) < nrow(m2)){ nas <- matrix(NA, ncol = ncol(m1), nrow = nrow(m2) - nrow(m1)) m1 <- rbind(m1, nas) } else{ nas <- matrix(NA

[R] Working with Matrix

2013-01-04 Thread Christofer Bogaso
Hello again, Let say I have 2 matrices which equal number of columns but different number of rows like: Mat1 <- matrix(1:20, 4, 5) Mat2 <- matrix(1:25, 5, 5) Now for each column 1-to-5 I need to fetch the corresponding columns of these 2 matrices and add the corresponding elements (ignoring NA v

Re: [R] two lines in axis title combined with 'substitute' command

2013-01-04 Thread N.Hubner
Hi! Thanks a lot for your help! I now do have exactly the plot that I wanted! (I also realized that I have to use the 'text' command outside of the plot function; beginners mistake :-) Cheers, Nina __ Dr. Nina Hubner scientist quantitative proteomics

[R] Fwd:

2013-01-04 Thread Nick Duncan
http://marionniles.com/myxgcvc.php __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

Re: [R] a question about the computation of expression

2013-01-04 Thread Jorge I Velez
Dear meng, Check I understood correctly, the Ryacas package might do what you want. Check its vignette at http://cran.r-project.org/web/packages/Ryacas/vignettes/Ryacas.pdf Best, Jorge.- On Fri, Jan 4, 2013 at 5:59 PM, meng <> wrote: > Hi all: > I have a question about the computation of expr

Re: [R] a question about the computation of expression

2013-01-04 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of meng > Sent: Friday, January 04, 2013 8:00 AM > To: R help > Subject: [R] a question about the computation of expression > > Hi all: > I have a question about the computation

[R] a question about the computation of expression

2013-01-04 Thread meng
Hi all: I have a question about the computation of expression: y = 1+(2x1+2)-3*(5x1-1)+(3x2+3)-2*(x2-1) The result of y is: y = 11-13x1+x2 How can I compute the result of y via R function? Many thanks! My best. [[alternative HTML version deleted]] ___