Re: [R] Wrong computation of time differenze in POSIXct - additional digits

2012-06-15 Thread arun
Hi, I checked the same with strptime.  It is the rounding issue. Try this: dat1<-data.frame(datetime=c("2012-06-15 16:32:39.0025 CEST","2012-06-15 16:32:39.0086 CEST"))  op<-options(digits.secs=4)  dat1$datetime<- strptime(dat1$datetime, "%Y-%m-%d %H:%M:%OS") formatC(as.numeric(difftime(dat1[

[R] Flexmix package

2012-06-15 Thread kimk
Hi, I am using the package "flexmix" and would like get some assistance. I am trying to run two equations jointly Y1=X1B+E1 Y2=X2G+E2 So that I have X and Y in a matrix format and would like to run the latent class model using flexmix. Though, my problem here is that Flexmix automatically genera

[R] MCMCfactanal inquiries

2012-06-15 Thread Haillie Lee
Dear list, Hi, I am emailing to see if it would be possible to get some help on running MCMCfactanal on R. I am trying to derive a single score measuring a likelihood to recieve IMF loans from 8 different variables related to IMF representation but for reason, my codes do not seem to take me to wh

Re: [R] wgcna

2012-06-15 Thread Fabrice Tourre
Peter, Thank you. In fact, I am also very interesting to WGCNA. On Sat, Jun 16, 2012 at 3:29 AM, Peter Langfelder wrote: > On Fri, Jun 15, 2012 at 8:04 AM, Ingezz wrote: >> Dear Peter, >> >> I am trying to apply the WGCNA meta-analysis for two (or more) microarray >> datasets-tutorial to my own

Re: [R] time zones and the chron to POSIXct conversion

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 11:26 PM, David Winsemius wrote: > > On Jun 15, 2012, at 11:18 PM, R. Michael Weylandt wrote: > >> It does seem that as.POSIXct.date doesn't respect the tz= argument the >> generic suggests it would. > > > Why would a date function have a TZ? `as.Date` wouldn't. > It seems

Re: [R] time zones and the chron to POSIXct conversion

2012-06-15 Thread Jeff Newmiller
> Why would a date function have > a TZ? `as.Date` wouldn't. This statement seems nonsensical to me. POSIXt objects have tzone attributes. Date and chron objects do not. Since they do not include tzone, logically the user should be able to supply it during a conversion from Date or chron to PO

Re: [R] time zones and the chron to POSIXct conversion

2012-06-15 Thread David Winsemius
On Jun 15, 2012, at 11:18 PM, R. Michael Weylandt wrote: It does seem that as.POSIXct.date doesn't respect the tz= argument the generic suggests it would. Why would a date function have a TZ? `as.Date` wouldn't. I'd think this is a bug that could be changed without breaking back-compatibili

Re: [R] Cholesky decomposition error

2012-06-15 Thread nataraj
Dear Mr.Kjetil, Thanks for your comment. You have already pointed me the article in reply to one of my earlier post to this list and I am following the paper. Now I am checking for condition for positive definiteness for original matrix using a simple script (got from earlier posting in the lis

Re: [R] Loop Help

2012-06-15 Thread Özgür Asar
Hi, Do you mean printing the results of degree_w(net.101031) and apply(net.101031, 2, mean) in a loop? see ?print to print the results and ?cat as a suporting function. For instance see the toy example below for (i in 1:5){ print('') cat("model",i,"\

Re: [R] time zones and the chron to POSIXct conversion

2012-06-15 Thread R. Michael Weylandt
It does seem that as.POSIXct.date doesn't respect the tz= argument the generic suggests it would. I'd think this is a bug that could be changed without breaking back-compatibility, but I don't have the power to make such things happen. R-Core ruling? Michael On Fri, Jun 15, 2012 at 2:25 AM, Jann

Re: [R] Replication of linear model/autoregressive model

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 6:56 AM, Al Ehan wrote: > Hi, > > I would like to make a replication of 10 of a linear, first order > Autoregressive function, with respect to the replication of its innovation, > e. for example: > > #where e is a random variables of innovation (from GEV distribution-that >

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread Peter Ehlers
On 2012-06-15 16:14, Debs Majumdar wrote: I thought that might be the case and did a couple of dev.off() even though I started a new R session. Each time I try to use the plot, it comes up with "pdf 2". I think that the code for plot.lordif may have a bug; it contains this line: if (Sys.in

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread Jim Holtman
the other command to use is graphics.off() Sent from my iPad On Jun 15, 2012, at 19:14, Debs Majumdar wrote: > I thought that might be the case and did a couple of dev.off() even though I > started a new R session. Each time I try to use the plot, it comes up with > "pdf 2". > > > > -

Re: [R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-15 Thread Joshua Ulrich
Hi David, I apologize for the lack of documentation. I added it quickly and didn't have adequate time to document it. The function below works with the objective function in the "Large-scale portfolio optimization with DEoptim" vignette. Also, I just committed the full example (pkg/DEoptim/sandb

Re: [R] (no subject)

2012-06-15 Thread Michael Sumner
Very sorry, this was just clumsy fingers on the bike/phone. No email was intended, please excuse my noise. Cheers, Mike On Friday, June 15, 2012, Michael Sumner wrote: > -- > Michael Sumner > Hobart, Australia > e-mail: mdsum...@gmail.com > >[[alternative HTML version deleted]] > > __

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread Debs Majumdar
I thought that might be the case and did a couple of dev.off() even though I started a new R session. Each time I try to use the plot, it comes up with "pdf 2". - Original Message - From: R. Michael Weylandt To: Debs Majumdar Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 4:

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread R. Michael Weylandt
It looks like you have one too many pdf objects open. The "pdf 2" that is printed indicates control was returned to another pdf device. Keep doing dev.off() until you get the message "null device 1" and then try it once again. Best, Michael On Fri, Jun 15, 2012 at 6:06 PM, Debs Majumdar wrote: >

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread Debs Majumdar
I am using R 2.15.0 on Windows 7. It shows the plots on the screen. I can page-up and page-down to look at the different plots. It's when I want to save the plot, I get a blank pdf file (0 kb). # > pdf("education.pdf") > plot(ed_dif, labels = c("White", "African American")) > dev.of

Re: [R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 4:39 PM, Debs Majumdar wrote: > Hi, > > I am trying to save multiple plots in a single pdf file when  the plots are > generated by a single plot command. I am using the "lordif" package which > generates multiple plots with one command. > > pdf("education.pdf") > plot.lor

[R] Save multiple plots in a single pdf file when the plots are generated by a single plot command

2012-06-15 Thread Debs Majumdar
Hi, I am trying to save multiple plots in a single pdf file when  the plots are generated by a single plot command. I am using the "lordif" package which generates multiple plots with one command. pdf("education.pdf") plot.lordif(ed_dif, labels = c("White", "African American")) dev.off() And

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Rui Barradas
Hello, I didn't know rep_vec couldn't be modified, I thought vec was the main vector. Revised. vec = c("1","2","3","-","-","-","4","5","6","1","2","3","-","-","-") rep_vec = rep(vec,times=20) nms = c("A","B","C","D") rv <- sapply(split(rep_vec, cumsum(rep(c(1, 0, 0), length(rep_vec)/3))), pas

Re: [R] phyloclim help

2012-06-15 Thread Brent Hendrixson
David - You have been a tremendous help.  This solved my problems.  It's working now!  I switched to forward slashes and changed the directory to "C:/R".  I tweaked the memory available to maxent and VOILA! Thank you!!! > CC: r-help@r-project.org > F

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
I'm checking out Phil's solution...so far so good. Thanks! Yes, 25 not 5 rows, sorry about that. Rui - I can't modify rep_vec...that's just sample data. I have to start with rep_vec and go from there. have a good weekend all... Ben On Fri, Jun 15, 2012 at 2:51 PM, Rui Barradas wrote: > Hello

Re: [R] Trouble with .bat files upon installation of 15.0

2012-06-15 Thread Sarah Henderson
Thanks for your help -- you were absolutely correct. And I apologize for the poor nomenclature -- when referring to versions I always just say 'fifteen' or 'twelve point one', so it is too easy to forget the leading '2.' when typing. Careless of me. Cheers, Sarah > - Until June 8th I was runni

Re: [R] Wrong computation of time differenze in POSIXct - additional digits

2012-06-15 Thread peter dalgaard
On Jun 15, 2012, at 20:33 , Rui Barradas wrote: > Hello, > > A classic of floating-point accuracy is > > > 3/5 - 3/5 > [1] 0 > > 3/5 - (2/5 + 1/5) > [1] -1.110223e-16 > > 3/5 - 2/5 - 1/5 > [1] -5.551115e-17 > > Rui Barradas > Yes. There are only about 16 significant digits in (64 bit) floati

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Rui Barradas
Hello, Try vec = c("1","2","3","-","-","-","4","5","6","1","2","3","-","-","-") nms = c("A","B","C","D") rep_vec <- rep(sapply(split(vec, cumsum(rep(c(1, 0, 0), 5))), paste, collapse=""), 4) mat <- matrix(rep_vec, nrow=5, byrow=TRUE, dimnames=list(NULL,nms)) mat Hope this helps, Rui Barrad

Re: [R] phyloclim help

2012-06-15 Thread David Winsemius
On Jun 15, 2012, at 3:43 PM, Brent Hendrixson wrote: Hi David - Looking at the package documentation I see this: maxent: A list containing the location of the MAXENT application and its input files (see details). Maybe I was wrong about 'spec' and the malformed argument is 'maxent'. If I

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Phil Spector
Ben - There are most likely faster ways, but matrix(apply(matrix(rep_vec,ncol=3,byrow=TRUE),1,paste,collapse=''), ncol=4,byrow=TRUE,dimnames=list(NULL,nms)) seems reasonably fast. (Do you really mean 4 columns and *5* rows? With rep_vec = rep(vec,times=20), I get 25 rows.)

[R] argument "x" is missing, with no default - Please help find argument x

2012-06-15 Thread dunner
R programming question, not machine learning, although that's the content. Apologies to all for whom the following code is eye-burning. I am using foreach() to run a simulation on a randomForest model (actually conditional randomForest ... "party" package). The simulation is in two dimensions. exa

[R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
Hello, What is the fastest way to do this? I has to be done quite a few times. Basically I have sets of 3 numbers (as characters) and sets of 3 dashes and I have to store them in named columns. The order of the sets and the column name they fall under is important. The actual numbers and the patte

Re: [R] dumpMethods (was: How to build a large identity matrix faster?)

2012-06-15 Thread Spencer Graves
dumpMethods('diag', file='diag.R') readLines('diag.R') character(0) I appreciate the alternative suggested by Ceci Tam, but is this result a feature or a bug? More generally, what do you recommend I read to learn about S4 generics? I've read fair portions of Chambers (1998,

Re: [R] phyloclim help

2012-06-15 Thread Brent Hendrixson
Hi David - > Looking at the package documentation I see this: > > maxent: A list containing the location of the MAXENT application and > its input files (see > details). > > Maybe I was wrong about 'spec' and the malformed argument is 'maxent'. > If I had been constructing it I would have created

Re: [R] wgcna

2012-06-15 Thread Peter Langfelder
On Fri, Jun 15, 2012 at 8:04 AM, Ingezz wrote: > Dear Peter, > > I am trying to apply the WGCNA meta-analysis for two (or more) microarray > datasets-tutorial to my own data. > >> mp=modulePreservation(multiExpr,multiColor,referenceNetworks=1,verbose=3,networkType="signed", >> nPermutations=30,max

Re: [R] Looking for Speed in a Toy Simulation Example

2012-06-15 Thread Rui Barradas
Hello, With Michael's sugestions (I keep forgeting package compiler) t0 <- system.time({ ... variant 3.b ... # ## Variant 3.c ## # install.packages("compiler") libra

[R] How do anova() and Anova(type="III") handle incomplete designs?

2012-06-15 Thread Justin Montemarano
Hello all: I am confused about the output from a lm() model with an incomplete design/missing level. I have two categorical predictors and a continuous covariate (day) that I am using to model larval mass (l.mass): leaf.species has three levels - map, syc, and oak cond.time has two levels - 3

Re: [R] Wrong computation of time differenze in POSIXct - additional digits

2012-06-15 Thread Rui Barradas
Hello, A classic of floating-point accuracy is > 3/5 - 3/5 [1] 0 > 3/5 - (2/5 + 1/5) [1] -1.110223e-16 > 3/5 - 2/5 - 1/5 [1] -5.551115e-17 Rui Barradas Em 15-06-2012 18:18, David Winsemius escreveu: On Jun 15, 2012, at 12:49 PM, Julia wrote: Hello, I wanted to compute the time differenze

Re: [R] R start screen

2012-06-15 Thread David L Carlson
It can also be affected by the MDI setting in your Rconsole file. If you have MDI = yes Then the RGui runs with the console inside it and the menu bar is on RGui. If you have MDI = no Then you get one the Rconsole and the menu bar is on Rconsole. The default is generally MDI=yes, but if you ha

Re: [R] Cholesky decomposition error

2012-06-15 Thread Kjetil Halvorsen
see inline. On Fri, Jun 15, 2012 at 4:33 AM, wrote: > Thanks for your reply. I am sorry and I am bit hurried up to say before doing > a proper due diligence, I have found out that during the optimization the > variables tend to vary the values of the matrix , the function report error > at so

Re: [R] Wrong computation of time differenze in POSIXct - additional digits

2012-06-15 Thread David Winsemius
On Jun 15, 2012, at 12:49 PM, Julia wrote: Hello, I wanted to compute the time differenze between to times: first =as.POSIXct( "2012-06-15 16:32:39.0025 CEST") second = as.POSIXct("2012-06-15 16:32:39.0086 CEST") second - first The result is Time difference of 0.006099939 secs instead of j

Re: [R] Binary Quadratic Opt?

2012-06-15 Thread Petr Savicky
On Fri, Jun 15, 2012 at 05:17:36PM +0530, Anup Bhatkar wrote: > Hello, > > I have to solve Binary Quadratic Optimization problem i.e the objective > function is quadratic, constraints are linear and variable are binary. I > checked the "quadprog" package but it does not seem to be right choice f

[R] Wrong computation of time differenze in POSIXct - additional digits

2012-06-15 Thread Julia
Hello, I wanted to compute the time differenze between to times: first =as.POSIXct( "2012-06-15 16:32:39.0025 CEST") second = as.POSIXct("2012-06-15 16:32:39.0086 CEST") second - first The result is Time difference of 0.006099939 secs instead of just 0.0061 secs So R adds aditional numbers a

Re: [R] R <--> JVM

2012-06-15 Thread Oliver Ruebenacker
Hello, By RNI, do you mean the Microsoft Raw Native Interface or the Rengine R Native Interface? Take care Oliver On Fri, Jun 15, 2012 at 12:03 PM, wrote: > Hello, > > first of all thanks to both of you for your fast response. > Going back to Michael's wonderful ASCII art mast

Re: [R] Apply() on columns

2012-06-15 Thread Peter Ehlers
On 2012-06-15 01:09, faelsendoorn wrote: Hi, I have some trouble with the following: I have a table of 7 rows and 6columns. The columns 1,2,3 have information about the number of employees. The columns 4,5,6 have information about the number of working hours. Each row, is corresponding with a we

Re: [R] remove leading slash

2012-06-15 Thread Spencer Graves
How about an alternative: **|install.packages("sos", repos="http://R-Forge.R-project.org";)|** library(sos) (x <- back2ForwardSlash()) \002 \001 \102 (xs <- strsplit(x, '/')[[1]][-1]) nch <- nchar(xs) while(any((nch2 <- nchar(xs <- gsub('^0', '', xs))) Yes, I've been messing with that. I've

Re: [R] R: Securities earning covariance

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 10:35 AM, Oliver Ruebenacker wrote: >     Hello, > > On Fri, Jun 15, 2012 at 10:15 AM, R. Michael Weylandt > wrote: >> ii) There does not exist -- to my knowledge -- an implementation of R >> which runs on the JVM. > >  I think he means driving the R framework from Java vi

Re: [R] R <--> JVM

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 11:03 AM, wrote: > Hello, > > first of all thanks to both of you for your fast response. > Going back to Michael's wonderful ASCII art masterpiece, what we have now is > something like this: > > ---  JVM --- > >    JAVA   > >          JDBC >          

[R] R <--> JVM

2012-06-15 Thread ANGELO.LINARDI
Hello, first of all thanks to both of you for your fast response. Going back to Michael's wonderful ASCII art masterpiece, what we have now is something like this: --- JVM --- JAVA JDBC | | Algorithm |

[R] some help to improve "hist to plot relative frequencies"

2012-06-15 Thread gianni lavaredo
Dear Researches, sorry for disturb. I wish to improve my figure in R plotting the relative frequencies of my data set. library(lattice) a <- c(0,0,0,1,1,2,4,5,6,7,7,7,7,7,8,8,8,8,9,9,9,9,10,10,11) histogram(a, xlab="myData") what i wish to do is: 1) invert the order of X and Y (eg: Precent of T

Re: [R] R start screen

2012-06-15 Thread Duncan Murdoch
On 12-06-15 9:04 AM, Rossenu, Stefaan wrote: After installation of R on windows machine and starting the R program, I only see the R-console but not the RGUI screen... Do I need to re-install or change some settings? R is a short form for Rterm, so that's what should start. If you want the

Re: [R] R: Securities earning covariance

2012-06-15 Thread Oliver Ruebenacker
Hello, On Fri, Jun 15, 2012 at 10:15 AM, R. Michael Weylandt wrote: > ii) There does not exist -- to my knowledge -- an implementation of R > which runs on the JVM. I think he means driving the R framework from Java via JNI. I think the questions boils down to whether you can open multipl

[R] R: R: Securities earning covariance

2012-06-15 Thread ANGELO.LINARDI
Hello, first of all tank to both of you for your fast response. Going back to Michael's wonderful ASCII art masterpiece, what we have now is something like this: --- JVM --- JAVA JDBC | | Algorithm |

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Hi Sarah,   Sorry for taking more of your time. I thought that before investigating the use of assign and paste, I should first understand the approach of using 'list()'. However, it seems to me that the use of list does not work very well, unless I have wrongly implemented your suggestion. I im

Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread Jeff Newmiller
Since RExcel imports date/time columns as POSIXt, sticking with that is probably simpler in this case. The key I have found that makes the use of POSIXt types relatively straightforward is to set the TZ environment variable using Sys.setenv() to a value that is compatible with the timezone of t

Re: [R] Multivariate Normal and loops

2012-06-15 Thread R. Michael Weylandt
I don't think you need loops at all actually :-) [The main thing to working with R vs. C is "vectorization" -- embrace it now and life will be much better] You could do something like this: library(MASS) # Provides a multivariate normal distribution mvrnorm(100, c(1,5), matrix(c(2,1,1,2), ncol =

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Thanks Sarah,   Yes, I really want DCred1, DCred2, etc. I will check and understand your answer. I appreciate your time and help.   Lexi From: Sarah Goslee Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 12:54 PM Subject: Re: [R] Help with Sequential Di

Re: [R] How to convert month-day-year to Julian data number?

2012-06-15 Thread arun
Hi, Try: ?library(chron) julian()  x<-c(1:5) #month  d<-c(10:14) #day  y<-1970 #year julian(x,d,y,origin=c(month=2,day=1,year=1970)) [1] -22  10  39  71 102 A.K. - Original Message - From: Paloma Moya To: "r-help@r-project.org" Cc: Sent: Friday, June 15, 2012 2:13 AM Subject: [

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Dear Sarah, Thanks very much for the assistance. I will go through what you have suggested to understand. Lexi - Original Message - From: Sarah Goslee To: "Lekgatlhamang, lexi Setlhare" Cc: "r-help@r-project.org" Sent: Friday, June 15, 2012 3:58 PM Subject: Re: [R] Help with Sequenti

[R] Binary Quadratic Opt?

2012-06-15 Thread Anup Bhatkar
Hello, I have to solve Binary Quadratic Optimization problem i.e the objective function is quadratic, constraints are linear and variable are binary. I checked the "quadprog" package but it does not seem to be right choice for the problem. Can any one suggest what would be the best package to

[R] Multivariate Normal and loops

2012-06-15 Thread Cassie
Hi, i'm not english and i'm not very familiar to R, and i'm asking if you can help me. I'm wondering how to create a multivariate normal an then repeat this for a sample of T=1000, and the save this result. Thank you very much for your helping -- View this message in context: http://r.789695.n4.n

Re: [R] plot cdf

2012-06-15 Thread MSousa
Thanks -- View this message in context: http://r.789695.n4.nabble.com/plot-cdf-tp4633349p4633515.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

[R] R start screen

2012-06-15 Thread Rossenu, Stefaan
After installation of R on windows machine and starting the R program, I only see the R-console but not the RGUI screen... Do I need to re-install or change some settings? Tx! Notice: This e-mail message, together with any attachme...{{dropped:14}} ___

Re: [R] wgcna

2012-06-15 Thread Ingezz
Dear Peter, I am trying to apply the WGCNA meta-analysis for two (or more) microarray datasets-tutorial to my own data. > mp=modulePreservation(multiExpr,multiColor,referenceNetworks=1,verbose=3,networkType="signed", > > nPermutations=30,maxGoldModuleSize=100,maxModuleSize=400) However, the e

[R] Replication of linear model/autoregressive model

2012-06-15 Thread Al Ehan
Hi, I would like to make a replication of 10 of a linear, first order Autoregressive function, with respect to the replication of its innovation, e. for example: #where e is a random variables of innovation (from GEV distribution-that explains the rgev) #by using the arima.sim model from TSA pack

Re: [R] R under JVM

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 9:36 AM, wrote: > Dear all, > > > > first of all I apologize for not having changed the object. Subject you mean. Linguistically, it is perhaps a little arbitrary, but that's the name the email gods chose long ago and I tend to agree with them. I tend to think more "subje

Re: [R] Rename output file in Swaeve and Tex

2012-06-15 Thread Yihui Xie
I do not think it is possible with the 'R CMD Sweave' interface, but you can always use the 'R -e' approach, e.g. R -e 'Sweave("foo.Rnw"); file.rename("foo.tex", "foo-bar.tex"); tools::texi2dvi('foo-bar.tex')' (not tested, but idea is there) To make this more natural, you can try the knitr package

Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread R. Michael Weylandt
Honestly, given what a pain dates are in Excel, I might simply import them as strings and do the conversion on the R side of things. Also, I'd recommend you use Date objects rather than POSIXct to cut out the unnecessary complexity of timezones, DST, etc. [See Gabor's article in RNews 4/1 for a ful

Re: [R] Looking for Speed in a Toy Simulation Example

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 9:48 AM, R. Michael Weylandt wrote: > As of recent versions of R, you can actually go for what are > officially recognized as "ultimate speed" functions .rowSums() and > friends. Sorry, perhaps that wasn't totally clear. Regarding .rowSums() note that leading period. You p

Re: [R] Looking for Speed in a Toy Simulation Example

2012-06-15 Thread R. Michael Weylandt
As of recent versions of R, you can actually go for what are officially recognized as "ultimate speed" functions .rowSums() and friends. You might also use the compiler() package to byte-compile that inner loop. [The function going to sapply] It won't be massive, but perhaps another 3 or 4x Micha

Re: [R] spelling correction using R

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 8:24 AM, shilpa rai wrote: > thanks to all :) Unless I suddenly became plural, I believe you meant to hit reply-all. > > I have found a code on nets , please visit the following link > > http://anrprogrammer.wordpress.com/2012/02/08/a-spell-checker-in-r/ > > when I am run

[R] R under JVM

2012-06-15 Thread ANGELO.LINARDI
Dear all, first of all I apologize for not having changed the object. I just re-used an old email I sent some time ago. The let us go into the question. Our architecture is the following: A (set of) java programs running under a jvm that passes data and instructions to an R instance via

Re: [R] help in sentDetect() fuction

2012-06-15 Thread R. Michael Weylandt
On Fri, Jun 15, 2012 at 1:48 AM, raishilpa wrote: > hello, > I am using the following code > >>s<-"I am very happy, excited, and optimistic.I am very scared, annoyed, and > irritated.Iraq’s political crisis entered its second week one step closer to > the potential.dissolution of the government, w

Re: [R] R: Securities earning covariance

2012-06-15 Thread R. Michael Weylandt
I'm somewhat confused: i) What does this have to do with your subject line? ii) There does not exist -- to my knowledge -- an implementation of R which runs on the JVM. iii) Have you simply looked into R's native parallel computing options? That seems to be (maybe?) what you are trying to do. I

Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread Keith Weintraub
Jeff, Thanks. I was able to easily get rid of the do.call code and use the t( t(...)) construct. In terms of the dates I have tried your suggestion and I am having an odd problem. The dates I included in my previous message were only a subset of the actual dates I am using. My dates were im

Re: [R] histogram fill lattice

2012-06-15 Thread David Winsemius
On Jun 15, 2012, at 5:40 AM, Powell, Jeff wrote: Thank you for your response, I will try to be clearer. I would like to fill my lattice histogram bars using a symbol rather than a color. If that is not possible, then I will use hist() instead. From trellis.par.get() bar.fill only include

Re: [R] POSIXlt and trunc

2012-06-15 Thread R. Michael Weylandt
General rule of thumb: use POSIXct rather than POSIXlt for such things and only convert to POSIXlt (losslessly) at the end of your calculations when you need it for display reasons. Internally, POSIXct is just a double, so it is nice to do calculations on, while POSIXlt is a list-like object which

Re: [R] moving from loops to apply

2012-06-15 Thread Petr Savicky
On Fri, Jun 15, 2012 at 02:08:13PM +0200, Petr Savicky wrote: > On Fri, Jun 15, 2012 at 11:27:44AM +, Schumacher, G. wrote: > > Dear subscribers, > > > > I have made a simulation using loops rather than apply, simply because the > > loop function seems more natural to me. However, the current

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Sarah Goslee
I missed something in my original reply: You intended a recursive approach, I think, but that wasn't clear in your code, and I simply repeated your actual code rather than your intended code in my response. If that's what you want, you need something more like: DCred<- list() DCred[[1]] <- diff(C

Re: [R] Apply() on columns

2012-06-15 Thread R. Michael Weylandt
Just to take a stab at it, I'd suggest you don't actually need apply() and could simply get what you need with hist(DATA[,4:6]) if your data is as described. Michael On Fri, Jun 15, 2012 at 7:23 AM, Jean V Adams wrote: > Frans, > > I'm not sure I understand what you're after. > > I suggest tha

Re: [R] Looking for Speed in a Toy Simulation Example

2012-06-15 Thread Simon Knos
Rui, thank you very much. I keep forgetting about the rowSum and friends. (precalculating the powers just slipped my attention). And, yes, a factor of will of course do. Do you see a further improvement in this case? Best, Simon On Fri, Jun 15, 2012 at 12:25 PM, Rui Barradas wrote: > Hello,

Re: [R] spelling correction using R

2012-06-15 Thread R. Michael Weylandt
Grammar is quite complicated, but for spelling you might try this wonderful article by Peter Norvig: http://norvig.com/spell-correct.html Michael On Fri, Jun 15, 2012 at 12:10 AM, raishilpa wrote: > hello > > I want a code which can correct the spelling mistakes  as well as > grammatical mistak

Re: [R] Customizing a Plot in Correspondence Analysis

2012-06-15 Thread Milan Bouchet-Valat
Le jeudi 14 juin 2012 à 20:32 -0400, Salvador Ramirez a écrit : > Hello, > > Using the Correspondence Analysis package (ca), I wonder if there is a way > to further customize the plot beyond the options given in plot.ca provided > by the mentioned package. > > The correspondence analysis I am doi

Re: [R] Sugeestion about tuning of SVM

2012-06-15 Thread Mark Leeds
Hi: I don't know anything about gentoypes but it sounds like you overfitted the training set so you should try using regularization. In standard svm-classification algorithms, that can be done by decreasing the parameter C which decreases the objective functional penalty for mis-classifying. ( allo

Re: [R] Apply() on columns

2012-06-15 Thread Jean V Adams
Frans, I'm not sure I understand what you're after. I suggest that you share a small example data set, using dput(). Then give an example of what you want the output to look like. Jean faelsendoorn wrote on 06/15/2012 03:09:41 AM: > Hi, > > I have some trouble with the following: I have a t

Re: [R] How to convert month-day-year to Julian data number?

2012-06-15 Thread Jean V Adams
?julian Paloma Moya wrote on 06/15/2012 01:13:04 AM: > Hello, > I am trying to convert calendar dates (Month, Day, Year) into Julian Days > > Product code Bureau of Meteorology station number Month Day Year > Date_mdy Date > 4102001 70014 1 1 1939 1/01/1939 1/01/1939 > 4102001 70014 1 2 19

[R] Sugeestion about tuning of SVM

2012-06-15 Thread Guido Leoni
Dear list I've a generic question about how to tune an SVM I'm trying to classify with caret package some population data from a case-control study . In each column of my matrix there are the SNP genotypes , in each row there are the individuals. I correctly splitted my total dataset in training(1

Re: [R] moving from loops to apply

2012-06-15 Thread Petr Savicky
On Fri, Jun 15, 2012 at 11:27:44AM +, Schumacher, G. wrote: > Dear subscribers, > > I have made a simulation using loops rather than apply, simply because the > loop function seems more natural to me. However, the current simulation takes > forever and I have decided - finally - to learn how

Re: [R] moving from loops to apply

2012-06-15 Thread Schumacher, G.
Yes, it does thanks. Before your explanation I didn't understand that I had to separate distancer and y with a comma...great! From: Rui Barradas [ruipbarra...@sapo.pt] Sent: Friday, June 15, 2012 1:49 PM To: Schumacher, G. Cc: r-help@r-project.org Subject:

Re: [R] moving from loops to apply

2012-06-15 Thread Rui Barradas
Hello, Simple question with reproducible example code. The best way to go is to know to what dimension you want to apply the function, the 1st, and to write the function in such a way as to have the passed rows as the first argument. If it has other arguments, they go after. Since your functio

[R] moving from loops to apply

2012-06-15 Thread Schumacher, G.
Dear subscribers, I have made a simulation using loops rather than apply, simply because the loop function seems more natural to me. However, the current simulation takes forever and I have decided - finally - to learn how to use apply, but - as many other people before me - I am having a hard

Re: [R] spelling correction using R

2012-06-15 Thread Oliver Ruebenacker
Hello, On Fri, Jun 15, 2012 at 1:10 AM, raishilpa wrote: > I want a code which can correct the spelling mistakes  as well as > grammatical mistakes in the sentences...that is if I am writing following > sentence: > > I want too meet my frnd bt due to hectic shcedule I cant > > I want output

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Sarah Goslee
If you really want DCred1, DCred2, etc, you'll need to use assign() and paste() within your loop. But he's a more R-ish way: # Differences of Cred DCred <- list() for(i in 1:5){ print(DCred[[i]]<- diff(DCred, lag=i, difference=1)) } DCred[[1]] Sarah On Friday, June 15, 2012, Lekgatlhamang, le

Re: [R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Dear R Users, Sorry for what seems like I am re-posting. When I was typing my initial posting, I intended to copy and paste the commands from my script, but ended up forgetting. I am now pasting the commands in this email.NB: Below is a copy of 'all' the relevant commands in my script    ###

[R] Rename output file in Swaeve and Tex

2012-06-15 Thread Manish Gupta
HI, I am working on R and Latex. R CMD Sweave Test.Rnw (this generates Rnw.Tex file ) R CMD pdflatex Test.tex (It generated Test.pdf) Is there any way to change the name of of output file (Test.pdf). I want it to pass the output file name as parameter. R CMD Sweave Test.Rnw Output_File

[R] Help with Sequential Differencing

2012-06-15 Thread Lekgatlhamang, lexi Setlhare
Dear R Users, I have struggled with the following problem for days, which I thought was simple, although it would likely be basic to most of you. I am working with time series data. In my script, my intention is to create first differences of the variables in the file so that I end up estimat

Re: [R] Looking for Speed in a Toy Simulation Example

2012-06-15 Thread Rui Barradas
Hello, Will a factor of 4 do? This is variant 3, revised. # ## Variant 3.b ## # ## Initialize matrix to hold results singlecolor <- matrix(NA, simlength, noplayer) #

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-15 Thread maxbre
Thanks a lot, Deepayan! What a great honour hearing from you inside this thread! Now, at last, I understand where MY problem was (but please, don’t laugh – too loudly at least – and, first of all, sorry for that!) this was my “poor” wrong attempt (but I did not post this) means<-mean(exp(x)) p

Re: [R] histogram fill lattice

2012-06-15 Thread Powell, Jeff
Thank you for your response, I will try to be clearer. I would like to fill my lattice histogram bars using a symbol rather than a color. If that is not possible, then I will use hist() instead. >From trellis.par.get() bar.fill only includes "col", so perhaps I'm out of luck? With regards, Je

Re: [R] POSIXlt and trunc

2012-06-15 Thread Rui Barradas
Hello, It works with me. Problem with R version? OS? sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5] LC_TIME=Portug

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-15 Thread Deepayan Sarkar
On Mon, Jun 11, 2012 at 1:10 PM, maxbre wrote: > sorry but I can't close this thread with a viable solution other than the > following one > (i.e. by defining an user function to add line); > > I understand that the problem is related to the fact that: > mean(log(.)) != log(mean(.)) is > but for s

[R] DEoptim example illustrating use of fnMap parameter for enforcement of cardinality constraints

2012-06-15 Thread David-Michael Lincke
Function DEoptim in package DEoptim for differential evolution defines an optional parameter fnMap: fnMap "an optional function that will be run after each population is created, but before the population is passed to the objective function. This allows the user to impose integer/cardinality c

  1   2   >