From pdalgd at gmail.com Thu Dec 1 00:08:44 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Thu, 1 Dec 2011 00:08:44 +0100 Subject: [R] Problem installing the package tkrplot In-Reply-To: References: Message-ID: <1A41EF30-6C24-466E-B46B-F5CBC3E6B94F@gmail.com> On Nov 30, 2011, at 15:31 , Marcos Amaris Gonzalez wrote: > Hello people. My problem is that when I try to install the package > tkrplot, I got the next problem: You seem to be missing the tk.h file. This is, most likely, in a tcl/tk development package that you haven't installed. This is part of your Linux distribution, not R. (You're not telling us which Linux you are running, and it can't be pinpointed any further without that information, but look for something like tk-devel and tcl-devel.) > >> install.packages("tkrplot") > Installing package(s) into ?/home/marcos/R/i686-pc-linux-gnu-library/2.13? > (as ?lib? is unspecified) > probando la URL > 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/tkrplot_0.0-23.tar.gz' > Content type 'application/x-gzip' length 39037 bytes (38 Kb) > URL abierta > ================================================== > downloaded 38 Kb > > * installing *source* package ?tkrplot? ... > configure: creating ./config.status > config.status: creating src/Makevars > ** libs > gcc -I/usr/share/R/include -I/usr/include/tcl8.5 -I/usr/include/tcl8.5 > -fpic -std=gnu99 -O3 -pipe -g -c tcltkimg.c -o tcltkimg.o > tcltkimg.c:2:16: fatal error: tk.h: No existe el fichero o el directorio > compilation terminated. > make: *** [tcltkimg.o] Error 1 > ERROR: compilation failed for package ?tkrplot? > * removing ?/home/marcos/R/i686-pc-linux-gnu-library/2.13/tkrplot? > Warning in install.packages : > installation of package 'tkrplot' had non-zero exit status > > The downloaded packages are in > ?/tmp/RtmpHRfZ1k/downloaded_packages? > > In this moment I have R version 2.13.2 (2011-09-30). I stayed > thankfull for the any help. > > --- > Marcos Amaris Gonzalez > > ______________________________________________ > R-help at 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 code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From dwinsemius at comcast.net Thu Dec 1 00:23:19 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Wed, 30 Nov 2011 18:23:19 -0500 Subject: [R] Bootstrapping for residuals In-Reply-To: <1322670663989-4123657.post@n4.nabble.com> References: <1322670663989-4123657.post@n4.nabble.com> Message-ID: On Nov 30, 2011, at 11:31 AM, bubbles1990 wrote: > > Hi, Ive been trying to write a program for bootstrapping residuals > in R but > without much success. > > A lecturer wants to predict the performance of students in an end-of- > year > physics exam, y. The lecturer has the students results from a mid-term > physics exam, x, and a mid-term biology exam, z. > He proposes the following linear model for the end-of-year exam result > yi = ? + ?xi + ?zi + qi, where q is the error. > Y is a matrix of the data and we have y=first column of the data and > X=second 2 columns(the x & z data) > Now I need to write a program for obtaining bootstrap estimates, You replied but included no context, a common and not appreciated (in both senses of that verb) failing in posts from Nabble. My question would be: bootstrap estimate ... of what? -- David. > i have: > > x=scan(data) > Y=matrix(x,ncol=3,byrow=T) > y=Y[,1] > X=Y[,2:3] > > ls=lsfit(X,y) > beta=ls$coef > > yest=beta[1]+beta[2]*X[,1]+beta[3]*X[,2] > res=y-yest > > boot=function(X,res,beta,b) > { > n=24 > output=matrix(0,ncol=2,nrow=b) > for(i in 1:b) > { > error=sample(res,n,replace=T) > ystar=beta[1]+beta[2]*X[,1]+beta[3]*X[,2]+error > ls=lsfit(X,ystar) > output[i,]=ls$coef > } > output > } > > I think the first 8 lines are right but my function might be wrong? > Any help? > > -- > View this message in context: http://r.789695.n4.nabble.com/Bootstrapping-for-residuals-tp4123657p4123657.html > Sent from the R help mailing list archive at Nabble.com. > David Winsemius, MD West Hartford, CT From ggrothendieck at gmail.com Thu Dec 1 00:33:44 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Wed, 30 Nov 2011 18:33:44 -0500 Subject: [R] forecasting linear regression from lagged variable In-Reply-To: <1322689204697-4125091.post@n4.nabble.com> References: <1322689204697-4125091.post@n4.nabble.com> Message-ID: On Wed, Nov 30, 2011 at 4:40 PM, AaronB wrote: > I'm currently working with some time series data with the xts package, and > would like to generate a forecast 12 periods into the future. There are > limited observations, so I am unable to use an ARIMA model for the forecast. > Here's the regression setup, after converting everything from zoo objects to > vectors. > > hire.total.lag1 <- lag(hire.total, lag=-1, na.pad=TRUE) > lm.model <- lm(hire.total ~ case.total + hire.total.lag1) > > hire.total is a monthly historical time series from Jan 2010 to Oct 2011. > hire.total.lag1 is the same time series, lagged 1 period backwards. > case.total is a monthly historical time series from Jan 2010 to Oct 2011, > plus forecasts forward another 12 periods. > > I'd like to use this model to forecast hire.total for the next period, and > use each successive prediction of hire.total as the lag1 "observation" for > the next prediction. I have enough "observed" values for case.total to > forecast out as far as I need. I might be able to construct this using a > loop, but I have a feeling it will be messy and slow. Any suggestions? > Its not clear that you can't use an arima model. You would use the n.ahead= argument of predict.Arima. The dyn and dynlm packages handle lagged lm's of zoo objects but you will have to do a predict and then append the prediction to the data and repeat in a loop as you describe. If you want to be careful about error terms then its more complex. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From michael.weylandt at gmail.com Thu Dec 1 00:51:42 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 30 Nov 2011 18:51:42 -0500 Subject: [R] Invalid number of components, ncomp In-Reply-To: <1322647845.69137.YahooMailNeo@web121516.mail.ne1.yahoo.com> References: <1322647845.69137.YahooMailNeo@web121516.mail.ne1.yahoo.com> Message-ID: I'm not familiar with the package and I don't currently have it loaded, but looking at the examples in the documentation here http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/pls.pcr/html/mvr.html it seems that you need ncomp = 1:6. Saying you want to do multivariate regression on only a single variable is probably the source of the error. Does that help? Michael On Wed, Nov 30, 2011 at 5:10 AM, Vytautas Rakeviius wrote: > Error in mvr(Kd_nM ~ qsar, ncomp = 6, data = my, validation = "CV", method = "kernelpls") : > ? Invalid number of components, ncomp > > How I can fix this? > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > > From flodel at gmail.com Thu Dec 1 01:51:26 2011 From: flodel at gmail.com (Florent D.) Date: Wed, 30 Nov 2011 19:51:26 -0500 Subject: [R] how to call a function for each row In-Reply-To: <002501ccaf70$a67f72b0$f37e5810$@edu> References: <1322658608657-4122906.post@n4.nabble.com> <002501ccaf70$a67f72b0$f37e5810$@edu> Message-ID: if you want to store the result in a column of your data.frame: within(df, Y <- 6*X1+7*X2+8*X3) On Wed, Nov 30, 2011 at 9:59 AM, David L Carlson wrote: > Isn't this even easier? > >> X1 <- c(1:3) >> X2 <- c(3, 4, 6) >> X3 <- c(5, 6, 1) >> Y <- 6*X1 + 7*X2 + 8*X3 >> Y > [1] 67 88 68 > > Or if you really need a function: > >> MakeY <- function(x, y, z) 6*x + 7*y + 8*z >> MakeY(X1, X2, X3) > [1] 67 88 68 > > > ---------------------------------------------- > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College Station, TX 77843-4352 > > > > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On > Behalf Of R. Michael Weylandt > Sent: Wednesday, November 30, 2011 8:17 AM > To: arunkumar1111 > Cc: r-help at r-project.org > Subject: Re: [R] how to call a function for each row > > Read ?apply > > This is easiest: > > df <- matrix(c(1,2,3,3,4,6,5,6,1), 3) > apply(df, 1, function(x) 6*x[1]+7*x[2]+8*x[3]) > > But it's much more efficient to do it with matrix multiplication. In keeping > with the best of tradition, this is left as an exercise to the reader. > > Michael > > On Wed, Nov 30, 2011 at 8:10 AM, arunkumar1111 wrote: >> Hi >> >> ?I have ?a data-frame which look like this >> >> X1 X2 X3 >> 1 ? 3 ?5 >> 2 ? 4 ?6 >> 3 ? 6 ?1 >> >> I want to apply a formula Y=6*X1 + 7*X2 + 8*X3 ?for every row >> >> >> Thanks in Advance >> >> >> >> >> >> >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/how-to-call-a-function-for-each-row-tp41 >> 22906p4122906.html Sent from the R help mailing list archive at >> Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. >> > > ______________________________________________ > R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From fife.dustin at gmail.com Thu Dec 1 03:50:58 2011 From: fife.dustin at gmail.com (Dustin Fife) Date: Wed, 30 Nov 2011 20:50:58 -0600 Subject: [R] FIML with missing data in sem package Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From axel.urbiz at gmail.com Thu Dec 1 04:48:23 2011 From: axel.urbiz at gmail.com (Axel Urbiz) Date: Wed, 30 Nov 2011 22:48:23 -0500 Subject: [R] Random Forests in R Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mattcstats at gmail.com Thu Dec 1 04:56:58 2011 From: mattcstats at gmail.com (Matt Cooper) Date: Thu, 1 Dec 2011 11:56:58 +0800 Subject: [R] R endnote entry Message-ID: I know citation() gives the R citation to be used in publications. Has anyone put this into endnote nicely? I'm not very experienced with endnote, and the way I have it at the momeny the 'R Development Core Team' becomes R. D. C. T. etc. Cheers. From lists at remoteinformation.com.au Thu Dec 1 04:56:57 2011 From: lists at remoteinformation.com.au (Ben Madin) Date: Thu, 1 Dec 2011 10:56:57 +0700 Subject: [R] R logo in eps formt Message-ID: G'day all, Sorry if this message has been posted before, but searching for R is always difficult... I was hoping for a copy of the logo in eps format? Can I do this from R, or is one available for download? cheers Ben From millerlp at gmail.com Thu Dec 1 05:12:22 2011 From: millerlp at gmail.com (Luke Miller) Date: Wed, 30 Nov 2011 23:12:22 -0500 Subject: [R] R endnote entry In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From peter.langfelder at gmail.com Thu Dec 1 06:32:51 2011 From: peter.langfelder at gmail.com (Peter Langfelder) Date: Wed, 30 Nov 2011 21:32:51 -0800 Subject: [R] Random Forests in R In-Reply-To: References: Message-ID: On Wed, Nov 30, 2011 at 7:48 PM, Axel Urbiz wrote: > I understand the original implementation of Random Forest was done in > Fortran code. In the source files of the R implementation there is a note > "C wrapper for random forests: ?get input from R and drive ?the Fortran > routines.". I'm far from an expert on this...does that mean that the > implementation in R is through calls to C functions only (not Fortran)? > > So, would knowing C be enough to understand this code, or Fortran is also > necessary? I haven't seen the C and Fortran code for Random Forest but I understand the note to say that R code calls some C functions that pre-process (possibly re-format etc) the data, then call the actual Random Forest method that's written in Fortran, then possibly post-process the output and return it to R. It would imply that to understand the actual Random Forest code, you will have to read the Fortran source code. Best, Peter From leavestonebodt at yahoo.com Thu Dec 1 08:06:41 2011 From: leavestonebodt at yahoo.com (yuying shi) Date: Wed, 30 Nov 2011 23:06:41 -0800 (PST) Subject: [R] ordinal data simulation Message-ID: <1322723201.36177.YahooMailClassic@web161705.mail.bf1.yahoo.com> Dear all, I am doing an ordinal data simulation. I?have a question regarding the cut off values between categories. Suppose I have three categories, if I do regression, there should be two cut off values. I find some simulation code for the ordinal data. However, they usually only generate a uniform random number and compare the probability with the random number. Could any one be so kind to tell me the rational behind it. I don't know why we need a random number rather than just two fixed cut off values. Thanks very much! Myckel From nsaraf at gmail.com Thu Dec 1 01:48:02 2011 From: nsaraf at gmail.com (nsaraf) Date: Wed, 30 Nov 2011 16:48:02 -0800 (PST) Subject: [R] R code Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tylerdrudolph at gmail.com Thu Dec 1 04:22:35 2011 From: tylerdrudolph at gmail.com (T.D. Rudolph) Date: Wed, 30 Nov 2011 19:22:35 -0800 (PST) Subject: [R] Average of Two Matrices In-Reply-To: <0101EF7F-9DEB-43BC-9758-EAD334B848C7@sjtu.edu.cn> References: <73f827b50806241919p736086dcoa54049d55ecbc5d@mail.gmail.com> <0101EF7F-9DEB-43BC-9758-EAD334B848C7@sjtu.edu.cn> Message-ID: <1322709755163-4126615.post@n4.nabble.com> What if you have over 50 matrices and you don't want to write them all out one-by-one? I know there's something really quite simple, but I haven't found it yet!... -- View this message in context: http://r.789695.n4.nabble.com/Average-of-Two-Matrices-tp860672p4126615.html Sent from the R help mailing list archive at Nabble.com. From xdchen at hutc.zj.cn Thu Dec 1 06:37:08 2011 From: xdchen at hutc.zj.cn (chenandfuok) Date: Wed, 30 Nov 2011 21:37:08 -0800 (PST) Subject: [R] error in ZIGP package and optim Message-ID: <1322717828592-4127053.post@n4.nabble.com> Dear all: I am trying to use the response.zigp and est.zigp from the ZIGP package. Firstly, I generated a simple data via response.zigp and then I try to fit them by est.zigp function, this is the code: --------------------------------- > library(ZIGP) > #try-ZIGP-1 > n<-100 > X<-matrix(c(rep(1,n),runif(n*2,0,1)),n,3) > W<-matrix(c(rep(1,n),rbinom(n,1,0.5)),n,2) > Z<-matrix(c(rep(1,n),rbinom(n,1,0.5)),n,2) > beta<-c(1,-2,1) > alpha<-c(1,1.5) > gamma<-c(-1,2) > y<-response.zigp(X,W,Z,beta,alpha,gamma) > x1<-as.vector(X[,1]) > x2<-as.vector(X[,2]) > x3<-as.vector(X[,3]) > w1<-as.vector(W[,1]) > w2<-as.vector(W[,2]) > z1<-as.vector(Z[,1]) > z2<-as.vector(Z[,2]) > fm.X<-~x1+x2+x3 > fm.W<-~1 > fm.Z<-~z1+z2 > est.zigp(y,fm.X,fm.W,fm.Z,Offset=rep(1,length(y)),init=FALSE) ----------------------------- Then I get the *error:* ---------------------------- Error in optim(par = start.delta, fn = loglikelihood.zigp, gr = gradient, : initial value in 'vmmin' is not finite -------------------------------- Any help you can give me would be greatly appreciated. -- View this message in context: http://r.789695.n4.nabble.com/error-in-ZIGP-package-and-optim-tp4127053p4127053.html Sent from the R help mailing list archive at Nabble.com. From oana.tomescu at student.tugraz.at Thu Dec 1 08:24:23 2011 From: oana.tomescu at student.tugraz.at (Oana Tomescu) Date: Thu, 1 Dec 2011 08:24:23 +0100 Subject: [R] Generalized singular value decomposition In-Reply-To: <1322666007362-4123335.post@n4.nabble.com> References: <4ED61F0A.3060904@knmi.nl> <1322666007362-4123335.post@n4.nabble.com> Message-ID: Am 30.11.2011 16:13, schrieb Berend Hasselman: > > tom wrote > > I don't think you have to install "something". > You have not told us how you are trying to load the dll's. > > You can use the GSVD function from > http://r.789695.n4.nabble.com/problem-with-generalized-singular-value-decomposition-using-LAPACK-td834930.html > but you will need the exact path to the Lapack dll in the dyn.load call. > Something like dyn.load("C:\\R\\.....\\libRlapack.dll"). This was just what I was looking for, thank you very much! When I read the post before I did not notice the line with the dyn.load. > You do not need to dyn.load the Blas dll. > > I have tried this GSVD function with Mac OS X with success. I tried the GSVD with the folowing matrices: A = matrix(rnorm(100,100,20),10,10) B = matrix(rnorm(200,10,3),20,10) res = GSVD(A,B) The resulted U and V have all entries equal to zero. This seems a little wired since A=U*E1*Q' and B=V*E2*Q'. If U and V are zero then A and B should also be zero. Are my example matrices a special case for the decomposition? I just started working with it, so I am a completely newbie ... Thank you again very much for your help! (I was already thinking about doing the decomposition with Matlab and loading the result into R.) Regards, Oana > > Berend > > > -- > View this message in context: http://r.789695.n4.nabble.com/Generalized-singular-value-decomposition-tp4122542p4123335.html > Sent from the R help mailing list archive at Nabble.com. > From jwiley.psych at gmail.com Thu Dec 1 08:25:32 2011 From: jwiley.psych at gmail.com (Joshua Wiley) Date: Wed, 30 Nov 2011 23:25:32 -0800 Subject: [R] Average of Two Matrices In-Reply-To: <1322709755163-4126615.post@n4.nabble.com> References: <73f827b50806241919p736086dcoa54049d55ecbc5d@mail.gmail.com> <0101EF7F-9DEB-43BC-9758-EAD334B848C7@sjtu.edu.cn> <1322709755163-4126615.post@n4.nabble.com> Message-ID: Well, you're rather stuck writing them all out unless you have them in some other data structure. ## three dimensional array (50 4 x 4 matrices) x <- array(rnorm(16 * 50), dim = c(4, 4, 50)) > apply(x, 1:2, mean) [,1] [,2] [,3] [,4] [1,] -0.09460574 0.01572077 -0.166194625 -0.28176540 [2,] -0.26649044 -0.23546332 -0.003559647 -0.09857819 [3,] 0.12657883 0.10979631 0.368414189 -0.13653997 [4,] -0.02827496 0.07634844 -0.088057890 0.06208034 ## list of length 50 each element is 4 x 4 matrix > y <- rep(list(matrix(rnorm(16), 4, 4)), 50) > length(y) [1] 50 > Reduce(`+`, y)/length(y) [,1] [,2] [,3] [,4] [1,] -1.8334660 0.67812999 0.20159314 1.6163501 [2,] -0.6716821 -0.23942474 -0.50482638 -0.5765309 [3,] 0.7991496 0.38674047 -0.02128386 -1.1868209 [4,] -1.1654429 0.06773386 0.13538268 0.3847375 See ?array ?apply ?Reduce for documentation Hope this helps, Josh On Wed, Nov 30, 2011 at 7:22 PM, T.D. Rudolph wrote: > > What if you have over 50 matrices and you don't want to write them all out > one-by-one? ?I know there's something really quite simple, but I haven't > found it yet!... > > -- > View this message in context: http://r.789695.n4.nabble.com/Average-of-Two-Matrices-tp860672p4126615.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/ From ripley at stats.ox.ac.uk Thu Dec 1 08:42:07 2011 From: ripley at stats.ox.ac.uk (Prof Brian Ripley) Date: Thu, 1 Dec 2011 07:42:07 +0000 (GMT) Subject: [R] RTisean executable problem in STLperArea In-Reply-To: <1322692437699-4125382.post@n4.nabble.com> References: <1322692437699-4125382.post@n4.nabble.com> Message-ID: It is one of the rather confusing things about the RTisean package. It does not say what your subject says: it says 'TISEAN executables'. The DESCRIPTION *should* have a SystemRequirements line (and this has been reported), It does say It requires that you have the Tisean-3.0.1 algorithms available on your computer. (It means the Tisean-3.0.1 binary programs ....) Have you? If so, that is what you should be seting setTISEANpath to point to. On Wed, 30 Nov 2011, lglew wrote: > Hi, > > I?m trying to use the STLperArea function in the ndvits package. I can run > the sample data (?SLPSAs_full?) without any problem. However, when I come to > run the function on my own data, I get the following message. > > Waiting to confirm page change... > Error in .checkPath(path) : no TISEAN executables found in that directory. > Please set a proper TISEAN executables path using 'setTISEANpath' > > I?ve tried setting the TISEANpath to the directory where the RTisean library > is on my computer. > > Could someone please suggest what the problem might be? > > Many thanks, > > Louise > > -- > View this message in context: http://r.789695.n4.nabble.com/RTisean-executable-problem-in-STLperArea-tp4125382p4125382.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 From crosspide at hotmail.com Thu Dec 1 08:54:09 2011 From: crosspide at hotmail.com (agent dunham) Date: Wed, 30 Nov 2011 23:54:09 -0800 (PST) Subject: [R] Replace columns in a data.frame randomly splitted In-Reply-To: References: <1322658929391-4122926.post@n4.nabble.com> Message-ID: <1322726049879-4127405.post@n4.nabble.com> The thing is that I've already been working with df1, and I was looking for a function that could replace values knowing rows and columns. Does it exist? Thank you, user at host.com -- View this message in context: http://r.789695.n4.nabble.com/Replace-columns-in-a-data-frame-randomly-splitted-tp4122926p4127405.html Sent from the R help mailing list archive at Nabble.com. From ligges at statistik.tu-dortmund.de Thu Dec 1 10:29:15 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Thu, 01 Dec 2011 10:29:15 +0100 Subject: [R] Error adding Bigmemory package In-Reply-To: <1322686407008-4124863.post@n4.nabble.com> References: <1322686407008-4124863.post@n4.nabble.com> Message-ID: <4ED748EB.6080006@statistik.tu-dortmund.de> On 30.11.2011 21:53, RogerP wrote: > I am trying to add the bigmemory packages but I get the following error > message: > > In file included from bigmemory.cpp:14:0: > ../inst/include/bigmemory/isna.hpp: In function 'bool neginf(double)': > ../inst/include/bigmemory/isna.hpp:22:57: error: 'isinf' was not declared in > this scope > make: *** [bigmemory.o] Error 1 > ERROR: compilation failed for package 'bigmemory' > * removing '/usr/local/lib/R/library/bigmemory' > * restoring previous '/usr/local/lib/R/library/bigmemory' > > The downloaded packages are in > '/tmp/RtmpNrkt2a/downloaded_packages' > Updating HTML index of packages in '.Library' > Warning message: > In install.packages("bigmemory") : > installation of package 'bigmemory' had non-zero exit status >> install.packages(gsl) > Error in install.packages(gsl) : object 'gsl' not found >> install.packages(gnulib) > Error in install.packages(gnulib) : object 'gnulib' not found > > > I am using the GNU compiler version 4.5.1 from blastwave on a Solaris 10 > box. > I can't seem to find how to compile bigmembory successfully. I can complile > and add > other packages. See http://cran.r-project.org/web/checks/check_results_bigmemory.html and find it also fails the Solaris based CRAN checks. Hence please report to the package maintainer directly, since reports from CRAN maintainers and the CRAN results are obviously ignored. Best, Uwe Ligges > > roger > > -- > View this message in context: http://r.789695.n4.nabble.com/Error-adding-Bigmemory-package-tp4124863p4124863.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From ravi.kulk at gmail.com Thu Dec 1 10:10:18 2011 From: ravi.kulk at gmail.com (Ravi Kulkarni) Date: Thu, 1 Dec 2011 01:10:18 -0800 (PST) Subject: [R] References for book "R In Action" by Kabacoff Message-ID: <1322730618592-4127625.post@n4.nabble.com> I know this is not really an R question - it is a query about a recent book on R ("R In Action") by Robert Kabacoff, (Manning Publications 2011). There are many references to interesting topics in R in the book, BUT, I do not find a bibliography/list of references in the book! Does anybody know if there are errata for the book available some place? Thanks, Ravi -- View this message in context: http://r.789695.n4.nabble.com/References-for-book-R-In-Action-by-Kabacoff-tp4127625p4127625.html Sent from the R help mailing list archive at Nabble.com. From ligges at statistik.tu-dortmund.de Thu Dec 1 10:48:45 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Thu, 01 Dec 2011 10:48:45 +0100 Subject: [R] References for book "R In Action" by Kabacoff In-Reply-To: <1322730618592-4127625.post@n4.nabble.com> References: <1322730618592-4127625.post@n4.nabble.com> Message-ID: <4ED74D7D.2050205@statistik.tu-dortmund.de> On 01.12.2011 10:10, Ravi Kulkarni wrote: > I know this is not really an R question - it is a query about a recent book > on R ("R In Action") by Robert Kabacoff, (Manning Publications 2011). > There are many references to interesting topics in R in the book, BUT, I do > not find a bibliography/list of references in the book! > Does anybody know if there are errata for the book available some place? I'd ask the author! Uwe Ligges > Thanks, > Ravi > > -- > View this message in context: http://r.789695.n4.nabble.com/References-for-book-R-In-Action-by-Kabacoff-tp4127625p4127625.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From petr.pikal at precheza.cz Thu Dec 1 10:48:55 2011 From: petr.pikal at precheza.cz (Petr PIKAL) Date: Thu, 1 Dec 2011 10:48:55 +0100 Subject: [R] Odp: R code In-Reply-To: References: Message-ID: Hi > > Hi everybody, > > I am unable to resolve this error using the following for loop. Would > appreciate help. The same loop works with for(i in 1:92) strangely. I > checked the .raw input file and everything is kosher, even Line 547 > mentioned in the error message. > > I wonder if there is any problem with the paste function. I do not believe it. In that case the message will be, that R can not open the file. You speak about input file but actually you are reading 93 files. Which one is wrong? Did you check that one? And how did you checked it? There could be some unseen characters in this row. Without some more info I doubt you get any better advice. Petr > > Thanks very much in advance. > > > ********************** > for(i in 1:93) > { > inputdta<- read.table(file=gsub(" ","",paste("JSR_network_[",i,"].RAW"), > fixed=TRUE), header=TRUE) > colnames(inputdta) <- c("jsrid","firmid","jsrstart","injsr") > print(nrow(inputdta)) > } > > *************** > Message: Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, > na.strings, : line 547 did not have 4 elements > > > -- > View this message in context: http://r.789695.n4.nabble.com/R-code- > tp4125904p4125904.html > Sent from the R help mailing list archive at Nabble.com. > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Thu Dec 1 10:54:05 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Thu, 01 Dec 2011 10:54:05 +0100 Subject: [R] how "big" (in RAM and/or disk storage) is each of these objects in a list? In-Reply-To: <20111126113623.63d9a77c@draco> References: <20111126113623.63d9a77c@draco> Message-ID: <4ED74EBD.1010109@statistik.tu-dortmund.de> On 26.11.2011 20:36, John wrote: > On Sat, 26 Nov 2011 12:41:08 -0600 > Paul Johnson wrote: > >> Greetings, friends (and others :) ) >> >> We generated a bunch of results and saved them in an RData file. We >> can open, use, all is well, except that the size of the saved file is >> quite a bit larger than we expected. I suspect there's something >> floating about in there that one of the packages we are using puts in, >> such as a spare copy of a data frame that is saved in some subtle way >> that has escaped my attention. >> >> Consider a list of objects. Are there ways to do these things: >> >> 1. ask R how much memory is used by the things inside the list? A bit late, but hopefully still helpful: See ?object.size and particularly note Associated space (e.g. the environment of a function and what the pointer in a ?EXTPTRSXP? points to) is not included in the calculation. >> 2. Does "as.expression(anObject)" print everything in there? Or, is >> there a better way to convert each thing to text or some other format >> that you can actually read line by line to see what is in there, to >> "see" everything? See ?dump and also carefully read the notes. >> >> If there's no giant hidden data frame floating about, I figure I'll >> have to convert symmetric matrices to lower triangles or such to save >> space. Unless R already is automatically saving a matrix in that way >> but just showing me the full matrix, which I suppose is possible. If >> you have other ideas about general ways to make saved objects smaller, >> I'm open for suggestions. Look carefully for environments attached to one or more of the objects. Best, Uwe Ligges >> > > As an initial step, what is the result of running ls() with your RData > file loaded? You should get a list of what is in memory. Using RData > files can be as space-efficient or costly as the user's habits. Did you > use save() or the save.image() command to produce the file? The > save.image() command stashes what is in memory and if you've run a > number of experimental procedures that did not pan out and you did not > discard with the results with rm(), they were saved to the rdata file > along with the information you did want, a procedure rather like filing > away all your work in a file drawer and then emptying the waste basket > into the drawer as well. If you save the data with ascii = TRUE as an > option, you can troll through the file and read what you saved. > > JWD > > ______________________________________________ > R-help at 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 code. From jholtman at gmail.com Thu Dec 1 11:01:48 2011 From: jholtman at gmail.com (Jim Holtman) Date: Thu, 1 Dec 2011 05:01:48 -0500 Subject: [R] R code In-Reply-To: References: Message-ID: <631A98B7-2288-4548-AD21-4B3979F9BCAF@gmail.com> the problem might be a missing quote. Try quote = '' Or it might be a comment character, so try comment.char = '' This happens a lot if your data is not clean Sent from my iPad On Nov 30, 2011, at 19:48, nsaraf wrote: > ) From ashimkapoor at gmail.com Thu Dec 1 11:22:42 2011 From: ashimkapoor at gmail.com (Ashim Kapoor) Date: Thu, 1 Dec 2011 15:52:42 +0530 Subject: [R] Drawing ticks in the 3rd and 4th row of a lattice In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nalimilan at club.fr Thu Dec 1 12:08:01 2011 From: nalimilan at club.fr (Milan Bouchet-Valat) Date: Thu, 01 Dec 2011 12:08:01 +0100 Subject: [R] "Non-finite finite-difference value" error in eha's aftreg In-Reply-To: References: <1321452360.13624.2.camel@milan> Message-ID: <1322737682.7835.17.camel@milan> Le mercredi 30 novembre 2011 ? 18:41 +0100, G?ran Brostr?m a ?crit : > On Wed, Nov 16, 2011 at 3:06 PM, Milan Bouchet-Valat > wrote: > Hi list! > > > I'm getting an error message when trying to fit an accelerated > failure > time parametric model using the aftreg() function from package > eha: > > Error in optim(beta, Fmin, method = "BFGS", control = > list(trace = > > as.integer(printlevel)), : > > non-finite finite-difference value [2] > > This only happens when adding four specific covariates at the > same time > in the model (see below). I understand that kind of problem > can come > from a too high correlations between my covariates, but is > there > anything I can do to avoid it? > > Yes, remove one (or more) covariate(s). The design matrix is almost > certainly singular. Ah, thanks, that's what I feared. ;-) What do you mean, though, by "almost"? Is there a way to measure that? > Does something need to be improved in aftreg.fit? > > Yes, error messages. I'll look at it. Cool. It's always good to get a clear message saying that you're asking for something impossible, so that you don't try to fix it (like I did). Regards > My data set is constituted of 34,505 observations (years) of 2,717 > individuals, which seems reasonable to me to fit a complex model like > that (covariates are all factors with less than 10 levels). > I can send > it by private mail if somebody wants to help debugging this. > > The details of the model and errors follow, but feel free to ask for > more testing. I'm using R 2.13.1 (x86_64-redhat-linux-gnu), eha 2.0-5 > and survival 2.36-9. > > > Thanks for your help! > > > > m <-aftreg(Surv(start, end, event) ~ homo1 + sexego + dipref1 > + + t.since.school.q, > + data=ms, dist="loglogistic", id=ident) > Error in optim(beta, Fmin, method = "BFGS", control = list(trace = > as.integer(printlevel)), : > non-finite finite-difference value [2] > Calls: aftreg -> aftreg.fit -> aftp0 -> optim > > > traceback() > 4: optim(beta, Fmin, method = "BFGS", control = list(trace = > as.integer(printlevel)), > hessian = TRUE) > 3: aftp0(printlevel, ns, nn, id, strata, Y, X, offset, dis, means) > 2: aftreg.fit(X, Y, dist, strats, offset, init, shape, id, control, > center) > 1: aftreg(Surv(start, end, event) ~ homo1 + sexego + dipref1 + > t.since.school.q, data = ms, dist = "loglogistic", id = ident) > > ______________________________________________ > R-help at 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 code. > > > > -- > G?ran Brostr?m > From hwborchers at googlemail.com Thu Dec 1 12:13:49 2011 From: hwborchers at googlemail.com (Hans W Borchers) Date: Thu, 1 Dec 2011 12:13:49 +0100 Subject: [R] x, y for point of intersection In-Reply-To: References: Message-ID: Monica has sent me some data and code for taking a quick look. As it turned out, there was a simple programming error on her side. The segm_distance() function in package 'pracma' is working correctly. And there is no minimization procedure in here, it simply solves some equations from plane geometry. Maybe the function suggested by Don is faster, I haven't checked that. Regards, Hans Werner 2011/11/29 Monica Pisica > > Hi again, > > Working with my real data and not with the little example i sent to the list i discovered that segm_distance function from package "pracma" does not converge to 0 in all cases, even if i increase the number of iteration to 10,000 for example. It seems that it depends on the "initialization" point - most like a minimization function. > > So my thanks? go to Don who's suggestion works for the real data as well without any problems - so far ;-) He suggested to use the function crossing.psp from package "spatstat". > > Thanks again to all who have answered and helped to solve my problem. I certainly learned few new things. > > Monica > > > > > > > From: macqueen1 at llnl.gov > > To: pisicandru at hotmail.com > > CC: r-help at r-project.org > > Date: Wed, 23 Nov 2011 14:03:42 -0800 > > > Subject: Re: [R] x, y for point of intersection > > > > The function crossing.psp() in the spatstat package might be of use. > > Here's an excerpt from its help page: > > > > crossing.psp package:spatstat R Documentation > > Crossing Points of Two Line Segment PatternsDescription: > > Finds any crossing points between two line segment patterns. > > Usage: > > crossing.psp(A,B) > > -Don > > > > > > -- > > Don MacQueen > > > > Lawrence Livermore National Laboratory > > 7000 East Ave., L-627 > > Livermore, CA 94550 > > 925-423-1062 > > > From yvonnick.noel at uhb.fr Thu Dec 1 12:37:30 2011 From: yvonnick.noel at uhb.fr (Yvonnick Noel) Date: Thu, 01 Dec 2011 12:37:30 +0100 Subject: [R] SPSS -> R In-Reply-To: References: Message-ID: <4ED766FA.2000807@uhb.fr> Dear Kristi, > Also. can anyone recommend any resources to help SPSS users learn to things in R? You may want to have a look at the R2STATS package, a simple GUI for linear models. Best, Yvonnick Noel University of Brittany Department of Psychology Rennes, France From jjcabrera20 at yahoo.com.mx Thu Dec 1 11:02:47 2011 From: jjcabrera20 at yahoo.com.mx (jjcabrera20) Date: Thu, 1 Dec 2011 02:02:47 -0800 (PST) Subject: [R] Raster manipulation in R Message-ID: <1322733767614-4127768.post@n4.nabble.com> Hello everyone in the forum For introducing myself I would say I have a basic knowledge of R. Now I am intended to implement a flood algorithm using R. I have some MatLab experience doing these, and as an example to explain more or less what I want, I have a m code to calculate the slope from a Digital elevation model: slope=zeros(row,col); for i=2:row-1 for j=2:col-1 dzdx=(raster(i,j+1)-raster(i,j-1))/(2*res); dzdy=(raster(i+1,j)-raster(i-1,j))/(2*res); slope(i,j)=sqrt(dzdx^2+dzdy^2); end end; The question is to know how to do the similar procedure on R. All suggestions are welcome Thanks All best, Jorge PD:I am using R on windows system 64 bits -- View this message in context: http://r.789695.n4.nabble.com/Raster-manipulation-in-R-tp4127768p4127768.html Sent from the R help mailing list archive at Nabble.com. From benzerfa at gmx.ch Thu Dec 1 10:57:20 2011 From: benzerfa at gmx.ch (Samir Benzerfa) Date: Thu, 1 Dec 2011 10:57:20 +0100 Subject: [R] combining arima and ar function Message-ID: <000601ccb00f$9e403db0$dac0b910$@ch> Hi everyone I've got a problem regarding the arima() and the ar() function for autoregressive series. I would simply like to combine them. To better understand my question, I first show you how I'm using these two functions individually (see file in the attachement). 1) apply(TSX,2, function(x) ar(na.omit(x),method="mle")$order # this function finds the optimal (autoregressive) order for each series (briefly speaking: for each series I get a specific number) 2) apply(TSX,2,function(x)arima(x,order=c(1,0,0))$residuals # this function puts an autoregressive model of order 1 on each series What I'd like to do, is to combine them, such that the resulting orders (numbers) from the first function are used as orders in the second function. So in the specific example attached the results from the first function are 6,5,1 and these numbers should be used as the order in function two. I tried to simply put the two functions together as follows: apply(TSX,2,function(x) arima(x,order=c((apply(TSX,2, function(x)ar(na.omit(x),method="mle")$order))),0,0)) However, I get the error message " 'order' must be a non-negative numeric vector of length 3". Any hints? I hope you can help me with this issue. Many thanks and best regards, S.B. From wendy2.qiao at gmail.com Thu Dec 1 11:27:09 2011 From: wendy2.qiao at gmail.com (Wendy) Date: Thu, 1 Dec 2011 02:27:09 -0800 (PST) Subject: [R] permutate elements in a vector Message-ID: <1322735229427-4127821.post@n4.nabble.com> Hi all, I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 different combination. I want to generate a matrix with one combination in one row, so the output would be B = 10 20 30 40 10 40 20 30 ... Does anyone know how to do this easily in R? Thank you very much. Wendy -- View this message in context: http://r.789695.n4.nabble.com/permutate-elements-in-a-vector-tp4127821p4127821.html Sent from the R help mailing list archive at Nabble.com. From heather.wright at maine.edu Thu Dec 1 11:46:16 2011 From: heather.wright at maine.edu (hwright) Date: Thu, 1 Dec 2011 02:46:16 -0800 (PST) Subject: [R] R endnote entry In-Reply-To: References: Message-ID: <1322736376118-4127866.post@n4.nabble.com> 1. May I suggest that you try Mendeley for bibliographic management 2. There are also citations for specific R packages when you download each version. Let's use the ade4 package as an example: http://cran.r-project.org/web/packages/ade4/index.html if you selection citation info the corresponding bibtex input has been provided. @Article{, title = {The ade4 package: implementing the duality diagram for ecologists}, author = {S. Dray and A.B. Dufour}, journal = {Journal of Statistical Software}, year = {2007}, volume = {22}, pages = {1-20}, number = {4}, } This is a reliable way to deal with references in other programs ie: LaTeX...etc. I save all my references as bibtex into mendeley and then have a subfolders for R analysis/methods that contain the package citations. Using a .txt (bibtex file made from the ade4 package citation), my inserted citation in a word document from Mendeley looks like this: (R Development Core Team, 2011) and the formal reference in the bibliography is: R Development Core Team. 2011. R: A Language and Environment for Statistical Computing. If however, you are still determined to use endnote, then you have 2 ways to configure your reference, manually add a reference by copy/paste the correct title from the citation, etc. Then configure your .ens style for the appropriate journal, etc. If you insert the citation and it becomes R.D.C.T then it's likely the original input is fine and you have to configure your style output. good luck! ----- ------------------------------- Heather A. Wright, PhD candidate Ecology and Evolution of Plankton Stazione Zoologica Anton Dohrn Villa Comunale 80121 - Napoli, Italy -- View this message in context: http://r.789695.n4.nabble.com/R-endnote-entry-tp4126826p4127866.html Sent from the R help mailing list archive at Nabble.com. From elebrija at hotmail.com Thu Dec 1 12:15:41 2011 From: elebrija at hotmail.com (Edwin) Date: Thu, 1 Dec 2011 03:15:41 -0800 (PST) Subject: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's? In-Reply-To: <1322603094.2726.27.camel@chrysothemis.geog.ucl.ac.uk> References: <1322603094.2726.27.camel@chrysothemis.geog.ucl.ac.uk> Message-ID: <1322738141376-4127949.post@n4.nabble.com> Dear Gavin, Thanks a lot for your reply. I am still not sure if your suggestion can help me or not because I have got different types of errors while trying it. I have tried my best to troubleshoot them and made some progress, but I have reached a dead end (I don?t know how to go on). Below I am copping my TinnR script. It contains not only the R script but also the errors returned in the R console. I apologize that the script is still not really reproducible but I just do not know how to create a sample data frame for it. Thanks again for your help. Edwin. ##Load required packages## library(vegan) library(MASS) library (FD) library(dummies) ##Load full table of species traits and taxonomic data## AllTraits<-read.delim("SpeciesTraitsFullTbl.txt",header=T) ##Edit data## row.names(AllTraits)<-AllTraits$species.code TraitsNMDS<-AllTraits[,c(8:12,14:18,23,25,30)] ##Check variable class using function "allClass" from http://gettinggeneticsdone.blogspot.com/2010 /08/quickly-find-class-of-dataframe-vectors.html## allClass <- function(x) {unlist(lapply(unclass(x),class))} allClass(TraitsNMDS) ##Change variables to fulfill requirements for gowdis() function## #Define ordinal variables# TraitsNMDS$leaf.type<-ordered(TraitsNMDS$leaf.type, levels = c("simple", "pinnate", "bipinnate")) TraitsNMDS$dispersal.rank<-ordered(TraitsNMDS$dispersal.rank, levels = c("s_disp","m_disp","l_disp")) # 0, wascores) && any(comm < 0)) { : missing value where TRUE/FALSE needed'## #Set autotransform, noshare and wascores to FALSE (even if TRUE is desired) to see if problems is with metaMDS function# WrapTest2<-metaMDS(TraitsNMDS, distfun = wrapper, x=TraitsNMDS, asym.bin = "heterospory", ord= "podani", autotransform =FALSE, noshare = FALSE, wascores = FALSE) #Returned error: 'Error in FUN(X[[1L]], ...) : only defined on a data frame with all numeric variables'# #transform factors to dummies and numeric# TraitsNMDSCompleteDumm<-dummy.data.frame(TraitsNMDSComplete, c("leaf.type","dispersal.rank")) TraitsNMDSCompleteDumm$leaf.typesimple<-as.numeric(TraitsNMDSCompleteDumm$leaf.typesimple) TraitsNMDSCompleteDumm$leaf.typepinnate<-as.numeric(TraitsNMDSCompleteDumm$leaf.typepinnate) TraitsNMDSCompleteDumm$leaf.typebipinnate<-as.numeric(TraitsNMDSCompleteDumm$leaf.typebipinnate) TraitsNMDSCompleteDumm$dispersal.ranks_disp<-as.numeric(TraitsNMDSCompleteDumm$dispersal.ranks_disp) TraitsNMDSCompleteDumm$dispersal.rankm_disp<-as.numeric(TraitsNMDSCompleteDumm$dispersal.rankm_disp) TraitsNMDSCompleteDumm$dispersal.rankl_disp<-as.numeric(TraitsNMDSCompleteDumm$dispersal.rankl_disp) ##Re-test wrapping function## WrapTest3<-metaMDS(TraitsNMDSCompleteDumm, distfun = wrapper, x=TraitsNMDSCompleteDumm,asym.bin = "heterospory", ord = "podani") #The function runs but returns an error related to the gowdis() function after the transformation of the data is done: #'Square root transformation Wisconsin double standardization. Error in gowdis(x, ...) : w needs to be a numeric vector of length = number of variables in x' # But testing the wrapper alone does work!# DistMatrixWrapper<-wrapper(x=TraitsNMDSCompleteDumm,asym.bin = "heterospory", ord = "podani") class(DistMatrixWrapper) [1] "dist" # I do not know why the error is produced -- View this message in context: http://r.789695.n4.nabble.com/I-cannot-get-species-scores-to-plot-with-site-scores-in-MDS-when-I-use-a-distance-matrix-as-input-Pr-tp4103699p4127949.html Sent from the R help mailing list archive at Nabble.com. From miseno77 at hotmail.com Thu Dec 1 12:34:25 2011 From: miseno77 at hotmail.com (lincoln) Date: Thu, 1 Dec 2011 03:34:25 -0800 (PST) Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis Message-ID: <1322739265192-4127990.post@n4.nabble.com> ...is it possible to do that? I apologize for something that must be a very trivial question for most of you but, unfortunately, it is not for me. A binary variable is measured, say, 50 times each year during 10 year. My interest is focused on the percentage of 1s with respect to the total if each year. There is no way to repeat those measure within each year and getting the CIs by the "normal way". By the way, it would be important to get even a rough estimate of the CIs of these estimates (/n/1//n/1+/n/0). In case this is not a blasphemy, how might be done in R? Thanks in advance for any help -- View this message in context: http://r.789695.n4.nabble.com/Resampling-with-replacement-on-a-binary-0-1-dataset-to-get-Cis-tp4127990p4127990.html Sent from the R help mailing list archive at Nabble.com. From matteo.richiardi at unito.it Thu Dec 1 12:34:49 2011 From: matteo.richiardi at unito.it (Matteo Richiardi) Date: Thu, 1 Dec 2011 12:34:49 +0100 Subject: [R] efficient ways to dynamically grow a dataframe Message-ID: Hi, I'm trying to write a small microsimulation in R: that is, I have a dataframe with info on N individuals for the base-year and I have to grow it dynamically for T periods: df = data.frame( id = 1:N, x =.... ) The most straightforward way to solve the problem that came to my mind is to create for every period a new dataframe: for(t in 1:T){ for(i in 1:N){ row = data.frame( id = i, t = t, x = ... ) df = rbind(df,row) } } This is very inefficient and my pc gets immediately stucked as N is raised above some thousands. As an alternative, I created an empty dataframe for all the projected periods, and then filled it: df1 = data.frame( id = rep(1:N,T), t = rep(1:T, each = N), x = rep(NA,N*T) ) for(t in 1:T){ for(i in 1:N){ x = ... df1[df1$id==i & df1$t==t,"x"] = x } } df = rbind(df,df1) This is also too slow, and my PC gets stucked. I don't want to go for a matrix, because I'd loose the column names and everything will become too much error-prone. Any suggestions on how to do it? Thanks in advance, Matteo -- Matteo Richiardi University of Turin Faculty of Law Department of Economics "Cognetti De Martiis" via Po 53, 10124 Torino Email: matteo.richiardi at unito.it Tel. +39 011 670 3870 Web page: http://www.personalweb.unito.it/matteo.richiardi/ From void1999 at gmail.com Thu Dec 1 12:51:27 2011 From: void1999 at gmail.com (zz dd) Date: Thu, 1 Dec 2011 12:51:27 +0100 Subject: [R] nipals in the chemometrics package in R Message-ID: Hello i need some precision about nipals in the chemometrics package in R . When i use nipals in chemometrics i obtain T and P matrix. I really don't understand what to do with these two matrix to obtain the scores for every the component (like in spss fo example) Comp1 Comp2 Comp3 quest1 0,8434 0,54333 0,3466 quest2 0,665 0,7655 0,433 Thank you very much for your help (I know that X=TP+E)... But don't understand else.... From jonasjae at pik-potsdam.de Thu Dec 1 13:14:32 2011 From: jonasjae at pik-potsdam.de (=?ISO-8859-1?Q?Jonas_J=E4germeyr?=) Date: Thu, 01 Dec 2011 13:14:32 +0100 Subject: [R] How to speed up int2bin conversion? Message-ID: <4ED76FA8.7030007@pik-potsdam.de> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Thu Dec 1 13:18:15 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 07:18:15 -0500 Subject: [R] Bayesian Quantile regression installation In-Reply-To: References: <1322568957812-4118947.post@n4.nabble.com> Message-ID: Please send your questions to the R-help list, and not directly to me. You provide your OS this time, but not any of the other information requested in the posting guide, like your version of R. What you did would be nice too. Used the menu option? Or used install.packages() at the command line? If this is an internet-enabled computer, the latter is by far the easiest option: it will download and install the package for you. On Thu, Dec 1, 2011 at 6:34 AM, kalam narendar reddy wrote: > Dear?Sarah Goslee, > The following?i sthe error if i tried to?use the install packages from > local?zip files ven though i have loacated the?bayesQR_1.3 which is > ?winRAR zip archieve? fie. > ?Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) > : > ? cannot open the connection > In addition: Warning message: > In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : > ? cannot open compressed file 'bayesQR_1.3(1)/DESCRIPTION', probable reason > 'No such file or directory' The filename shown here is not the one that's in the CRAN archive - did you try to download it more than once? That may confuse Windows, I don't know. I don't use Windows (another reason you shouldn't be emailing me directly). But try renaming it without the (1) and see if that works. > tell me what is the reason for it. i have tried to install the package from > local zip file(binary version for windows of bayesian quantile regression > ).my os is windows7 and i have followed the procedure as it is told in the > manual for windows for package installation.still i am unanle to install.pls > understand my problem. > thanks in advance for your kind reply.pls reply as early as possible. > Sarah From jfox at mcmaster.ca Thu Dec 1 13:18:20 2011 From: jfox at mcmaster.ca (John Fox) Date: Thu, 1 Dec 2011 07:18:20 -0500 Subject: [R] FIML with missing data in sem package In-Reply-To: References: Message-ID: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> Dear Dustin, > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Dustin Fife > Sent: November-30-11 9:51 PM > To: r-help at r-project.org > Subject: [R] FIML with missing data in sem package > > Is there a way to use full information maximum likelihood (FIML) to > estimate missing data in the sem package? For example, suppose I have a > dataset with complete information on X1-X3, but missing data (MAR) on > X4. > Is there a way to use FIML in this case? I know lavaan and openmx allow No, the sem package doesn't handle missing data. You could, however, use another package, such as mice, for multiple imputation of the missing data. Best, John -------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox > you to do it, but I couldn't find anything in the documentation for the > sem package. Thanks! > > -- > Dustin Fife > Graduate Student > Quantitative Psychology > University of Oklahoma > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From jayemerson at gmail.com Thu Dec 1 13:45:36 2011 From: jayemerson at gmail.com (Jay Emerson) Date: Thu, 1 Dec 2011 07:45:36 -0500 Subject: [R] bigmemory on Solaris Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bhh at xs4all.nl Thu Dec 1 14:05:58 2011 From: bhh at xs4all.nl (Berend Hasselman) Date: Thu, 1 Dec 2011 05:05:58 -0800 (PST) Subject: [R] permutate elements in a vector In-Reply-To: <1322735229427-4127821.post@n4.nabble.com> References: <1322735229427-4127821.post@n4.nabble.com> Message-ID: <1322744758343-4128227.post@n4.nabble.com> Wendy wrote > > Hi all, > > I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 > different combination. I want to generate a matrix with one combination in > one row, so the output would be > > B = > 10 20 30 40 > 10 40 20 30 > ... > > Does anyone know how to do this easily in R? Thank you very much. > > Wendy > You want permutations not combinations. library(e1071) permutations(4) * 10 or library(gtools) A <- 10*(1:4) permutations(4,4,A) Berend -- View this message in context: http://r.789695.n4.nabble.com/permutate-elements-in-a-vector-tp4127821p4128227.html Sent from the R help mailing list archive at Nabble.com. From mayer at psychologie.tu-dresden.de Thu Dec 1 14:24:47 2011 From: mayer at psychologie.tu-dresden.de (=?iso-8859-1?b?UmVu6Q==?= Mayer) Date: Thu, 01 Dec 2011 14:24:47 +0100 Subject: [R] how to get inflection point in binomial glm Message-ID: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> Dear All, I have a binomial response with one continuous predictor (d) and one factor (g) (8 levels dummy-coded). glm(resp~d*g, data, family=binomial) Y=b0+b1*X1+b2*X2 ... b7*X7 how can I get the inflection point per group, e.g., P(d)=.5 I would be grateful for any help. Thanks in advance, Ren? From jvadams at usgs.gov Thu Dec 1 14:27:43 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Thu, 1 Dec 2011 07:27:43 -0600 Subject: [R] Raster manipulation in R In-Reply-To: <1322733767614-4127768.post@n4.nabble.com> References: <1322733767614-4127768.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Thu Dec 1 14:34:11 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 08:34:11 -0500 Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis In-Reply-To: <1322739265192-4127990.post@n4.nabble.com> References: <1322739265192-4127990.post@n4.nabble.com> Message-ID: <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> On Dec 1, 2011, at 6:34 AM, lincoln wrote: > ...is it possible to do that? > > I apologize for something that must be a very trivial question for > most of > you but, unfortunately, it is not for me. > A binary variable is measured, say, 50 times each year during 10 > year. My > interest is focused on the percentage of 1s with respect to the > total if > each year. > There is no way to repeat those measure within each year and getting > the CIs > by the "normal way". > By the way, it would be important to get even a rough estimate of > the CIs of > these estimates (/n/1//n/1+/n/0). > > In case this is not a blasphemy, how might be done in R? ?prop.test > > Thanks in advance for any help > David Winsemius, MD West Hartford, CT From ckluss at email.uni-kiel.de Thu Dec 1 14:34:14 2011 From: ckluss at email.uni-kiel.de (=?ISO-8859-1?Q?Christof_Klu=DF?=) Date: Thu, 1 Dec 2011 14:34:14 +0100 Subject: [R] simplify source code In-Reply-To: References: Message-ID: <4ED78256.2030801@email.uni-kiel.de> Hi now I'd like to do for (colname in c('ColName1','ColName2','ColName3')) { dat <- measurements$colname But that does not work, though I can write measurements$"C1" (same as measurements$C1) (but different to measurements["C1"]!) Can you give me a hint? greetings Christof Am 26-11-2011 23:30, schrieb Christof Klu?: > Hi > > I would like to shorten > > mod1 <- nls(ColName2 ~ ColName1, data = table, ...) > mod2 <- nls(ColName3 ~ ColName1, data = table, ...) > mod3 <- nls(ColName4 ~ ColName1, data = table, ...) > ... > > is there something like > > cols = c(ColName2,ColName3,ColName4,...) > > for i in ... > mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) > > I am looking forward to help > > Christof > From ckluss at email.uni-kiel.de Thu Dec 1 14:34:14 2011 From: ckluss at email.uni-kiel.de (=?ISO-8859-1?Q?Christof_Klu=DF?=) Date: Thu, 1 Dec 2011 14:34:14 +0100 Subject: [R] simplify source code In-Reply-To: References: Message-ID: <4ED78256.2030801@email.uni-kiel.de> Hi now I'd like to do for (colname in c('ColName1','ColName2','ColName3')) { dat <- measurements$colname But that does not work, though I can write measurements$"C1" (same as measurements$C1) (but different to measurements["C1"]!) Can you give me a hint? greetings Christof Am 26-11-2011 23:30, schrieb Christof Klu?: > Hi > > I would like to shorten > > mod1 <- nls(ColName2 ~ ColName1, data = table, ...) > mod2 <- nls(ColName3 ~ ColName1, data = table, ...) > mod3 <- nls(ColName4 ~ ColName1, data = table, ...) > ... > > is there something like > > cols = c(ColName2,ColName3,ColName4,...) > > for i in ... > mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) > > I am looking forward to help > > Christof > From jvadams at usgs.gov Thu Dec 1 14:36:39 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Thu, 1 Dec 2011 07:36:39 -0600 Subject: [R] permutate elements in a vector In-Reply-To: <1322735229427-4127821.post@n4.nabble.com> References: <1322735229427-4127821.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Thu Dec 1 14:46:39 2011 From: jholtman at gmail.com (jim holtman) Date: Thu, 1 Dec 2011 08:46:39 -0500 Subject: [R] How to speed up int2bin conversion? In-Reply-To: <4ED76FA8.7030007@pik-potsdam.de> References: <4ED76FA8.7030007@pik-potsdam.de> Message-ID: If we assume that you are just convert 8 bits, here is one way with a table lookup. If more than 8 bits, just partition the data and repeat. This sets up a mapping table one time for the lookup. Does 1M in 0.3 seconds on my computer; is this fast enough? > # initialize a matrix with 8 bit binary values > # one time > require(bitops) > b2c <- character(256) > for (i in 0:255){ + b2c[i + 1] <- sprintf("%1d%1d%1d%1d%1d%1d%1d%1d" + , bitAnd(i, 0x80) != 0 + , bitAnd(i, 0x40) != 0 + , bitAnd(i, 0x20) != 0 + , bitAnd(i, 0x10) != 0 + , bitAnd(i, 0x8) != 0 + , bitAnd(i, 0x4) != 0 + , bitAnd(i, 0x2) != 0 + , bitAnd(i, 0x1) != 0 + ) + } > > # create vector with 1M values > x <- as.integer(1:1e6) > > int2bin <- function(val) + { + b2c[bitAnd(val, 0xff) + 1] + } > > system.time(int2bin(x)) user system elapsed 0.31 0.00 0.32 On Thu, Dec 1, 2011 at 7:14 AM, Jonas J?germeyr wrote: > Dear R-help members, > > I'm processing a large amount of MODIS data where quality assessment > information is stored as an integer value for each pixel. I have to > converted this number to an 8 digit binary flag to get access to the > stored quality code (e.g. in2bin(165,8) = 1 0 1 0 0 1 0 1). > > Unfortunately, I did not manage to find a package providing a fast > function to do so. I need to run this on millions of pixels and thus > wrote the following function. > > int2bin <- function(x,ndigits){ > ? ? base <- array(NA, dim=c(length(x), ndigits)) > ? ? for(q in 1:ndigits){ > ? ? ? ? ? base[, ndigits-q+1] <- (x %% 2) > ? ? ? ? ? x <- (x %/% 2) > ? ? ? } > ? ? bin<- apply(base,1,paste,collapse="") > ? ? return(bin) > } > > Since it is still slow, I have to find a way to express this more > elegantly. I'd really appreciate any help. > > Thanking you, with best regards > > Jonas J?germeyr > > Potsdam Institute for Climate Impact Research > Research Domain II > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From piratamarck at gmail.com Thu Dec 1 14:48:22 2011 From: piratamarck at gmail.com (Marcos Amaris Gonzalez) Date: Thu, 1 Dec 2011 11:48:22 -0200 Subject: [R] Problem installing the package tkrplot In-Reply-To: <1A41EF30-6C24-466E-B46B-F5CBC3E6B94F@gmail.com> References: <1A41EF30-6C24-466E-B46B-F5CBC3E6B94F@gmail.com> Message-ID: Thanks Peter. I was knowing that R had not found the header tk.h file. But i did not where it was. I opened my Manage Packages Synaptic and installed tk-dev and other similar packages, and voila! It work. I coul install tkrplot and the other packages that i was needing. THANKS, for your answer, "This is part of your Linux distribution". On Wed, Nov 30, 2011 at 9:08 PM, peter dalgaard wrote: > > On Nov 30, 2011, at 15:31 , Marcos Amaris Gonzalez wrote: > >> Hello people. My problem is that when I try to install the package >> tkrplot, I got the next problem: > > You seem to be missing the tk.h file. This is, most likely, in a tcl/tk development package that you haven't installed. This is part of your Linux distribution, not R. (You're not telling us which Linux you are running, and it can't be pinpointed any further without that information, but look for something like tk-devel and tcl-devel.) > >> >>> install.packages("tkrplot") >> Installing package(s) into ?/home/marcos/R/i686-pc-linux-gnu-library/2.13? >> (as ?lib? is unspecified) >> probando la URL >> 'http://www.vps.fmvz.usp.br/CRAN/src/contrib/tkrplot_0.0-23.tar.gz' >> Content type 'application/x-gzip' length 39037 bytes (38 Kb) >> URL abierta >> ================================================== >> downloaded 38 Kb >> >> * installing *source* package ?tkrplot? ... >> configure: creating ./config.status >> config.status: creating src/Makevars >> ** libs >> gcc -I/usr/share/R/include -I/usr/include/tcl8.5 -I/usr/include/tcl8.5 >> ? ?-fpic ?-std=gnu99 -O3 -pipe ?-g -c tcltkimg.c -o tcltkimg.o >> tcltkimg.c:2:16: fatal error: tk.h: No existe el fichero o el directorio >> compilation terminated. >> make: *** [tcltkimg.o] Error 1 >> ERROR: compilation failed for package ?tkrplot? >> * removing ?/home/marcos/R/i686-pc-linux-gnu-library/2.13/tkrplot? >> Warning in install.packages : >> ?installation of package 'tkrplot' had non-zero exit status >> >> The downloaded packages are in >> ? ? ? ?/tmp/RtmpHRfZ1k/downloaded_packages? >> >> In this moment I have R version 2.13.2 (2011-09-30). I stayed >> thankfull for the any help. >> >> --- >> Marcos Amaris Gonzalez >> >> ______________________________________________ >> R-help at 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 code. > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk ?Priv: PDalgd at gmail.com > > > > > > > > > --- Marcos Amaris Gonzalez From rab45 at pitt.edu Thu Dec 1 14:50:35 2011 From: rab45 at pitt.edu (Rick Bilonick) Date: Thu, 01 Dec 2011 08:50:35 -0500 Subject: [R] FIML with missing data in sem package In-Reply-To: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> References: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> Message-ID: <4ED7862B.6050103@pitt.edu> On 12/01/2011 07:18 AM, John Fox wrote: > > To:r-help at r-project.org > > Subject: [R] FIML with missing data in sem package > > You should check out the OpenMx R package. Just search for OpenMx and SEM. You can download from the web site. It does FIML and is an excellent SEM package. Rick B . From jholtman at gmail.com Thu Dec 1 14:53:14 2011 From: jholtman at gmail.com (jim holtman) Date: Thu, 1 Dec 2011 08:53:14 -0500 Subject: [R] simplify source code In-Reply-To: <4ED78256.2030801@email.uni-kiel.de> References: <4ED78256.2030801@email.uni-kiel.de> Message-ID: measurements[[colname]] ?'[[' On Thu, Dec 1, 2011 at 8:34 AM, Christof Klu? wrote: > Hi > > now I'd like to do > > for (colname in c('ColName1','ColName2','ColName3')) { > ? ?dat <- measurements$colname > > But that does not work, though I can write > > measurements$"C1" (same as measurements$C1) > (but different to measurements["C1"]!) > > Can you give me a hint? > > greetings > Christof > > > > Am 26-11-2011 23:30, schrieb Christof Klu?: >> >> Hi >> >> I would like to shorten >> >> mod1 <- nls(ColName2 ~ ColName1, data = table, ...) >> mod2 <- nls(ColName3 ~ ColName1, data = table, ...) >> mod3 <- nls(ColName4 ~ ColName1, data = table, ...) >> ... >> >> is there something like >> >> cols = c(ColName2,ColName3,ColName4,...) >> >> for i in ... >> mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) >> >> I am looking forward to help >> >> Christof >> > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From narendarcse007 at gmail.com Thu Dec 1 14:12:16 2011 From: narendarcse007 at gmail.com (narendarreddy kalam) Date: Thu, 1 Dec 2011 05:12:16 -0800 (PST) Subject: [R] hi all.regarding quantile regression results.. Message-ID: <1322745136019-4128248.post@n4.nabble.com> i know this is not about R. After applying quantile regression with t=0.5,0.6 on the data set WBC( Wisconsin Breast Cancer)with 678 observations and 9 independent variables(inp1,inp2,...inp9) and 1 dependent variable(op) i have got the following results for beta values. when t=0.5(median regression) beta values b1=0.002641,b2=0.045746,b3=0. 005282,b4=0.004397,b5=0.002641,b6=0.065807,b7=0.005282 ,b8=0.031394,b9=0.004993 and intercept is -0.181388 and when t=0.6 beta values are b1=0,b2=0.01,b3=0,b4=-0.002,b5=0.004,b6=0.1111,b7=0.002,b8=0,b9=0 and intercept is -0.009 . sir,how to interpret the above beta coefficients and what do they mean exactly??. t=0.5 means are we considering first 50% of the total data? t=0.6 means are we considering the first 60% of the total data? can we write a equation like y=intercept+b1*inp11+b2*inp29+b3*inp3+b4*inp4+b5*inp5+b6*inp6+b7*inp7+b8*inp8+b9*inp9 as in Linear Regression to calculate the predicted output of y or not?? If we are taking into consideration 5 quantiles of data ,Does it mean that we are dividing data it into 5 parts??which variables i have to consider if the data is to be divided into 5 parts? And i got 5 equations for 5 quantiles, what exactly each equation represents? Can i write single equation for the data set as in mean regression by combining the 5 equations of each quantile. Please reply me. Thanks In advance, With regards Kalam Naerndar Reddy M.Tech(IT), University of Hyderabad. -- View this message in context: http://r.789695.n4.nabble.com/hi-all-regarding-quantile-regression-results-tp4128248p4128248.html Sent from the R help mailing list archive at Nabble.com. From tyler_rinker at hotmail.com Thu Dec 1 14:33:40 2011 From: tyler_rinker at hotmail.com (Tyler Rinker) Date: Thu, 1 Dec 2011 08:33:40 -0500 Subject: [R] References for book "R In Action" by Kabacoff In-Reply-To: <4ED74D7D.2050205@statistik.tu-dortmund.de> References: <1322730618592-4127625.post@n4.nabble.com>, <4ED74D7D.2050205@statistik.tu-dortmund.de> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From aodhanol at gmail.com Thu Dec 1 14:43:37 2011 From: aodhanol at gmail.com (AOLeary) Date: Thu, 1 Dec 2011 05:43:37 -0800 (PST) Subject: [R] Writing a function, want a string argument to define the name of the excel sheet to be called Message-ID: <1322747017324-4128384.post@n4.nabble.com> My question is this: is there a way I can make one of the arguments of the function be a string the user can enter, and then have that be the excel filename? ie, foo <- function(x,y,NAME){ #make a matrix with x rows and y cols M <- matrix(nrow=x,ncol=y) #write the matrix write.table(M, file = "result.csv",append=TRUE, sep = ",") } I've had a look but I couldn't find help for this particular problem and it's one I'd like to solve, so I can change make several excel files to solve the analysis my actual function does. Thank you very much, Aodh?n -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128384.html Sent from the R help mailing list archive at Nabble.com. From hanson at depauw.edu Thu Dec 1 14:59:00 2011 From: hanson at depauw.edu (Bryan Hanson) Date: Thu, 1 Dec 2011 08:59:00 -0500 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: Message-ID: <652A6462-E4D1-4780-9919-D08AD5B0157F@depauw.edu> zz dd: If you want a typical score plot, say PC1 vs PC2, then plot the first and second columns of your score matrix (T) against each other and label the points with the row names (if available) or create a text label from where ever you have this information stored. To get an unlabeled score plot, you could simply do: plot(T[,1], T[,2]) If you are using the package chemometrics, you should take a look at the book that goes with it too: Varmuza and Filzmoser, "Multivariate Statistical Analysis in Chemometrics". If you need more guidance than this, you should probably give us more details about what you are doing. Bryan **************** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA academic.depauw.edu/~hanson/deadpezsociety.html github.com/bryanhanson academic.depauw.edu/~hanson/UMP/Index.html On Dec 1, 2011, at 6:51 AM, zz dd wrote: > Hello > i need some precision about nipals in the chemometrics package in R . > > When i use nipals in chemometrics i obtain T and P matrix. > > I really don't understand what to do with these two matrix to obtain > the scores for every the component (like in spss fo example) > > Comp1 Comp2 Comp3 > quest1 0,8434 0,54333 0,3466 > quest2 0,665 0,7655 0,433 > > Thank you very much for your help > (I know that X=TP+E)... But don't understand else.... > > ______________________________________________ > R-help at 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 code. From hanson at depauw.edu Thu Dec 1 15:02:00 2011 From: hanson at depauw.edu (Bryan Hanson) Date: Thu, 1 Dec 2011 09:02:00 -0500 Subject: [R] Writing a function, want a string argument to define the name of the excel sheet to be called In-Reply-To: <1322747017324-4128384.post@n4.nabble.com> References: <1322747017324-4128384.post@n4.nabble.com> Message-ID: <1DE876CE-60DE-46B7-A0AF-CF40B7E9BE12@depauw.edu> Sure, change your example as follows and then you can pass the name properly: foo <- function(x,y,NAME = "filename.csv"){ #make a matrix with x rows and y cols M <- matrix(nrow=x,ncol=y) #write the matrix write.table(M, file = NAME,append=TRUE, sep = ",") } Bryan **************** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA academic.depauw.edu/~hanson/deadpezsociety.html github.com/bryanhanson academic.depauw.edu/~hanson/UMP/Index.html On Dec 1, 2011, at 8:43 AM, AOLeary wrote: > My question is this: is there a way I can make one of the arguments of the > function be a string the user can enter, and then have that be the excel > filename? ie, > > foo <- function(x,y,NAME){ > > #make a matrix with x rows and y cols > M <- matrix(nrow=x,ncol=y) > #write the matrix > write.table(M, file = "result.csv",append=TRUE, sep = ",") > } > > I've had a look but I couldn't find help for this particular problem and > it's one I'd like to solve, so I can change make several excel files to > solve the analysis my actual function does. > > Thank you very much, > Aodh?n > > -- > View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128384.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From jholtman at gmail.com Thu Dec 1 15:02:23 2011 From: jholtman at gmail.com (jim holtman) Date: Thu, 1 Dec 2011 09:02:23 -0500 Subject: [R] efficient ways to dynamically grow a dataframe In-Reply-To: References: Message-ID: First, dataframes can be much slower than matrices, for example, if you are changing/accessing values a lot. I would suggest that you use a matrix since is seems that all your values are numeric. Allocate a large empty matrix to start (hopefully as large as you need). If you exceed this, you have the option of 'rbind'ing more empty rows on and continuing. This might depend on how large your final matrix might be (you did not state the boundary conditions). On Thu, Dec 1, 2011 at 6:34 AM, Matteo Richiardi wrote: > Hi, > I'm trying to write a small microsimulation in R: that is, I have a > dataframe with info on N individuals for the base-year and I have to > grow it dynamically for T periods: > > df = data.frame( > ?id = 1:N, > ?x =.... > ) > > The most straightforward way to solve the problem that came to my mind > is to create for every period a new dataframe: > > for(t in 1:T){ > ?for(i in 1:N){ > ?row = data.frame( > ? id = i, > ? t = t, > ? x = ... > ? ) > ? df = rbind(df,row) > ?} > } > > This is very inefficient and my pc gets immediately stucked as N is > raised above some thousands. > As an alternative, I created an empty dataframe for all the projected > periods, and then filled it: > > df1 = data.frame( > ?id = rep(1:N,T), > ?t = rep(1:T, each = N), > ?x = rep(NA,N*T) > ) > > for(t in 1:T){ > ?for(i in 1:N){ > ?x = ... > ?df1[df1$id==i & df1$t==t,"x"] = x > ?} > } > df = rbind(df,df1) > > This is also too slow, and my PC gets stucked. I don't want to go for > a matrix, because I'd loose the column names and everything will > become too much error-prone. > Any suggestions on how to do it? > Thanks in advance, > Matteo > > > > > -- > Matteo Richiardi > University of Turin > Faculty of Law > Department of Economics "Cognetti De Martiis" > via Po 53, 10124 Torino > Email: matteo.richiardi at unito.it > Tel. +39 011 670 3870 > Web page: http://www.personalweb.unito.it/matteo.richiardi/ > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From dwinsemius at comcast.net Thu Dec 1 15:02:50 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 09:02:50 -0500 Subject: [R] ordinal data simulation In-Reply-To: <1322723201.36177.YahooMailClassic@web161705.mail.bf1.yahoo.com> References: <1322723201.36177.YahooMailClassic@web161705.mail.bf1.yahoo.com> Message-ID: <6E3EA7EB-29EE-4E0A-8AEC-7D1909C14650@comcast.net> On Dec 1, 2011, at 2:06 AM, yuying shi wrote: > Dear all, > I am doing an ordinal data simulation. I?have a question > regarding the cut off values between categories. Suppose I have > three categories, if I do regression, there should be two cut off > values. I find some simulation code for the ordinal data. However, > they usually only generate a uniform random number and compare the > probability with the random number. That's not a good description of what they are doing. > Could any one be so kind to tell me the rational behind it. I don't > know why we need a random number rather than just two fixed cut > off values. One way to generate a random categorical variable constrained to three values would just be to take a uniform variate on the interval [0,1] and classify it based on whether which of the three segments it is in for 0 < a < b < 1. This really is not an appropriate question for rhelp so you are advised to submit further such questions somewhere they are solicited such as statsexchange.com. -- David Winsemius, MD West Hartford, CT From jon.skoien at jrc.ec.europa.eu Thu Dec 1 15:05:27 2011 From: jon.skoien at jrc.ec.europa.eu (jon.skoien at jrc.ec.europa.eu) Date: Thu, 01 Dec 2011 15:05:27 +0100 Subject: [R] Raster manipulation in R In-Reply-To: References: <1322733767614-4127768.post@n4.nabble.com> Message-ID: <4ED789A7.6060708@jrc.ec.europa.eu> Hi, Alternatively you could have a look at the function "terrain" in the raster package, it can calculate the slope for you using different algorithms, not sure if the one below is included though. For typical spatial requests like this, you could also use the mailing-list r-sig-geo. Cheers, Jon On 01-Dec-11 14:27, Jean V Adams wrote: > jjcabrera20 wrote on 12/01/2011 04:02:47 AM: > >> Hello everyone in the forum >> For introducing myself I would say I have a basic knowledge of R. >> Now I am intended to implement a flood algorithm using R. I have some > MatLab >> experience doing these, and as an example to explain more or less what I >> want, I have a m code to calculate the slope from a Digital elevation > model: >> slope=zeros(row,col); >> for i=2:row-1 >> for j=2:col-1 >> dzdx=(raster(i,j+1)-raster(i,j-1))/(2*res); >> dzdy=(raster(i+1,j)-raster(i-1,j))/(2*res); >> slope(i,j)=sqrt(dzdx^2+dzdy^2); >> end >> end; >> >> The question is to know how to do the similar procedure on R. All >> suggestions are welcome >> Thanks >> >> All best, >> >> Jorge >> PD:I am using R on windows system 64 bits > > If I am interpreting your code correctly (I don't use MatLab myself), > something like this should give you the same result in R: > > # example matrix of heights > raster<- matrix(runif(20, 10, 30), nrow=4, ncol=5) > > # example resolution > res<- 8.5 > > # dimensions of matrix > drast<- dim(raster) > > # for every non-boundary point in the matrix, > # calculate the distances between its adjacent columns (dzdx) and rows > (dzdy) > dzdx<- raster[2:(drast[1]-1), 3:drast[2]] - raster[2:(drast[1]-1), > 1:(drast[2]-2)] > dzdy<- raster[3:drast[1], 2:(drast[2]-1)] - raster[1:(drast[1]-2), > 2:(drast[2]-1)] > > # calculate the slope from these distances and the resolution > slope<- sqrt(dzdx^2 + dzdy^2) / (2*res) > > > Jean > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jon Olav Sk?ien Joint Research Centre - European Commission Institute for Environment and Sustainability (IES) Global Environment Monitoring Unit Via Fermi 2749, TP 440, I-21027 Ispra (VA), ITALY jon.skoien at jrc.ec.europa.eu Tel: +39 0332 789206 Disclaimer: Views expressed in this email are those of the individual and do not necessarily represent official views of the European Commission. From matt at biostatmatt.com Thu Dec 1 15:18:45 2011 From: matt at biostatmatt.com (Matt Shotwell) Date: Thu, 01 Dec 2011 08:18:45 -0600 Subject: [R] R logo in eps formt In-Reply-To: References: Message-ID: <1322749125.2203.3.camel@pal> See this earlier post for SVG logos: http://tolstoy.newcastle.edu.au/R/e12/devel/10/10/0112.html Using Image Magick, do something like convert logo.svg logo.eps On Thu, 2011-12-01 at 10:56 +0700, Ben Madin wrote: > G'day all, > > Sorry if this message has been posted before, but searching for R is always difficult... > > I was hoping for a copy of the logo in eps format? Can I do this from R, or is one available for download? > > cheers > > Ben > ______________________________________________ > R-help at 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 code. From fife.dustin at gmail.com Thu Dec 1 15:27:12 2011 From: fife.dustin at gmail.com (Dustin Fife) Date: Thu, 1 Dec 2011 08:27:12 -0600 Subject: [R] FIML with missing data in sem package In-Reply-To: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> References: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rroa at azti.es Thu Dec 1 15:31:08 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Thu, 1 Dec 2011 15:31:08 +0100 Subject: [R] how to get inflection point in binomial glm In-Reply-To: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> References: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> Message-ID: <5CD78996B8F8844D963C875D3159B94A02DFF6E4@DSRCORREO.azti.local> Assuming a logistic model, for each group solve for d at Y=0, or solve for d at p=0.5, where d is your continuous predictor, Y is the logit score, and p is the probability of success in the binomial model. After that you can get the standard error of the inflection point by Taylor series (aka delta method). Another idea is to re-parameterize the logistic model to include explicitly the inflection point, thus you'll get its estimate and standard error directly as a result of the fit. For example, disregarding the g factor predictor (or for each group), a logistic model such as P(d) = 1/(1+exp(log(1/19)(d-d50)/(d95-d50)) includes the inflection point directly (d50) and is a re-parameterized version of the usual logistic model P(d) =1/(1+exp(b0+b1*d)) where parameters b0 and b1 have been replaced by d95 and d50, the predictor at 50% probability (inflection point), and the predictor at 95% probability, respectively. HTH Rub?n -----Mensaje original----- De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] En nombre de Ren? Mayer Enviado el: jueves, 01 de diciembre de 2011 14:25 Para: r-help at r-project.org Asunto: [R] how to get inflection point in binomial glm Dear All, I have a binomial response with one continuous predictor (d) and one factor (g) (8 levels dummy-coded). glm(resp~d*g, data, family=binomial) Y=b0+b1*X1+b2*X2 ... b7*X7 how can I get the inflection point per group, e.g., P(d)=.5 I would be grateful for any help. Thanks in advance, Ren? ______________________________________________ R-help at 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 code. From pisicandru at hotmail.com Thu Dec 1 15:37:09 2011 From: pisicandru at hotmail.com (Monica Pisica) Date: Thu, 1 Dec 2011 14:37:09 +0000 Subject: [R] x, y for point of intersection In-Reply-To: References: , , , Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 1 16:43:04 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Thu, 1 Dec 2011 10:43:04 -0500 Subject: [R] hi all.regarding quantile regression results.. In-Reply-To: <1322745136019-4128248.post@n4.nabble.com> References: <1322745136019-4128248.post@n4.nabble.com> Message-ID: This really isn't the appropriate forum for most of your questions: I'd suggest you work through the Wikipedia article on quantiles regression and direct follow up to stats.stackexchange.com. As to the R question: use the predict() function. Michael On Dec 1, 2011, at 8:12 AM, narendarreddy kalam wrote: > i know this is not about R. > After applying quantile regression with t=0.5,0.6 on the data set WBC( > Wisconsin Breast Cancer)with 678 observations and 9 independent > variables(inp1,inp2,...inp9) and 1 dependent variable(op) i have got the > following results for beta values. > > when t=0.5(median regression) beta values b1=0.002641,b2=0.045746,b3=0. > 005282,b4=0.004397,b5=0.002641,b6=0.065807,b7=0.005282 > ,b8=0.031394,b9=0.004993 and intercept is -0.181388 > > and when t=0.6 beta values are > b1=0,b2=0.01,b3=0,b4=-0.002,b5=0.004,b6=0.1111,b7=0.002,b8=0,b9=0 and > intercept is -0.009 . > > sir,how to interpret the above beta coefficients and what do they mean > exactly??. > t=0.5 means are we considering first 50% of the total data? > t=0.6 means are we considering the first 60% of the total data? > can we write a equation like > > > y=intercept+b1*inp11+b2*inp29+b3*inp3+b4*inp4+b5*inp5+b6*inp6+b7*inp7+b8*inp8+b9*inp9 > as in Linear Regression > to calculate the predicted output of y or not?? > > If we are taking into consideration 5 quantiles of data ,Does it mean > that we are dividing data it into 5 parts??which variables i have to > consider if the data is to be divided into 5 parts? > > And > i got 5 equations for 5 quantiles, what exactly each equation represents? > Can i write single equation for the data set as in mean regression by > combining the 5 equations of each quantile. > Please reply me. > > Thanks In advance, > > With regards > > Kalam Naerndar Reddy > M.Tech(IT), > University of Hyderabad. > > -- > View this message in context: http://r.789695.n4.nabble.com/hi-all-regarding-quantile-regression-results-tp4128248p4128248.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Thu Dec 1 16:48:12 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 10:48:12 -0500 Subject: [R] efficient ways to dynamically grow a dataframe In-Reply-To: References: Message-ID: I'd also suggest you read circle 2 of the "R inferno" (just google it) which has some helpful tips on how to deal with these sorts of problems. Also, did you know that matrices can have column names and that rbind() preserves them? E.g., m <- matrix(1:6, 3); colnames(m) <- letters[1:2] print(m) print(rbind(m, c(10, 11))) Michael On Thu, Dec 1, 2011 at 9:02 AM, jim holtman wrote: > First, dataframes can be much slower than matrices, for example, if > you are changing/accessing values a lot. ?I would suggest that you use > a matrix since is seems that all your values are numeric. ?Allocate a > large empty matrix to start (hopefully as large as you need). ?If you > exceed this, you have the option of 'rbind'ing more empty rows on and > continuing. ?This might depend on how large your final matrix might be > (you did not state the boundary conditions). > > On Thu, Dec 1, 2011 at 6:34 AM, Matteo Richiardi > wrote: >> Hi, >> I'm trying to write a small microsimulation in R: that is, I have a >> dataframe with info on N individuals for the base-year and I have to >> grow it dynamically for T periods: >> >> df = data.frame( >> ?id = 1:N, >> ?x =.... >> ) >> >> The most straightforward way to solve the problem that came to my mind >> is to create for every period a new dataframe: >> >> for(t in 1:T){ >> ?for(i in 1:N){ >> ?row = data.frame( >> ? id = i, >> ? t = t, >> ? x = ... >> ? ) >> ? df = rbind(df,row) >> ?} >> } >> >> This is very inefficient and my pc gets immediately stucked as N is >> raised above some thousands. >> As an alternative, I created an empty dataframe for all the projected >> periods, and then filled it: >> >> df1 = data.frame( >> ?id = rep(1:N,T), >> ?t = rep(1:T, each = N), >> ?x = rep(NA,N*T) >> ) >> >> for(t in 1:T){ >> ?for(i in 1:N){ >> ?x = ... >> ?df1[df1$id==i & df1$t==t,"x"] = x >> ?} >> } >> df = rbind(df,df1) >> >> This is also too slow, and my PC gets stucked. I don't want to go for >> a matrix, because I'd loose the column names and everything will >> become too much error-prone. >> Any suggestions on how to do it? >> Thanks in advance, >> Matteo >> >> >> >> >> -- >> Matteo Richiardi >> University of Turin >> Faculty of Law >> Department of Economics "Cognetti De Martiis" >> via Po 53, 10124 Torino >> Email: matteo.richiardi at unito.it >> Tel. +39 011 670 3870 >> Web page: http://www.personalweb.unito.it/matteo.richiardi/ >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > ______________________________________________ > R-help at 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 code. From mkao006rmail at gmail.com Thu Dec 1 16:55:21 2011 From: mkao006rmail at gmail.com (Michael Kao) Date: Thu, 01 Dec 2011 16:55:21 +0100 Subject: [R] round to specific intervals Message-ID: <4ED7A369.4050206@gmail.com> Dear R users/helpers, I am wondering is there an existing function in which you can round numbers to a set of values. I know you can use 5 * round(x/5) for rounding to the nearest 5 or so, but what if the interval size is not constant. For example: ## Not run test <- rnorm(100) round(test, c(1, 5, 10, 20, 50)) so that the test is rounded to the closest value in the vector. Thanks for the help. Cheers, From f.harrell at vanderbilt.edu Thu Dec 1 17:14:58 2011 From: f.harrell at vanderbilt.edu (Frank Harrell) Date: Thu, 1 Dec 2011 08:14:58 -0800 (PST) Subject: [R] Nomogram with stratified cph in rms package, how to get failure probability In-Reply-To: <1322664449417-4123249.post@n4.nabble.com> References: <1322664449417-4123249.post@n4.nabble.com> Message-ID: <1322756098970-4129173.post@n4.nabble.com> Hazard() is not implemented except for parametric survival models. You are not calling nomogram() correctly; in rms the plotting step is separated from the nomogram computations. To plot cumulative event rates do something like: mort10 <- function(lp) 1 - surv(10,lp) and tell nomogram about mort10 using fun=. Frank min wrote > > Hello, > > I am using Dr. Harrell's rms package to make a nomogram. I was able to > make a beautiful one. However, I want to change 5-year survival > probability to 5-year failure probability. > > I couldn?t get hazard rate from Hazard(f1) because I used cph for the > model. > > Here is my code: > > library(rms) > f1 <- cph(Surv(retime,dfs) ~ > age+her2+t_stage+n_stage+er+grade+cytcyt+Cyt_PCDK2 , data=data11, > surv=T, x=T, y=T, time.inc=5) > > surv<- Survival(f1) > haz<- Hazard(f1) > Here is the Error in UseMethod("Hazard") : > no applicable method for 'Hazard' applied to an object of class > "c('cph', 'Design', 'coxph')" > > > surv10 <- function(lp) surv(10,lp) > surv5 <- function(lp) surv(5,lp) > quant <- Quantile(f1) > > at.surv <- c(0.1, 0.3, 0.5, 0.7, 0.9) > > at.med1<-c(2,3,4, 5,6,7,8, 10,15,20,25, 30) > > > par(cex=0.8) > nom<- nomogram(f1, conf.int=F, > fun=list(surv5, surv10), funlabel=c('5-Year Survival Probability', > '10-Year Survival Probability' ), lp=F, > fun.at=c(at.surv, at.surv),label.every=1, force.label=FALSE, cex.axis=0.8, > verbose=TRUE, cex.var=0.8) > > How can I show failure probability instead of survival probability? > > I would very much appreciate any assistance in this matter. > Thank you Very much. > ----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Nomogram-with-stratified-cph-in-rms-package-how-to-get-failure-probability-tp4123249p4129173.html Sent from the R help mailing list archive at Nabble.com. From gunter.berton at gene.com Thu Dec 1 17:17:02 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Thu, 1 Dec 2011 08:17:02 -0800 Subject: [R] round to specific intervals In-Reply-To: <4ED7A369.4050206@gmail.com> References: <4ED7A369.4050206@gmail.com> Message-ID: ?findInterval .. would get you the endpoints and then you could determine which is nearer. Of course in your "example", everything would get "rounded" to 1. -- Bert On Thu, Dec 1, 2011 at 7:55 AM, Michael Kao wrote: > Dear R users/helpers, > > I am wondering is there an existing function in which you can round numbers > to a set of values. I know you can use 5 * round(x/5) for rounding to the > nearest 5 or so, but what if the interval size is not constant. > > For example: > ## Not run > test <- rnorm(100) > round(test, c(1, 5, 10, 20, 50)) > > so that the test is rounded to the closest value in the vector. > > Thanks for the help. > > Cheers, > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From aodhanol at gmail.com Thu Dec 1 15:10:01 2011 From: aodhanol at gmail.com (AOLeary) Date: Thu, 1 Dec 2011 06:10:01 -0800 (PST) Subject: [R] Writing a function, want a string argument to define the name of the excel sheet to be called In-Reply-To: <1DE876CE-60DE-46B7-A0AF-CF40B7E9BE12@depauw.edu> References: <1322747017324-4128384.post@n4.nabble.com> <1DE876CE-60DE-46B7-A0AF-CF40B7E9BE12@depauw.edu> Message-ID: <1322748601119-4128495.post@n4.nabble.com> Thank you very much, that does exactly what I want it to! :) Aodh?n -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128495.html Sent from the R help mailing list archive at Nabble.com. From john-paul.quinn at ncl.ac.uk Thu Dec 1 15:51:55 2011 From: john-paul.quinn at ncl.ac.uk (jpquinn91) Date: Thu, 1 Dec 2011 06:51:55 -0800 (PST) Subject: [R] How to do Hotelling's t2 test? Message-ID: <1322751115231-4128748.post@n4.nabble.com> Hi, I want to do a 2 sample hotelling's test but i can't figure out how. When i type T2.test it says there is no such test and when i tried library(rrcov) it says there is no such program. Cheers. -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-Hotelling-s-t2-test-tp4128748p4128748.html Sent from the R help mailing list archive at Nabble.com. From dyb at noc.ac.uk Thu Dec 1 16:02:20 2011 From: dyb at noc.ac.uk (Berry, David I.) Date: Thu, 1 Dec 2011 15:02:20 +0000 Subject: [R] R, PostgresSQL and poor performance Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jonasjae at pik-potsdam.de Thu Dec 1 16:16:59 2011 From: jonasjae at pik-potsdam.de (=?ISO-8859-1?Q?Jonas_J=E4germeyr?=) Date: Thu, 01 Dec 2011 16:16:59 +0100 Subject: [R] How to speed up int2bin conversion? In-Reply-To: References: <4ED76FA8.7030007@pik-potsdam.de> Message-ID: <4ED79A6B.5060201@pik-potsdam.de> On 12/01/2011 02:46 PM, jim holtman wrote: > If we assume that you are just convert 8 bits, here is one way with a > table lookup. If more than 8 bits, just partition the data and > repeat. This sets up a mapping table one time for the lookup. Does > 1M in 0.3 seconds on my computer; is this fast enough? > >> # initialize a matrix with 8 bit binary values >> # one time >> require(bitops) >> b2c<- character(256) >> for (i in 0:255){ > + b2c[i + 1]<- sprintf("%1d%1d%1d%1d%1d%1d%1d%1d" > + , bitAnd(i, 0x80) != 0 > + , bitAnd(i, 0x40) != 0 > + , bitAnd(i, 0x20) != 0 > + , bitAnd(i, 0x10) != 0 > + , bitAnd(i, 0x8) != 0 > + , bitAnd(i, 0x4) != 0 > + , bitAnd(i, 0x2) != 0 > + , bitAnd(i, 0x1) != 0 > + ) > + } >> # create vector with 1M values >> x<- as.integer(1:1e6) >> >> int2bin<- function(val) > + { > + b2c[bitAnd(val, 0xff) + 1] > + } >> system.time(int2bin(x)) > user system elapsed > 0.31 0.00 0.32 > > On Thu, Dec 1, 2011 at 7:14 AM, Jonas J?germeyr wrote: >> Dear R-help members, >> >> I'm processing a large amount of MODIS data where quality assessment >> information is stored as an integer value for each pixel. I have to >> converted this number to an 8 digit binary flag to get access to the >> stored quality code (e.g. in2bin(165,8) = 1 0 1 0 0 1 0 1). >> >> Unfortunately, I did not manage to find a package providing a fast >> function to do so. I need to run this on millions of pixels and thus >> wrote the following function. >> >> int2bin<- function(x,ndigits){ >> base<- array(NA, dim=c(length(x), ndigits)) >> for(q in 1:ndigits){ >> base[, ndigits-q+1]<- (x %% 2) >> x<- (x %/% 2) >> } >> bin<- apply(base,1,paste,collapse="") >> return(bin) >> } >> >> Since it is still slow, I have to find a way to express this more >> elegantly. I'd really appreciate any help. >> >> Thanking you, with best regards >> >> Jonas J?germeyr >> >> Potsdam Institute for Climate Impact Research >> Research Domain II >> >> [[alternative HTML version deleted]] >> >> >> ______________________________________________ >> R-help at 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 code. >> > > Great Jim! Thanks a lot. New way of thinking, appreciated. I also need 16 and 32 bit flags and hence I just added those two lines: int2bin16<- function(val) { paste(int2bin(val%/%256),int2bin(val),sep="") } int2bin32<- function(val) { paste(int2bin(val%/%256^3),int2bin(val%/%256^2),int2bin(val%/%256),int2bin(val),sep="") } Best, Jonas J?germeyr Potsdam Institute for Climate Impact Research Research Domain II From golden_boy110 at yahoo.com Thu Dec 1 16:35:04 2011 From: golden_boy110 at yahoo.com ( Majid ) Date: Thu, 1 Dec 2011 07:35:04 -0800 (PST) Subject: [R] vector Message-ID: <1322753704.39854.YahooMailNeo@web113611.mail.gq1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From miseno77 at hotmail.com Thu Dec 1 16:49:09 2011 From: miseno77 at hotmail.com (lincoln) Date: Thu, 1 Dec 2011 07:49:09 -0800 (PST) Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis In-Reply-To: <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> References: <1322739265192-4127990.post@n4.nabble.com> <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> Message-ID: <1322754549513-4129048.post@n4.nabble.com> Thanks. So, suppose for one specific year (first year over 10) the percentage of successes deriving from 100 trials with 38 successes (and 62 failures), its value would be 38/100=0.38. I could calculate its confidence intervals this way: > success<-38 > total<-100 > prop.test(success,total,p=0.5,alternative="two.sided") 1-sample proportions test with continuity correction data: success out of total, null probability 0.5 X-squared = 5.29, df = 1, p-value = 0.02145 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.2863947 0.4829411 sample estimates: p 0.38 So it would be var$1=0.38 , CI=0.286-0.483 Is it correct? -- View this message in context: http://r.789695.n4.nabble.com/Resampling-with-replacement-on-a-binary-0-1-variable-to-get-CIs-tp4127990p4129048.html Sent from the R help mailing list archive at Nabble.com. From myi at mdanderson.org Thu Dec 1 17:17:33 2011 From: myi at mdanderson.org (min) Date: Thu, 1 Dec 2011 08:17:33 -0800 (PST) Subject: [R] Nomogram with stratified cph in rms package, how to get failure probability In-Reply-To: <1322756098970-4129173.post@n4.nabble.com> References: <1322664449417-4123249.post@n4.nabble.com> <1322756098970-4129173.post@n4.nabble.com> Message-ID: <3484DB596CEF284A9948D8A8F121AFC38626886526@DCPWVMBXC0VS3.mdanderson.edu> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Thu Dec 1 17:20:37 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Thu, 01 Dec 2011 11:20:37 -0500 Subject: [R] round to specific intervals In-Reply-To: <4ED7A369.4050206@gmail.com> References: <4ED7A369.4050206@gmail.com> Message-ID: <4ED7A955.7040205@gmail.com> On 01/12/2011 10:55 AM, Michael Kao wrote: > Dear R users/helpers, > > I am wondering is there an existing function in which you can round > numbers to a set of values. I know you can use 5 * round(x/5) for > rounding to the nearest 5 or so, but what if the interval size is not > constant. > > For example: > ## Not run > test<- rnorm(100) > round(test, c(1, 5, 10, 20, 50)) > > so that the test is rounded to the closest value in the vector. I think you could put together such a thing using cut(). Duncan Murdoch From jdnewmil at dcn.davis.ca.us Thu Dec 1 17:25:34 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Thu, 01 Dec 2011 08:25:34 -0800 Subject: [R] How to speed up int2bin conversion? In-Reply-To: <4ED76FA8.7030007@pik-potsdam.de> References: <4ED76FA8.7030007@pik-potsdam.de> Message-ID: <61894f42-103d-4bb5-a04c-8d6e6e63a727@email.android.com> You might be interested in package "bit". --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. "Jonas J?germeyr" wrote: >Dear R-help members, > >I'm processing a large amount of MODIS data where quality assessment >information is stored as an integer value for each pixel. I have to >converted this number to an 8 digit binary flag to get access to the >stored quality code (e.g. in2bin(165,8) = 1 0 1 0 0 1 0 1). > >Unfortunately, I did not manage to find a package providing a fast >function to do so. I need to run this on millions of pixels and thus >wrote the following function. > >int2bin <- function(x,ndigits){ > base <- array(NA, dim=c(length(x), ndigits)) > for(q in 1:ndigits){ > base[, ndigits-q+1] <- (x %% 2) > x <- (x %/% 2) > } > bin<- apply(base,1,paste,collapse="") > return(bin) >} > >Since it is still slow, I have to find a way to express this more >elegantly. I'd really appreciate any help. > >Thanking you, with best regards > >Jonas J?germeyr > >Potsdam Institute for Climate Impact Research >Research Domain II > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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 code. From fife.dustin at gmail.com Thu Dec 1 17:25:36 2011 From: fife.dustin at gmail.com (Dustin Fife) Date: Thu, 1 Dec 2011 10:25:36 -0600 Subject: [R] FIML with missing data in sem package In-Reply-To: References: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From andy_liaw at merck.com Thu Dec 1 17:29:55 2011 From: andy_liaw at merck.com (Liaw, Andy) Date: Thu, 1 Dec 2011 11:29:55 -0500 Subject: [R] Random Forests in R In-Reply-To: References: Message-ID: The first version of the package was created by re-writing the main program in the original Fortran as C, and calls other Fortran subroutines that were mostly untouched, so dynamic memory allocation can be done. Later versions have most of the Fortran code translated/re-written in C. Currently the only Fortran part is the node splitting in classification trees. Andy > -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Peter Langfelder > Sent: Thursday, December 01, 2011 12:33 AM > To: Axel Urbiz > Cc: R-help at r-project.org > Subject: Re: [R] Random Forests in R > > On Wed, Nov 30, 2011 at 7:48 PM, Axel Urbiz > wrote: > > I understand the original implementation of Random Forest > was done in > > Fortran code. In the source files of the R implementation > there is a note > > "C wrapper for random forests: ?get input from R and drive ? the Fortran > > routines.". I'm far from an expert on this...does that mean that the > > implementation in R is through calls to C functions only > (not Fortran)? > > > > So, would knowing C be enough to understand this code, or > Fortran is also > > necessary? > > I haven't seen the C and Fortran code for Random Forest but I > understand the note to say that R code calls some C functions that > pre-process (possibly re-format etc) the data, then call the actual > Random Forest method that's written in Fortran, then possibly > post-process the output and return it to R. It would imply that to > understand the actual Random Forest code, you will have to read the > Fortran source code. > > Best, > > Peter > > ______________________________________________ > R-help at 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 code. > Notice: This e-mail message, together with any attachme...{{dropped:11}} From mkao006rmail at gmail.com Thu Dec 1 17:33:01 2011 From: mkao006rmail at gmail.com (Michael Kao) Date: Thu, 01 Dec 2011 17:33:01 +0100 Subject: [R] round to specific intervals In-Reply-To: <4ED7A955.7040205@gmail.com> References: <4ED7A369.4050206@gmail.com> <4ED7A955.7040205@gmail.com> Message-ID: <4ED7AC3D.9070006@gmail.com> Thanks for all the response, I manage to write a small function to complete what I want based on the wonderful helps. iround <- function(x, interval){ ## Round numbers to desired interval ## ## Args: ## x: Numeric vector to be rounded ## interval: The interval the values should be rounded towards. ## Retunrs: ## a numeric vector with x rounded to the desired interval. ## interval[ifelse(x < min(interval), 1, findInterval(x, interval))] } iround(0:100, c(1, 5, 10, 20, 50)) Cheers, and thanks for all the help again. On 1/12/2011 5:20 p.m., Duncan Murdoch wrote: > On 01/12/2011 10:55 AM, Michael Kao wrote: >> Dear R users/helpers, >> >> I am wondering is there an existing function in which you can round >> numbers to a set of values. I know you can use 5 * round(x/5) for >> rounding to the nearest 5 or so, but what if the interval size is not >> constant. >> >> For example: >> ## Not run >> test<- rnorm(100) >> round(test, c(1, 5, 10, 20, 50)) >> >> so that the test is rounded to the closest value in the vector. > > > I think you could put together such a thing using cut(). > > Duncan Murdoch From dwinsemius at comcast.net Thu Dec 1 17:34:59 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 11:34:59 -0500 Subject: [R] how to get inflection point in binomial glm In-Reply-To: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> References: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> Message-ID: <115F31EC-7960-4157-B70E-A4DB76D5C2DE@comcast.net> On Dec 1, 2011, at 8:24 AM, Ren? Mayer wrote: > Dear All, > > I have a binomial response with one continuous predictor (d) and one > factor (g) (8 levels dummy-coded). > > glm(resp~d*g, data, family=binomial) > > Y=b0+b1*X1+b2*X2 ... b7*X7 Dear Dr Mayer; I think it might be a bit more complex than that. I think you should get 15 betas rather than 8. Have you done it? > > how can I get the inflection point per group, e.g., P(d)=.5 Wouldn't that just be at d=1/beta in each group? (Thinking, perhaps naively, in the case of X=X1 that (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta *d*(X==X1) ) # all other terms = 0 And taking the log of both sides, and then use "middle school" math to solve. Oh, wait. Muffed my first try on that for sure. Need to add back both the constant intercept and the baseline "d" coefficient for the non-b0 levels. (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d + beta_n + beta_d_n *d*(X==Xn) ) And just (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d ) # for the reference level. This felt like an exam question in my categorical analysis course 25 years ago. (Might have gotten partial credit for my first stab, depending on how forgiving the TA was that night.) > > I would be grateful for any help. > > Thanks in advance, > Ren? > -- David Winsemius, MD West Hartford, CT From S.Ellison at LGCGroup.com Thu Dec 1 17:36:09 2011 From: S.Ellison at LGCGroup.com (S Ellison) Date: Thu, 1 Dec 2011 16:36:09 +0000 Subject: [R] How to do Hotelling's t2 test? In-Reply-To: <1322751115231-4128748.post@n4.nabble.com> References: <1322751115231-4128748.post@n4.nabble.com> Message-ID: > Hi, I want to do a 2 sample hotelling's test but i can't > figure out how. When i type T2.test it says there is no such > test and when i tried library(rrcov) it says there is no such > program. Have you installed rrcov using install.packages? S Ellison******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} From dwinsemius at comcast.net Thu Dec 1 17:38:30 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 11:38:30 -0500 Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis In-Reply-To: <1322754549513-4129048.post@n4.nabble.com> References: <1322739265192-4127990.post@n4.nabble.com> <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> <1322754549513-4129048.post@n4.nabble.com> Message-ID: On Dec 1, 2011, at 10:49 AM, lincoln wrote: > Thanks. > > So, suppose for one specific year (first year over 10) the > percentage of > successes deriving from 100 trials with 38 successes (and 62 > failures), its > value would be 38/100=0.38. > I could calculate its confidence intervals this way: >> success<-38 >> total<-100 >> prop.test(success,total,p=0.5,alternative="two.sided") > > 1-sample proportions test with continuity > correction > > data: success out of total, null probability 0.5 > X-squared = 5.29, df = 1, p-value = 0.02145 > alternative hypothesis: true p is not equal to 0.5 > 95 percent confidence interval: > 0.2863947 0.4829411 > sample estimates: > p > 0.38 > > So it would be var$1=0.38 , CI=0.286-0.483 > > Is it correct? > I couldn't tell if this were homework, so I just threw out a starting point. If you were told to do a resampling method then this would just be a starting point and you would be expected to go further with the boot function. > -- > View this message in context: http://r.789695.n4.nabble.com/Resampling-with-replacement-on-a-binary-0-1-variable-to-get-CIs-tp4127990p4129048.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From emorway at usgs.gov Thu Dec 1 17:54:42 2011 From: emorway at usgs.gov (emorway) Date: Thu, 1 Dec 2011 08:54:42 -0800 (PST) Subject: [R] legend, "lheight", and alignment Message-ID: <1322758482556-4129402.post@n4.nabble.com> Hello, A bit of fairly simple code, yet I don't seem to be able to manipulate it quite as much as I would like: 1) It would be nice if the objects appearing in the legend were aligned, and by aligned I mean the boxes are centered over the lines. Do I need to adjust the use of "NA" in the code below to accomplish this? Here's how it appears on my machine: http://r.789695.n4.nabble.com/file/n4129402/example.png 2) Because I'm using a call to 'expression' in the text contained in the legend, it would be nice to space the lines of text a bit more. My feeble attempt was to increase the lheight parameter in the hopes this would affect the legend...to no avail. Further, lheight cannot be added to the argument list of legend. I've been unable to track down another parameter applicable to legend, suggestions very much appreciated. par(lheight=2) plot(1,1,col="white") legend("center", legend=c(expression(paste("Observed ",italic(bar(EC)[e]))),expression(paste("Simulated ",italic(bar(EC)[e]))),"test1","test2"), lty = c(NA,NA,1,1), col = c("black","black","red","blue"), density = c(NA,25,NA,NA), border=c("black","black",NA,NA), fill = c("grey","black",NA,NA), angle = c(NA,45,NA,NA), cex = 1.25, bty = "n", xpd = TRUE) > sessionInfo() R version 2.13.2 (2011-09-30) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.13.2 > -- View this message in context: http://r.789695.n4.nabble.com/legend-lheight-and-alignment-tp4129402p4129402.html Sent from the R help mailing list archive at Nabble.com. From yrosseel at gmail.com Thu Dec 1 17:56:00 2011 From: yrosseel at gmail.com (yrosseel) Date: Thu, 01 Dec 2011 17:56:00 +0100 Subject: [R] FIML with missing data in sem package In-Reply-To: References: <000d01ccb023$510f1a70$f32d4f50$@mcmaster.ca> Message-ID: <4ED7B1A0.6070401@gmail.com> On 12/01/2011 05:25 PM, Dustin Fife wrote: >> >> What is your goal? I have used and like mice pretty well, but using >> mice + sem to try to address missingness seems like more work than >> using FIML in OpenMx or lavaan to try to address it. Is there a >> reason you want to use the sem package or a reason you do not want to >> use the others? >> >> I tried lavaan and couldn't get it to work. I noticed it was in beta so I > figured it wasn't a good idea to use for simulations I intend to publish > (especially when I can't get them to work properly). Either way, whether I > use OpenMX or lavaan, it will require me to learn a new syntax, and I guess > I'm just lazy. I'm comfortable with sem. The 'beta' status of lavaan implies that things (eg function arguments) may change from one version to another, until most planned features are implemented. However, the computations/results themselves are pretty stable. Many SEM reseachers do use lavaan today for simulation studies, and some have been published already. I can provide you with some references off-list if you are interested. Yves Rosseel. http://lavaan.org From ggrothendieck at gmail.com Thu Dec 1 18:01:53 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Thu, 1 Dec 2011 12:01:53 -0500 Subject: [R] R, PostgresSQL and poor performance In-Reply-To: References: Message-ID: On Thu, Dec 1, 2011 at 10:02 AM, Berry, David I. wrote: > Hi List > > Apologies if this isn't the correct place for this query (I've tried a search of the mail archives but not had much joy). > > I'm running R (2.14.0) ?on a Mac (OSX v 10.5.8, 2.66GHz, 4GB memory) and am having a few performance issues with reading data in from a Postres database (using RPostgreSQL). My query / code are as below > > # ----------------------------- > library('RPostgreSQL') > > drv <- dbDriver("PostgreSQL") > > dbh <- dbConnect(drv,user="?",password="?",dbname="?",host="?") > > sql <- "select id, date, lon, lat, date_trunc('day' , date) as jday, extract('hour' from date) as hour, extract('year' from date) as year from observations where pt = 6 and date >= '1990-01-01' and date < '1995-01-01' and lon > 180 and lon < 290 and lat > -30 and lat < 30 and sst is not null" > > dataIn <- dbGetQuery(dbh,sql) If this is a large table of which the desired rows are a small fraction of all rows then be sure there indexes on the variables in your where clause. You can also try it with the RpgSQL driver although there is no reason to think that that would be faster. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From msuzen at mango-solutions.com Thu Dec 1 18:03:11 2011 From: msuzen at mango-solutions.com (Mehmet Suzen) Date: Thu, 1 Dec 2011 17:03:11 -0000 Subject: [R] R package source branching In-Reply-To: References: <1322751115231-4128748.post@n4.nabble.com> Message-ID: <3CBFCFB1FEFFA841BA83ADF2F2A9C6FA01E92350@mango-data1.Mango.local> Dear List, I was wondering if any of you worked on an R package which has many branches on a repository i.e. SVN. Is it recommended to branch an R package source tree based on a specific project? I know it depends on project but it would be great to hear opinions from R community. Best, Mehmet S?zen, PhD LEGAL NOTICE This message is intended for the use o...{{dropped:10}} From sarah.goslee at gmail.com Thu Dec 1 18:11:47 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 12:11:47 -0500 Subject: [R] vector In-Reply-To: <1322753704.39854.YahooMailNeo@web113611.mail.gq1.yahoo.com> References: <1322753704.39854.YahooMailNeo@web113611.mail.gq1.yahoo.com> Message-ID: Hi, On Thu, Dec 1, 2011 at 10:35 AM, " Majid " wrote: > Hi. > Can you please answer to my questions about R ? > 1.how can I write command for vector ? > > for exaple in this sample : > I have this : > a1 <- c (1:10) > now how can I put in the vector ? I'm afraid I don't understand your question. a1 is a vector that you've created. What do you want to do with it? Sarah > > bye for now, > Thanks a lot. > Majid. -- Sarah Goslee http://www.functionaldiversity.org From a.schlicker at nki.nl Thu Dec 1 18:00:25 2011 From: a.schlicker at nki.nl (Andreas Schlicker) Date: Thu, 1 Dec 2011 18:00:25 +0100 Subject: [R] What's the baseline model when using coxph with factor variables? Message-ID: <4ED7B2A9.1090607@nki.nl> Hi all, I'm trying to fit a Cox regression model with two factor variables but have some problems with the interpretation of the results. Considering the following model, where var1 and var2 can assume value 0 and 1: coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) What is the baseline model? Is that considering the whole population or the case when both var1 and var2 = 0? Kind regards, andi From desviostandard at gmail.com Thu Dec 1 17:27:07 2011 From: desviostandard at gmail.com (=?ISO-8859-1?Q?Pablo_Dom=EDnguez_Vaselli?=) Date: Thu, 1 Dec 2011 13:27:07 -0300 Subject: [R] References for book "R In Action" by Kabacoff (Uwe Ligges) Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Douglas.Esneault at mecglobal.com Thu Dec 1 17:32:30 2011 From: Douglas.Esneault at mecglobal.com (Douglas Esneault) Date: Thu, 1 Dec 2011 16:32:30 +0000 Subject: [R] Counting the occurences of a charater within a string Message-ID: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. My dataframe, x, is structured as below: Col1 abc/def ghi/jkl/mno I found this code on the board but it counts all occurrences of "/" in the dataframe. chr.pos <- which(unlist(strsplit(x,NULL))=='/') chr.count <- length(chr.pos) chr.count [1] 3 I'd like to append a column, say cnt, that has the count of "/" for each row. Can anyone point me in the right direction or offer some code to do this? Thanks in advance for the help. Doug Esneault Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of the GroupM companies shall be understood as neither given nor endorsed by it. GroupM companies are a member of WPP plc. For more information on our business ethical standards and Corporate Responsibility policies please refer to our website at http://www.wpp.com/WPP/About/ From rpickeri at mail.nih.gov Thu Dec 1 17:36:48 2011 From: rpickeri at mail.nih.gov (RogerP) Date: Thu, 1 Dec 2011 08:36:48 -0800 (PST) Subject: [R] bigmemory on Solaris In-Reply-To: References: Message-ID: <1322757408424-4129290.post@n4.nabble.com> Thanks again for your help. I've been able to add several packages, bigmemory seems to be the only one to fail and it fails on isinf. Is there a way I can download the code and change it to include a ininf function or definition? I'm using the GNU compiler; should I have been using the SUN Studio compiler? Roger -- View this message in context: http://r.789695.n4.nabble.com/bigmemory-on-Solaris-tp4128179p4129290.html Sent from the R help mailing list archive at Nabble.com. From n.j.apps22 at gmail.com Thu Dec 1 17:58:00 2011 From: n.j.apps22 at gmail.com (napps22) Date: Thu, 1 Dec 2011 08:58:00 -0800 (PST) Subject: [R] Estimation of AR(1) Model with Markov Switching Message-ID: <1322758680372-4129417.post@n4.nabble.com> Dear R users, I have been trying to obtain the MLE of the following model state 0: y_t = 2 + 0.5 * y_{t-1} + e_t state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t where e_t ~ iidN(0,1) transition probability between states is 0.2 I've generated some fake data and tried to estimate the parameters using the constrOptim() function but I can't get sensible answers using it. I've tried using nlminb and maxLik but they haven't helped. Any tips on how I could possibly rewrite my likelihood in a better way to improve my results would be welcome. Given below is my R code # markov switching regime model # generate data for a AR(1) markov switching model with the following pars # state 0: y_t = 2 + 0.5 * y_{t-1} + e_t # state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t # where e_t ~ N(0,1) # transition probabilities p_s0_s1 = p_s1_s0 = 0.20 # generate realisations of the state gamma_s0 <- qnorm(0.8) gamma_s1 <- qnorm(0.2) gamma <- rep(0,100) state <- rep(0,100) # choose initial state at t=0 to be state 0 gamma[1] <- gamma_s0 state[1] <- 0 for(i in 2:100) { if(rnorm(1) < gamma[i-1]) { gamma[i] <- gamma_s0 state[i] <- 0 } else { gamma[i] <- gamma_s1 state[i] <- 1 } } # generate observations # choose y_0 = 0 # recall state at t=1 was set to 0 y1 <- 2 + 0.5 * 0 + rnorm(1) y <- rep(0,100) y[1] <- y1 for(i in 2:100) { if(state[i]==0) { y[i] <- 2 + 0.5 * y[i-1] + rnorm(1) } else { y[i] <- 0.5 + 0.9 * y[i-1] + rnorm(1) } } # convert into time series object y <- ts(y, start = 1, freq = 1) # construct negative conditional likelihood function neg.logl <- function(theta, data) { # construct parameters beta_s0 <- theta[1:2] beta_s1 <- theta[3:4] sigma2 <- exp(theta[5]) gamma0 <- theta[6] gamma1 <- theta[7] # construct probabilities #probit specification p_s0_s0 <- pnorm(gamma_s0) p_s0_s1 <- pnorm(gamma_s1) p_s1_s0 <- 1-pnorm(gamma_s0) p_s1_s1 <- 1-pnorm(gamma_s1) # create data matrix X <- cbind(1,y) # assume erogodicity of the markov chain # use unconditional probabilities p0_s0 <- (1 - p_s1_s1) / (2 -p_s0_s0 -p_s1_s1) p0_s1 <- 1-p0_s0 # create variables p_s0_t_1 <- rep(0, nrow(X)) p_s1_t_1 <- rep(0, nrow(X)) p_s0_t <- rep(0, nrow(X)) p_s1_t <- rep(0, nrow(X)) f_s0 <- rep(0,nrow(X)-1) f_s1 <- rep(0,nrow(X)-1) f <- rep(0,nrow(X)-1) logf <- rep(0, nrow(X)-1) p_s0_t[1] <- p0_s0 p_s1_t[1] <- p0_s1 # initiate hamilton filter for(i in 2:nrow(X)) { # calculate prior probabilities using the TPT # TPT for this example gives us # p_si_t_1 = p_si_t_1_si * p_si_t + p_si_t_1_sj * p_si_t # where p_si_t_1 is the prob state_t = i given information @ time t-1 # p_si_t_1_sj is the prob state_t = i given state_t_1 = j, and all info @ time t-1 # p_si_t is the prob state_t = i given information @ time t # in this simple example p_si_t_1_sj = p_si_sj p_s0_t_1[i] <- (p_s0_s0 * p_s0_t[i-1]) + (p_s0_s1 * p_s1_t[i-1]) p_s1_t_1[i] <- (p_s1_s0 * p_s0_t[i-1]) + (p_s1_s1 * p_s1_t[i-1]) # calculate density function for observation i # f_si is density conditional on state = i # f is the density f_s0[i] <- dnorm(y[i]-X[i-1,]%*%beta_s0, sd = sqrt(sigma2)) f_s1[i] <- dnorm(y[i]-X[i-1,]%*%beta_s1, sd = sqrt(sigma2)) f[i] <- (f_s0[i] * p_s0_t_1[i]) + (f_s1[i] * p_s1_t_1[i]) # calculate filtered/posterior probabilities using bayes rule # p_si_t is the prob that state = i given information @ time t p_s0_t[i] <- (f_s0[i] * p_s0_t_1[i]) / f[i] p_s1_t[i] <- (f_s1[i] * p_s1_t_1[i]) / f[i] logf[i] <- log(f[i]) } logl <-sum(logf) return(-logl) } # restrict intercept in state model 0 to be greater than intercept in state model 1 # thus matrix of restrictions R is [1 0 -1 0 0 0 0] R <- matrix(c(1,0,-1,0,0,0,0), nrow = 1) # pick start values for the 7 unknown parameters start_val <- matrix(runif(7), nrow = 7) # ensures starting values are in the feasible set start_val[1,] <- start_val[3,] + 0.1 # estimate pars results <-constrOptim(start_val,neg.logl,grad = NULL, ui = R, ci = 0) Regards, N -- View this message in context: http://r.789695.n4.nabble.com/Estimation-of-AR-1-Model-with-Markov-Switching-tp4129417p4129417.html Sent from the R help mailing list archive at Nabble.com. From dwinsemius at comcast.net Thu Dec 1 18:35:42 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 12:35:42 -0500 Subject: [R] What's the baseline model when using coxph with factor variables? In-Reply-To: <4ED7B2A9.1090607@nki.nl> References: <4ED7B2A9.1090607@nki.nl> Message-ID: <5BC18E4E-FF2B-4689-AEB9-A755B027B986@comcast.net> On Dec 1, 2011, at 12:00 PM, Andreas Schlicker wrote: > Hi all, > > I'm trying to fit a Cox regression model with two factor variables > but have some problems with the interpretation of the results. > Considering the following model, where var1 and var2 can assume > value 0 and 1: > > coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) > > What is the baseline model? Is that considering the whole population > or the case when both var1 and var2 = 0? This has been discussed several times in the past on rhelp. My suggestion would be to search your favorite rhelp archive using "baseline hazard Therneau", since Terry Therneau is the author of survival. (The answer is closer to the first than to the second.) > > Kind regards, > andi > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From ccquant at gmail.com Thu Dec 1 18:54:28 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 10:54:28 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wdunlap at tibco.com Thu Dec 1 19:00:20 2011 From: wdunlap at tibco.com (William Dunlap) Date: Thu, 1 Dec 2011 18:00:20 +0000 Subject: [R] What's the baseline model when using coxph with factor variables? In-Reply-To: <5BC18E4E-FF2B-4689-AEB9-A755B027B986@comcast.net> References: <4ED7B2A9.1090607@nki.nl> <5BC18E4E-FF2B-4689-AEB9-A755B027B986@comcast.net> Message-ID: Terry will correct me if I'm wrong, but I don't think the answer to this question is specific to the coxph function. For all the [well-written] formula-based modelling functions (essentially, those that call model.frame and model.matrix to interpret the formula) the option "contrasts" controls how factor variables are parameterized in the model matrix. contr.treatment makes the baseline the first factor level, contr.SAS makes the baseline the last, contr.sum makes the baseline the mean, etc. E.g., > df <- data.frame(time=sin(1:20)+2, cens=rep(c(0,0,1), len=20), var1=factor(rep(0:1, each=10)), var2=factor(rep(0:1, 10))) > options(contrasts=c("contr.treatment", "contr.treatment")) > coxph(Surv(time, cens) ~ var1 + var2, data=df) Call: coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) coef exp(coef) se(coef) z p var11 0.1640 1.18 0.822 0.1995 0.84 var21 0.0806 1.08 0.830 0.0971 0.92 Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of events= 6 > options(contrasts=c("contr.SAS", "contr.SAS")) > coxph(Surv(time, cens) ~ var1 + var2, data=df) Call: coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) coef exp(coef) se(coef) z p var10 -0.1640 0.849 0.822 -0.1995 0.84 var20 -0.0806 0.923 0.830 -0.0971 0.92 Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of events= 6 > options(contrasts=c("contr.sum", "contr.sum")) > coxph(Surv(time, cens) ~ var1 + var2, data=df) Call: coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) coef exp(coef) se(coef) z p var11 -0.0820 0.921 0.411 -0.1995 0.84 var21 -0.0403 0.960 0.415 -0.0971 0.92 Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of events= 6 (lm() has a contrasts argument that can override getOption("contrasts") and set different contrasts for each variable but coxph() does not have that argument.) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of David Winsemius > Sent: Thursday, December 01, 2011 9:36 AM > To: a.schlicker at nki.nl > Cc: r-help at r-project.org > Subject: Re: [R] What's the baseline model when using coxph with factor variables? > > > On Dec 1, 2011, at 12:00 PM, Andreas Schlicker wrote: > > > Hi all, > > > > I'm trying to fit a Cox regression model with two factor variables > > but have some problems with the interpretation of the results. > > Considering the following model, where var1 and var2 can assume > > value 0 and 1: > > > > coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) > > > > What is the baseline model? Is that considering the whole population > > or the case when both var1 and var2 = 0? > > This has been discussed several times in the past on rhelp. My > suggestion would be to search your favorite rhelp archive using > "baseline hazard Therneau", since Terry Therneau is the author of > survival. (The answer is closer to the first than to the second.) > > > > > Kind regards, > > andi > > > > ______________________________________________ > > R-help at 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 code. > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at 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 code. From gunter.berton at gene.com Thu Dec 1 19:05:03 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Thu, 1 Dec 2011 10:05:03 -0800 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: ## It's not a data frame -- it's just a vector. > x [1] "abc/def" "ghi/jkl/mno" > gsub("[^/]","",x) [1] "/" "//" > nchar(gsub("[^/]","",x)) [1] 1 2 > ?gsub ?nchar -- Bert On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault wrote: > I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. > > My dataframe, x, ?is structured as below: > > Col1 > abc/def > ghi/jkl/mno > > I found this code on the board but it counts all occurrences of "/" in the dataframe. > > chr.pos <- which(unlist(strsplit(x,NULL))=='/') > chr.count <- length(chr.pos) > chr.count > [1] 3 > > I'd like to append a column, say cnt, that has the count of "/" for each row. > > Can anyone point me in the right direction or offer some code to do this? > > Thanks in advance for the help. > > Doug Esneault > > > > > > > Privileged/Confidential Information may be contained in this message. If you > are not the addressee indicated in this message (or responsible for delivery > of the message to such person), you may not copy or deliver this message to > anyone. In such case, you should destroy this message and kindly notify the > sender by reply email. Please advise immediately if you or your employer > does not consent to email for messages of this kind. Opinions, conclusions > and other information in this message that do not relate to the official > business of the GroupM companies shall be understood as neither given nor > endorsed by it. ? GroupM companies are a member of WPP plc. For more > information on our business ethical standards and Corporate Responsibility > policies please refer to our website at > http://www.wpp.com/WPP/About/ > > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From michael.weylandt at gmail.com Thu Dec 1 19:29:13 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 13:29:13 -0500 Subject: [R] Writing a function, want a string argument to define the name of the excel sheet to be called In-Reply-To: <1322748601119-4128495.post@n4.nabble.com> References: <1322747017324-4128384.post@n4.nabble.com> <1DE876CE-60DE-46B7-A0AF-CF40B7E9BE12@depauw.edu> <1322748601119-4128495.post@n4.nabble.com> Message-ID: Just a heads up -- I don't think your code will work with an actual .xls(x) file, only .txt, .csv, etc (aka, plain text files). I may be wrong about that, but if you actually need to work with Excel files directly you will need an additional package. Michael On Thu, Dec 1, 2011 at 9:10 AM, AOLeary wrote: > Thank you very much, that does exactly what I want it to! :) > > Aodh?n > > -- > View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128495.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From saschaview at gmail.com Thu Dec 1 19:30:18 2011 From: saschaview at gmail.com (saschaview at gmail.com) Date: Thu, 1 Dec 2011 19:30:18 +0100 Subject: [R] transform data.frame holding answers --> data.frame holding logicals Message-ID: <4ED7C7BA.7040408@gmail.com> Hello Hello I have a data frame, x, holding 5 persons answering the question which cars they have used: # the data frame x <- as.data.frame( matrix( c('BMW', '', '', 'Mercedes', 'VW', '', 'Skoda', 'VW', 'BMW', '', '', '', 'VW', 'Skoda', '' ), ncol=3, dimnames=list( NULL, paste( 'v', 1:3, sep='' ) ) ) ) How do I transform this data frame to a data frame stating whether they have used the presented car: BMW Mercedes VW Skoda 1 T F F F 2 F T T F 3 T F T T 4 F F F F 5 F F T T My idea was to first find all levels by: v <- unique(unlist(lapply(x, levels))) But then I am stuck. Thanks for help, *S* -- Sascha Vieweg, saschaview at gmail.com From michael.weylandt at gmail.com Thu Dec 1 19:41:18 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 13:41:18 -0500 Subject: [R] Replace columns in a data.frame randomly splitted In-Reply-To: <1322726049879-4127405.post@n4.nabble.com> References: <1322658929391-4122926.post@n4.nabble.com> <1322726049879-4127405.post@n4.nabble.com> Message-ID: I repeat myself: Any more automated solution will depend on whether your data has rownames or not. [...] create a plain text representation of R data using the dput() command. Another way that might make more sense is to cbind() the data you need later on before the split and then it will be carried through. Michael On Thu, Dec 1, 2011 at 2:54 AM, agent dunham wrote: > > > The thing is that I've already been working with df1, and I was looking for > a function that could replace values knowing rows and columns. Does it > exist? > > Thank you, user at host.com > > -- > View this message in context: http://r.789695.n4.nabble.com/Replace-columns-in-a-data-frame-randomly-splitted-tp4122926p4127405.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From pdalgd at gmail.com Thu Dec 1 19:55:18 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Thu, 1 Dec 2011 19:55:18 +0100 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: Message-ID: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> On Dec 1, 2011, at 18:54 , Ben quant wrote: > Sorry if this is a duplicate: This is a re-post because the pdf's mentioned > below did not go through. Still not there. Sometimes it's because your mailer doesn't label them with the appropriate mime-type (e.g. as application/octet-stream, which is "arbitrary binary"). Anyways, see below [snip] > > With the above data I do: >> l_logit = glm(y~x, data=as.data.frame(l_yx), > family=binomial(link="logit")) > Warning message: > glm.fit: fitted probabilities numerically 0 or 1 occurred > > Why am I getting this warning when I have data points of varying values for > y=1 and y=0? In other words, I don't think I have the linear separation > issue discussed in one of the links I provided. I bet that you do... You can get the warning without that effect (one of my own examples is the probability of menarche in a data set that includes infants and old age pensioners), but not with a huge odds ratio as well. Take a look at d <- as.data.frame(l_yx) with(d, y[order(x)]) if it comes out as all zeros followed by all ones or vice versa, then you have the problem. > > PS - Then I do this and I get a odds ratio a crazy size: >> l_sm = summary(l_logit) # coef pval is $coefficients[8], log odds > $coefficients[2] >> l_exp_coef = exp(l_logit$coefficients)[2] # exponentiate the > coeffcients >> l_exp_coef > x > 3161.781 > > So for one unit increase in the predictor variable I get 3160.781% > (3161.781 - 1 = 3160.781) increase in odds? That can't be correct either. > How do I correct for this issue? (I tried multiplying the predictor > variables by a constant and the odds ratio goes down, but the warning above > still persists and shouldn't the odds ratio be predictor variable size > independent?) -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From javier.cano at urjc.es Thu Dec 1 19:12:03 2011 From: javier.cano at urjc.es (jcano) Date: Thu, 1 Dec 2011 10:12:03 -0800 (PST) Subject: [R] Change the limits of a plot "a posteriori" Message-ID: <1322763123687-4129750.post@n4.nabble.com> Hi all How can I change the limits (xlim or ylim) in a plot that has been already created? For example, consider this naive example curve(dbeta(x,2,4)) curve(dbeta(x,8,13),add=T,col=2) When adding the second curve, it goes off the original limits computed by R for the first graph, which are roughly, c(0,2.1) I know two obvious solutions for this, which are: 1) passing a sufficiently large parameter e.g. ylim=c(0,4) to the first graphic curve(dbeta(x,2,4),ylim=c(0,4)) curve(dbeta(x,8,13),add=T,col=2) or 2) switch the order in which I plot the curves curve(dbeta(x,8,13),col=2) curve(dbeta(x,2,4),add=T) but I guess if there is any way of adjusting the limits of the graphic "a posteriori", once you have a plot with the undesired limits, forcing R to redraw it with the new limits, but without having to execute again the "curve" commands Hope I made myself clear Best regards and thank you very much in advance -- View this message in context: http://r.789695.n4.nabble.com/Change-the-limits-of-a-plot-a-posteriori-tp4129750p4129750.html Sent from the R help mailing list archive at Nabble.com. From l.glew at soton.ac.uk Thu Dec 1 19:13:18 2011 From: l.glew at soton.ac.uk (lglew) Date: Thu, 1 Dec 2011 10:13:18 -0800 (PST) Subject: [R] Assign name to object for each iteration in a loop. Message-ID: <1322763198075-4129752.post@n4.nabble.com> Hi R-users, I'm trying to produce decompositions of a multiple time-series, grouped by a factor (called "area"). I'm modifying the code in the STLperArea function of package ndvits, as this function only plots produces stl plots, it does not return the underlying data. I want to extract the trend component of each decomposition ("x$time.series[,trend]), assign a name based on the factor "area". My input data look like this: Area is a factor, with three (but could be many more) levels. area 1 2 3 Ystart=2000 TS is a timeseries: X2000049 X2000065 X2000081 X2000097 X2000113 1 0.2080 0.2165 0.2149 0.2314 0.2028 2 0.1578 0.1671 0.1577 0.1593 0.1672 3 0.1897 0.1948 0.2290 0.2292 0.2067 Here's the function: STLpA<-function(TS, area, Ystart, period=23, nSG="5,5", DSG=0) { require (RTisean) for(i in 1:unique(area)){ vi.metric=TS[area==i] filt.vi<-sav_gol(vi.metric,n=nSG,D=DSG) vi.sg<-ts(filt.vi[,1], start=Ystart,frequency=period) stld.tmp<-stl(vi.sg, s.window="periodic", robust=TRUE, na.action=na.approx) stld.trend<-stld.temp$time.series[,trend] } assign(paste("stld", i , sep= "."), stld.trend) vi.trend<-ls(pattern= "^stld..$") return(vi.trend) } When I call this function with signal=STLpA(TS,area,Ystart=2000,period=23, nSG= "5,5", DSG="0")) I get this error: Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be handled by 'cat' In addition: Warning message: In 1:unique(area) : numerical expression has 3 elements: only the first used I'm guessing this is because I'm assigning names to each temporary stl.trend file incorrectly. Can anyone improve on my rather poor efforts here? Many thanks, Louise -- View this message in context: http://r.789695.n4.nabble.com/Assign-name-to-object-for-each-iteration-in-a-loop-tp4129752p4129752.html Sent from the R help mailing list archive at Nabble.com. From chl2016 at med.cornell.edu Thu Dec 1 19:38:17 2011 From: chl2016 at med.cornell.edu (Charles Li) Date: Thu, 01 Dec 2011 13:38:17 -0500 Subject: [R] nested random effects with lmer Message-ID: <002201ccb058$649a0d90$2dce28b0$@med.cornell.edu> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From vytautas1987 at yahoo.com Thu Dec 1 20:26:51 2011 From: vytautas1987 at yahoo.com (Vytautas Rakeviius) Date: Thu, 1 Dec 2011 11:26:51 -0800 (PST) Subject: [R] question about plsr() results Message-ID: <1322767611.79460.YahooMailNeo@web121513.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jvadams at usgs.gov Thu Dec 1 20:30:51 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Thu, 1 Dec 2011 13:30:51 -0600 Subject: [R] Change the limits of a plot "a posteriori" In-Reply-To: <1322763123687-4129750.post@n4.nabble.com> References: <1322763123687-4129750.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 1 20:33:31 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 14:33:31 -0500 Subject: [R] Assign name to object for each iteration in a loop. In-Reply-To: <1322763198075-4129752.post@n4.nabble.com> References: <1322763198075-4129752.post@n4.nabble.com> Message-ID: I think part of your problem is the loop: you probably mean for(i in unique(area)) Michael On Thu, Dec 1, 2011 at 1:13 PM, lglew wrote: > Hi R-users, > > I'm trying to produce decompositions of a multiple time-series, grouped by a > factor (called "area"). I'm modifying the code in the STLperArea function of > package ndvits, as this function only plots produces stl plots, it does not > return the underlying data. > > I want to extract the trend component of each decomposition > ("x$time.series[,trend]), assign a name based on the factor "area". > > My input data look like this: > Area is a factor, with three (but could be many more) levels. > area > 1 > 2 > 3 > > Ystart=2000 > > TS is a timeseries: > > ?X2000049 ? X2000065 ?X2000081 ?X2000097 ?X2000113 > 1 ? ? 0.2080 ? ? ?0.2165 ? ? ?0.2149 ? ? 0.2314 ? ? ?0.2028 > 2 ? ? 0.1578 ? ? ?0.1671 ? ? ?0.1577 ? ? 0.1593 ? ? ?0.1672 > 3 ? ? 0.1897 ? ? ?0.1948 ? ? ?0.2290 ? ? 0.2292 ? ? ?0.2067 > > Here's the function: > > STLpA<-function(TS, area, Ystart, period=23, nSG="5,5", DSG=0) > { > require (RTisean) > for(i in 1:unique(area)){ > vi.metric=TS[area==i] > filt.vi<-sav_gol(vi.metric,n=nSG,D=DSG) > vi.sg<-ts(filt.vi[,1], start=Ystart,frequency=period) > stld.tmp<-stl(vi.sg, s.window="periodic", robust=TRUE, na.action=na.approx) > stld.trend<-stld.temp$time.series[,trend] > } > assign(paste("stld", i , sep= "."), stld.trend) > vi.trend<-ls(pattern= "^stld..$") > return(vi.trend) > } > > When I call this function with signal=STLpA(TS,area,Ystart=2000,period=23, > nSG= "5,5", DSG="0")) > > I get this error: > > Error in cat(list(...), file, sep, fill, labels, append) : > ?argument 1 (type 'list') cannot be handled by 'cat' > In addition: Warning message: > In 1:unique(area) : > ?numerical expression has 3 elements: only the first used > > I'm guessing this is because I'm assigning names to each temporary stl.trend > file incorrectly. Can anyone > improve on my rather poor efforts here? > > Many thanks, > > Louise > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Assign-name-to-object-for-each-iteration-in-a-loop-tp4129752p4129752.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From mayer at psychologie.tu-dresden.de Thu Dec 1 20:33:58 2011 From: mayer at psychologie.tu-dresden.de (=?iso-8859-1?b?UmVu6Q==?= Mayer) Date: Thu, 01 Dec 2011 20:33:58 +0100 Subject: [R] how to get inflection point in binomial glm In-Reply-To: <115F31EC-7960-4157-B70E-A4DB76D5C2DE@comcast.net> References: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de> <115F31EC-7960-4157-B70E-A4DB76D5C2DE@comcast.net> Message-ID: <20111201203358.19674ghe8483ub3a@psy2.psych.tu-dresden.de> Thanks David and Rub?n! @David: indeed 15 betas I forgot the interaction terms, thanks for correcting! @Rub?n: the re-parameterize would be done within nls()? how to do this practically with including the factor predictor? and yes, we can solve within each group for Y=0 getting 0=b0+b1*X |-b0 -b0=b1*X |/b1 -b0/b1=X but I was hoping there might a more general solution for the case of multiple logistic regression. HTH Ren? Zitat von "David Winsemius" : > > On Dec 1, 2011, at 8:24 AM, Ren? Mayer wrote: > >> Dear All, >> >> I have a binomial response with one continuous predictor (d) and >> one factor (g) (8 levels dummy-coded). >> >> glm(resp~d*g, data, family=binomial) >> >> Y=b0+b1*X1+b2*X2 ... b7*X7 > > Dear Dr Mayer; > > I think it might be a bit more complex than that. I think you should > get 15 betas rather than 8. Have you done it? > >> >> how can I get the inflection point per group, e.g., P(d)=.5 > > Wouldn't that just be at d=1/beta in each group? (Thinking, perhaps > naively, in the case of X=X1 that > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta *d*(X==X1) ) # all other terms = 0 > > And taking the log of both sides, and then use "middle school" math to solve. > > Oh, wait. Muffed my first try on that for sure. Need to add back > both the constant intercept and the baseline "d" coefficient for the > non-b0 levels. > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d + > beta_n + beta_d_n *d*(X==Xn) ) > > And just > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d ) # for the > reference level. > > This felt like an exam question in my categorical analysis course 25 > years ago. (Might have gotten partial credit for my first stab, > depending on how forgiving the TA was that night.) > >> >> I would be grateful for any help. >> >> Thanks in advance, >> Ren? >> > -- > > David Winsemius, MD > West Hartford, CT > > From murdoch.duncan at gmail.com Thu Dec 1 20:34:46 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Thu, 01 Dec 2011 14:34:46 -0500 Subject: [R] Change the limits of a plot "a posteriori" In-Reply-To: <1322763123687-4129750.post@n4.nabble.com> References: <1322763123687-4129750.post@n4.nabble.com> Message-ID: <4ED7D6D6.9030507@gmail.com> On 01/12/2011 1:12 PM, jcano wrote: > Hi all > > How can I change the limits (xlim or ylim) in a plot that has been already > created? You can't, if you're using classic R graphics. They use an "ink on paper" model of graphics. If you want to change what you've drawn, you get a new piece of paper. Your two solutions below are the usual methods to work around this limitation. The first is the easiest method in general, though it's not particularly easy if you're using curve(). Generally if you're planning to plot y1 vs x1 and y2 vs x2, you can set your ylim to range(c(y1, y2)) and your xlim to range(c(x1, x2)) and things are fine. If you want to follow this strategy with curve(), you need to call it twice for each curve: once to find the range of points it would plot (they are in the return value of the function), and a second time to redo the plot with the calculated xlim and ylim. Duncan Murdoch > For example, consider this naive example > curve(dbeta(x,2,4)) > curve(dbeta(x,8,13),add=T,col=2) > > When adding the second curve, it goes off the original limits computed by R > for the first graph, which are roughly, c(0,2.1) > > I know two obvious solutions for this, which are: > 1) passing a sufficiently large parameter e.g. ylim=c(0,4) to the first > graphic > curve(dbeta(x,2,4),ylim=c(0,4)) > curve(dbeta(x,8,13),add=T,col=2) > > or > > 2) switch the order in which I plot the curves > curve(dbeta(x,8,13),col=2) > curve(dbeta(x,2,4),add=T) > > but I guess if there is any way of adjusting the limits of the graphic "a > posteriori", once you have a plot with the undesired limits, forcing R to > redraw it with the new limits, but without having to execute again the > "curve" commands > > Hope I made myself clear > > Best regards and thank you very much in advance > > > -- > View this message in context: http://r.789695.n4.nabble.com/Change-the-limits-of-a-plot-a-posteriori-tp4129750p4129750.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From jvadams at usgs.gov Thu Dec 1 20:42:54 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Thu, 1 Dec 2011 13:42:54 -0600 Subject: [R] transform data.frame holding answers --> data.frame holding logicals In-Reply-To: <4ED7C7BA.7040408@gmail.com> References: <4ED7C7BA.7040408@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Thu Dec 1 20:51:55 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 14:51:55 -0500 Subject: [R] vector In-Reply-To: <1322768580.9896.YahooMailNeo@web113613.mail.gq1.yahoo.com> References: <1322753704.39854.YahooMailNeo@web113611.mail.gq1.yahoo.com> <1322768580.9896.YahooMailNeo@web113613.mail.gq1.yahoo.com> Message-ID: Hi, On Thu, Dec 1, 2011 at 2:43 PM, " Majid " wrote: > Dear Sarah. > Thanks so much,Really I am new in this software,I am wrking to learn the > software. First, you should always send your replies to the list. That way information can help others, and more people are available to provide advice. Second, is this homework? Third, see below. > I have this sample and I was checking it : > #========Generating data=============== > > # in here we produce patterned data > #Do this and see what will happen: > > 1:10 > > # now put this seri in a vector > > a1 <- c (1:10) > > #====================================== > > > > #Do this and see what will happen: > seq(1, 5, 0.5) > > # now put this seri in a vector > > a2 <- c (seq(1, 5, 0.5)) > > Can you please learn me what is the matter? about these orders ? Nothing is wrong with these commands. Both make vectors. The c() is unnecessary in both cases, but still works. If this is not homework, you still need to explain what you *expect* to have happen, otherwise nobody can help you. Sarah -- Sarah Goslee http://www.functionaldiversity.org From dwinsemius at comcast.net Thu Dec 1 20:56:13 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 14:56:13 -0500 Subject: [R] What's the baseline model when using coxph with factor variables? In-Reply-To: References: <4ED7B2A9.1090607@nki.nl> <5BC18E4E-FF2B-4689-AEB9-A755B027B986@comcast.net> Message-ID: On Dec 1, 2011, at 1:00 PM, William Dunlap wrote: > Terry will correct me if I'm wrong, but I don't think the > answer to this question is specific to the coxph function. It depends on our interpretation of the questioner's intent. My answer was predicated on the assumption that the phrase "baseline model" meant baseline survival function, ... S_0(t) in survival analysis notation. > For all the [well-written] formula-based modelling functions > (essentially, those that call model.frame and model.matrix to > interpret > the formula) the option "contrasts" controls how factor > variables are parameterized in the model matrix. contr.treatment > makes the baseline the first factor level, contr.SAS makes > the baseline the last, contr.sum makes the baseline the mean, > etc. E.g., > >> df <- data.frame(time=sin(1:20)+2, > cens=rep(c(0,0,1), len=20), > var1=factor(rep(0:1, each=10)), > var2=factor(rep(0:1, 10))) >> options(contrasts=c("contr.treatment", "contr.treatment")) >> coxph(Surv(time, cens) ~ var1 + var2, data=df) > Call: > coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) > > > coef exp(coef) se(coef) z p > var11 0.1640 1.18 0.822 0.1995 0.84 > var21 0.0806 1.08 0.830 0.0971 0.92 > > Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of > events= 6 >> options(contrasts=c("contr.SAS", "contr.SAS")) >> coxph(Surv(time, cens) ~ var1 + var2, data=df) > Call: > coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) > > > coef exp(coef) se(coef) z p > var10 -0.1640 0.849 0.822 -0.1995 0.84 > var20 -0.0806 0.923 0.830 -0.0971 0.92 > > Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of > events= 6 >> options(contrasts=c("contr.sum", "contr.sum")) >> coxph(Surv(time, cens) ~ var1 + var2, data=df) > Call: > coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) > > > coef exp(coef) se(coef) z p > var11 -0.0820 0.921 0.411 -0.1995 0.84 > var21 -0.0403 0.960 0.415 -0.0971 0.92 > > Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of > events= 6 > > (lm() has a contrasts argument that can override > getOption("contrasts") > and set different contrasts for each variable but coxph() does not > have > that argument.) > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -----Original Message----- >> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org >> ] On Behalf Of David Winsemius >> Sent: Thursday, December 01, 2011 9:36 AM >> To: a.schlicker at nki.nl >> Cc: r-help at r-project.org >> Subject: Re: [R] What's the baseline model when using coxph with >> factor variables? >> >> >> On Dec 1, 2011, at 12:00 PM, Andreas Schlicker wrote: >> >>> Hi all, >>> >>> I'm trying to fit a Cox regression model with two factor variables >>> but have some problems with the interpretation of the results. >>> Considering the following model, where var1 and var2 can assume >>> value 0 and 1: >>> >>> coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) >>> >>> What is the baseline model? Is that considering the whole population >>> or the case when both var1 and var2 = 0? >> >> This has been discussed several times in the past on rhelp. My >> suggestion would be to search your favorite rhelp archive using >> "baseline hazard Therneau", since Terry Therneau is the author of >> survival. (The answer is closer to the first than to the second.) >> >>> >>> Kind regards, >>> andi >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> David Winsemius, MD >> West Hartford, CT >> >> ______________________________________________ >> R-help at 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 code. David Winsemius, MD West Hartford, CT From sarah.goslee at gmail.com Thu Dec 1 21:28:42 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 15:28:42 -0500 Subject: [R] vector In-Reply-To: <1322770304.65123.YahooMailNeo@web113615.mail.gq1.yahoo.com> References: <1322753704.39854.YahooMailNeo@web113611.mail.gq1.yahoo.com> <1322768580.9896.YahooMailNeo@web113613.mail.gq1.yahoo.com> <1322770304.65123.YahooMailNeo@web113615.mail.gq1.yahoo.com> Message-ID: On Thu, Dec 1, 2011 at 3:11 PM, " Majid " wrote: > Hi, > yes, It is homework, Then ask your TA/instructor for help. > > These are 2 command: > first for generating data: > (1:10) > that output is 1 2 3....10 > ok ? > second is : > a1<-c( 1:10) > what is the output ?I didnot see any thing. Exactly as it should be. There's no problem here, except that you need to read help("<-") > Thanks, > Majid. > -- Sarah Goslee http://www.functionaldiversity.org From ccquant at gmail.com Thu Dec 1 21:32:35 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 13:32:35 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jabezwuk at yahoo.co.uk Thu Dec 1 21:45:14 2011 From: jabezwuk at yahoo.co.uk (Jabez Wilson) Date: Thu, 1 Dec 2011 20:45:14 +0000 Subject: [R] calculate mean of multiple rows in a data frame Message-ID: <1322772314.57483.YahooMailClassic@web28515.mail.ukl.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 1 22:10:21 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 16:10:21 -0500 Subject: [R] combining arima and ar function In-Reply-To: <000601ccb00f$9e403db0$dac0b910$@ch> References: <000601ccb00f$9e403db0$dac0b910$@ch> Message-ID: I think your attachment got scrubbed so I can't verify this, but i think the difficulty is that the "inner" apply returns a whole set of orders, instead of just one and that throws arima off: would this work? getOrder <- function(x) ar(na.omit(x), method = "mle")$order all.equal(apply(TSX, 2, getOrder), apply(TSX,2, function(x) ar(na.omit(x),method="mle")$order) # Verify it works. apply(TSX,2,function(x)arima(x,order=c(getOrder(x),0,0))$residuals Michael On Thu, Dec 1, 2011 at 4:57 AM, Samir Benzerfa wrote: > Hi everyone > > > > I've got a problem regarding the arima() and the ar() function for > autoregressive series. I would simply like to combine them. > > > > To better understand my question, I first show you how I'm using these two > functions individually (see file in the attachement). > > > > 1) ? ? ?apply(TSX,2, function(x) ar(na.omit(x),method="mle")$order > # this function finds the optimal (autoregressive) order for each series > (briefly speaking: for each series I get a specific number) > > 2) ? ? ?apply(TSX,2,function(x)arima(x,order=c(1,0,0))$residuals > # this function puts an autoregressive model of order 1 on each series > > > > > > What I'd like to do, is to combine them, such that the resulting orders > (numbers) from the first function are used as orders in the second function. > So in the specific example attached the results from the first function are > 6,5,1 and these numbers should be used as the order in function two. I tried > to simply put the two functions together as follows: > > > > apply(TSX,2,function(x) arima(x,order=c((apply(TSX,2, > function(x)ar(na.omit(x),method="mle")$order))),0,0)) > > > > However, I get the error message " 'order' must be a non-negative numeric > vector of length 3". > > > > Any hints? I hope you can help me with this issue. > > > > Many thanks and best regards, S.B. > > > > > > > > > ______________________________________________ > R-help at 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 code. > From jabezwuk at yahoo.co.uk Thu Dec 1 22:15:39 2011 From: jabezwuk at yahoo.co.uk (Jabez Wilson) Date: Thu, 1 Dec 2011 21:15:39 +0000 Subject: [R] Fw: calculate mean of multiple rows in a data frame Message-ID: <1322774139.12733.YahooMailClassic@web28501.mail.ukl.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From pdalgd at gmail.com Thu Dec 1 22:24:20 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Thu, 1 Dec 2011 22:24:20 +0100 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: On Dec 1, 2011, at 21:32 , Ben quant wrote: > Thank you for the feedback, but my data looks fine to me. Please tell me if I'm not understanding. Hum, then maybe it really is a case of a transition region being short relative to the range of your data. Notice that the warning is just that: a warning. I do notice that the distribution of your x values is rather extreme -- you stated a range of 0--14 and a mean of 0.01. And after all, an odds ratio of 3000 per unit is only a tad over a doubling per 0.1 units. Have a look at range(x[y==0]) and range(x[y==1]). > > I followed your instructions and here is a sample of the first 500 values : (info on 'd' is below that) > > > d <- as.data.frame(l_yx) > > x = with(d, y[order(x)]) > > x[1:500] # I have 1's and 0's dispersed throughout > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 > [101] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [201] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 > [301] 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [401] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 > > # I get the warning still > > l_df = as.data.frame(l_yx) > > l_logit = glm(y~x, data=l_df, family=binomial(link="logit")) > > Warning message: > glm.fit: fitted probabilities numerically 0 or 1 occurred > > # some info on 'd' above: > > > d[1:500,1] > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [101] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [201] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [301] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > [401] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > d[1:500,2] > [1] 3.023160e-03 7.932130e-02 0.000000e+00 1.779657e-02 1.608374e-01 0.000000e+00 5.577064e-02 7.753926e-03 4.018553e-03 4.760918e-02 2.080511e-02 1.642404e-01 3.703720e-03 8.901981e-02 1.260415e-03 > [16] 2.202523e-02 3.750940e-02 4.441975e-04 9.351171e-03 8.374567e-03 0.000000e+00 8.440448e-02 5.081017e-01 2.538640e-05 1.806017e-02 2.954641e-04 1.434859e-03 6.964976e-04 0.000000e+00 1.202162e-02 > [31] 3.420300e-03 4.276100e-02 1.457324e-02 4.140121e-03 1.349180e-04 1.525292e-03 4.817502e-02 9.515717e-03 2.232953e-02 1.227908e-01 3.293581e-02 1.454352e-02 1.176011e-03 6.274138e-02 2.879205e-02 > [46] 6.900926e-03 1.414648e-04 3.446349e-02 8.807174e-03 3.549332e-02 2.828509e-03 2.935003e-02 7.162872e-03 5.650050e-03 1.221191e-02 0.000000e+00 2.126334e-02 2.052020e-02 7.542409e-02 2.586269e-04 > [61] 5.258664e-02 1.213126e-02 1.493275e-02 8.152657e-03 1.774966e-02 2.433198e-02 1.371257e-02 6.732339e-02 9.747677e-03 8.180594e-03 1.882473e-01 1.682596e-03 1.410170e-02 8.429676e-03 3.520589e-01 > [76] 1.865160e-02 2.389941e-02 3.301558e-02 4.896605e-03 6.826244e-03 9.151337e-02 1.722270e-02 1.764039e-01 3.554063e-02 7.338532e-03 9.577793e-03 3.632366e-03 1.422400e-02 3.020497e-02 1.797096e-02 > [91] 2.577899e-03 1.338365e-01 8.202223e-03 1.088335e-02 2.137259e-02 6.829797e-03 3.104860e-04 8.927160e-03 5.626881e-02 1.197682e-02 6.140553e-02 2.729364e-02 1.377913e-02 3.018277e-03 1.188304e-02 > [106] 2.029268e-03 2.108815e-02 1.765503e-03 2.449253e-02 3.677046e-03 1.013463e-02 4.286642e-02 1.238931e-02 3.072090e-03 1.509613e-02 3.609885e-02 5.537268e-03 3.151614e-02 3.703148e-03 1.409401e-01 > [121] 1.473365e-02 9.160461e-03 1.035099e-01 3.005865e-02 1.332199e-02 6.936535e-03 2.433539e-02 4.935373e-03 4.822740e-03 1.597643e-03 3.805619e-03 1.092683e-02 1.760635e-01 5.565614e-03 7.739213e-04 > [136] 4.529198e-03 5.110359e-03 7.391258e-02 5.018207e-03 2.071417e-02 1.825787e-02 9.141405e-03 1.078386e-01 2.171470e-04 7.164583e-03 2.522077e-02 1.994428e-03 6.044653e-03 1.778078e-04 5.797706e-03 > [151] 1.526778e-02 1.595897e-02 1.995627e-01 1.946735e-03 6.711582e-02 2.722350e-02 3.127499e-02 1.074904e-01 2.477414e-03 5.015375e-02 3.417810e-02 2.046643e-02 1.644832e-02 5.220166e-03 1.217752e-02 > [166] 1.187352e-02 1.634016e-02 2.349568e-03 3.451811e-02 2.593540e-03 6.868595e-03 1.311236e-02 6.457757e-03 2.942391e-04 1.628352e-02 8.288831e-03 3.170856e-04 1.251331e+00 1.706954e-02 1.063723e-03 > [181] 1.374416e-02 2.140507e-02 2.817009e-02 2.272793e-02 4.365562e-02 6.089414e-03 2.498083e-02 1.360471e-02 1.884079e-02 1.448660e-02 2.341314e-02 8.167064e-03 4.109117e-02 2.660633e-02 7.711723e-03 > [196] 9.590278e-03 2.515490e-03 1.978033e-02 3.454990e-02 8.072748e-03 4.718885e-03 1.621131e-01 4.547743e-03 1.081195e-02 9.572051e-04 1.790391e-02 1.618026e-02 1.910230e-02 1.861914e-02 3.485475e-02 > [211] 2.844890e-03 1.866889e-02 1.378208e-02 2.451514e-02 2.535044e-03 3.921364e-04 1.557266e-03 3.315892e-03 1.752821e-03 6.786187e-03 1.360921e-02 9.550702e-03 8.114506e-03 5.068741e-03 1.729822e-02 > [226] 1.902033e-02 8.196564e-03 2.632880e-03 1.587969e-02 8.354079e-04 1.050023e-03 4.236195e-04 9.181120e-03 4.995919e-04 1.092234e-02 1.207544e-02 2.187243e-01 3.251349e-02 1.269134e-03 1.557751e-04 > [241] 1.232498e-02 2.654449e-02 1.049324e-03 8.442729e-03 6.331691e-03 1.715609e-02 1.017800e-03 9.230006e-03 1.331373e-02 5.596195e-02 1.296551e-03 5.272687e-03 2.805640e-02 4.790665e-02 2.043011e-02 > [256] 1.047226e-02 1.866499e-02 9.323001e-03 8.920536e-03 1.582911e-03 2.776238e-03 2.914762e-02 4.402356e-03 9.555274e-04 1.681966e-03 7.584319e-04 6.758914e-02 1.505431e-02 2.213308e-02 1.329330e-02 > [271] 7.284363e-03 2.687818e-02 2.997535e-03 7.470007e-03 2.070569e-03 3.441944e-02 1.717768e-02 4.523364e-02 1.003558e-02 1.365111e-02 1.906845e-02 1.676223e-02 3.506809e-04 9.164257e-02 9.008416e-03 > [286] 1.073903e-02 4.855937e-03 8.618043e-03 2.529247e-02 1.059375e-02 5.834253e-03 2.004309e-02 1.460387e-02 2.899190e-02 5.867984e-03 1.983956e-02 6.834339e-03 1.925821e-03 9.231870e-03 6.839616e-03 > [301] 1.029972e-02 2.009769e-02 9.458785e-03 1.183901e-02 8.911549e-03 1.264745e-02 2.995451e-03 7.657983e-04 5.315853e-03 1.325039e-02 1.044103e-02 2.307236e-02 2.780789e-02 1.735145e-02 9.053126e-03 > [316] 5.847638e-02 3.815715e-03 5.087690e-03 1.040513e-02 4.475672e-02 6.564791e-02 3.233571e-03 1.076193e-02 8.283819e-02 5.370256e-03 3.533256e-02 1.302812e-02 1.896783e-02 2.055282e-02 3.572239e-03 > [331] 5.867681e-03 5.864974e-04 9.715807e-03 1.665469e-02 5.082044e-02 3.547168e-03 3.069631e-03 1.274717e-02 1.858226e-03 3.104809e-04 1.247831e-02 2.073575e-03 3.544110e-04 7.240736e-03 8.452117e-05 > [346] 8.149151e-04 4.942461e-05 1.142303e-03 6.265512e-04 3.666717e-04 3.244669e-02 7.242018e-03 6.335951e-04 2.329072e-02 3.719716e-03 2.803425e-02 1.623981e-02 6.387102e-03 8.807679e-03 1.214914e-02 > [361] 6.699341e-03 1.148082e-02 1.329736e-02 1.537364e-03 2.004390e-02 1.562065e-02 1.655465e-02 9.960172e-02 2.174588e-02 1.209472e-02 2.328413e-02 2.012760e-04 1.422327e-02 2.194455e-03 2.307362e-02 > [376] 4.315764e-03 3.208576e-02 3.826598e-02 1.828001e-02 3.935978e-03 5.294211e-04 1.392423e-02 6.588394e-03 1.040147e-03 1.260787e-02 9.051757e-04 5.353215e-02 6.049058e-02 1.382630e-01 1.064124e-01 > [391] 3.380742e-03 1.798038e-02 1.557048e-01 1.217146e-02 4.140520e-02 4.707564e-02 2.786042e-02 8.836988e-03 5.542879e-03 1.862664e-02 8.858770e-03 1.026681e-03 1.692105e-02 8.849238e-03 7.143816e-03 > [406] 1.630118e-02 1.165920e-01 9.471496e-03 4.879998e-02 1.388216e-02 1.453267e-02 4.845224e-04 1.415190e-03 1.208627e-02 1.372348e-02 2.573131e-02 1.169595e-02 1.825447e-02 2.574299e-02 5.301360e-02 > [421] 6.961110e-03 7.781891e-03 1.013308e-03 3.160916e-03 1.090344e-02 1.530841e-02 9.398088e-04 9.143726e-04 1.286683e-02 2.006193e-02 1.774378e-02 5.681591e-02 9.584676e-03 7.957152e-02 4.485609e-03 > [436] 1.086684e-02 2.930273e-03 6.085481e-03 4.342320e-03 1.319999e-02 2.120402e-02 4.477545e-02 1.991814e-02 8.893947e-03 7.790133e-03 1.610199e-02 2.441280e-02 2.781231e-03 1.410080e-02 1.639912e-02 > [451] 1.797498e-02 1.185382e-02 2.775063e-02 3.797315e-02 1.428883e-02 1.272659e-02 2.390500e-03 7.503478e-03 8.965356e-03 2.139452e-02 2.028536e-02 6.916416e-02 1.615986e-02 4.837412e-02 1.561731e-02 > [466] 7.130332e-03 9.208406e-05 1.099934e-02 2.003469e-02 1.395857e-02 9.883482e-03 4.110852e-02 1.202052e-02 2.833039e-02 1.233236e-02 2.145801e-02 7.900161e-03 4.663819e-02 4.410819e-03 5.115056e-04 > [481] 9.100270e-04 4.013683e-03 1.227139e-02 3.304697e-03 2.919099e-03 6.112390e-03 1.922229e-02 1.208282e-03 1.164037e-02 2.166888e-02 4.381615e-02 5.318929e-03 7.226343e-03 2.732819e-02 2.385092e-04 > [496] 4.905250e-02 1.159876e-02 4.068228e-03 3.349013e-02 1.273468e-03 > > > Thanks for your help, > > Ben > > On Thu, Dec 1, 2011 at 11:55 AM, peter dalgaard wrote: > > On Dec 1, 2011, at 18:54 , Ben quant wrote: > > > Sorry if this is a duplicate: This is a re-post because the pdf's mentioned > > below did not go through. > > Still not there. Sometimes it's because your mailer doesn't label them with the appropriate mime-type (e.g. as application/octet-stream, which is "arbitrary binary"). Anyways, see below > > [snip] > > > > With the above data I do: > >> l_logit = glm(y~x, data=as.data.frame(l_yx), > > family=binomial(link="logit")) > > Warning message: > > glm.fit: fitted probabilities numerically 0 or 1 occurred > > > > Why am I getting this warning when I have data points of varying values for > > y=1 and y=0? In other words, I don't think I have the linear separation > > issue discussed in one of the links I provided. > > I bet that you do... You can get the warning without that effect (one of my own examples is the probability of menarche in a data set that includes infants and old age pensioners), but not with a huge odds ratio as well. Take a look at > > d <- as.data.frame(l_yx) > with(d, y[order(x)]) > > if it comes out as all zeros followed by all ones or vice versa, then you have the problem. > > > > > > PS - Then I do this and I get a odds ratio a crazy size: > >> l_sm = summary(l_logit) # coef pval is $coefficients[8], log odds > > $coefficients[2] > >> l_exp_coef = exp(l_logit$coefficients)[2] # exponentiate the > > coeffcients > >> l_exp_coef > > x > > 3161.781 > > > > So for one unit increase in the predictor variable I get 3160.781% > > (3161.781 - 1 = 3160.781) increase in odds? That can't be correct either. > > How do I correct for this issue? (I tried multiplying the predictor > > variables by a constant and the odds ratio goes down, but the warning above > > still persists and shouldn't the odds ratio be predictor variable size > > independent?) > > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > > -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From haavard.kongsgaard at gmail.com Thu Dec 1 22:26:31 2011 From: haavard.kongsgaard at gmail.com (=?ISO-8859-1?Q?H=E5vard_Wahl_Kongsg=E5rd?=) Date: Thu, 1 Dec 2011 22:26:31 +0100 Subject: [R] MCMCglmm error with multinomial distribution Message-ID: With binomial/binary responses (0|1) running MCMCglmm with family="multinomial" terminates with Error in if (nJ < 1) { : missing value where TRUE/FALSE needed with family="categorical" there are no errors I have not looked in the code, do I need format the responses TRUE/FALSE , or is this just a bug? -- H?vard Wahl Kongsg?rd From seth at userprimary.net Thu Dec 1 22:48:59 2011 From: seth at userprimary.net (Seth Falcon) Date: Thu, 1 Dec 2011 13:48:59 -0800 Subject: [R] [R-pkgs] RSQLite 0.11.0 Message-ID: <509CC1B4-BCC2-4AA1-B3E7-838379DC57A4@userprimary.net> A new version of RSQLite has been uploaded to CRAN. Details on the enhancements and fixes are below. Please direct questions to the R-sig-db mailing list. Version 0.11.0 - Enhance type detection in sqliteDataType (dbDataType). The storage mode of a data.frame column is now used as part of the type detection. Prior to this patch, all vectors with class other than numeric or logical were mapped to a TEXT column. This patch uses the output of storage.mode to map to integer and double vectors to INTEGER and REAL columns, respectively. All other modes are mapped to a TEXT column. - Detection of BLOBs was narrowed slightly. The code now treats only objects with data.class(obj) == "list" as BLOBs. Previously, is.list was used which could return TRUE for lists of various classes. - Fix bug in sqliteImportFile (used by dbWriteTable) that prevented a comment character from being specified for the input file. - Increase compile-time SQLite limits for maximum number of columns in a table to 30000 and maximum number of parameters (?N) in a SELECT to 40000. Use of wide tables is not encouraged. The default values for SQLite are 2000 and 999, respectively. Databases containing tables with more than 2000 columns may not be compatible with versions of SQLite compiled with default settings. - Upgrade to SQLite 3.7.9. -- Seth Falcon | @sfalcon | http://userprimary.net/ _______________________________________________ R-packages mailing list R-packages at r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages From ggrothendieck at gmail.com Thu Dec 1 22:53:36 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Thu, 1 Dec 2011 16:53:36 -0500 Subject: [R] legend, "lheight", and alignment In-Reply-To: <1322758482556-4129402.post@n4.nabble.com> References: <1322758482556-4129402.post@n4.nabble.com> Message-ID: On Thu, Dec 1, 2011 at 11:54 AM, emorway wrote: > Hello, > > A bit of fairly simple code, yet I don't seem to be able to manipulate it > quite as much as I would like: > > 1) ?It would be nice if the objects appearing in the legend were aligned, > and by aligned I mean the boxes are centered over the lines. ?Do I need to > adjust the use of "NA" in the code below to accomplish this? ?Here's how it > appears on my machine: > > http://r.789695.n4.nabble.com/file/n4129402/example.png > > 2) ?Because I'm using a call to 'expression' in the text contained in the > legend, it would be nice to space ?the lines of text a bit more. ?My feeble > attempt was to increase the lheight parameter in the hopes this would affect > the legend...to no avail. ?Further, lheight cannot be added to the argument > list of legend. ?I've been unable to track down another parameter applicable > to legend, suggestions very much appreciated. > > par(lheight=2) > plot(1,1,col="white") > > legend("center", legend=c(expression(paste("Observed > ",italic(bar(EC)[e]))),expression(paste("Simulated > ",italic(bar(EC)[e]))),"test1","test2"), > ? ? ? lty = c(NA,NA,1,1), > ? ? ? col = c("black","black","red","blue"), > ? ? ? density = c(NA,25,NA,NA), > ? ? ? border=c("black","black",NA,NA), > ? ? ? fill = c("grey","black",NA,NA), > ? ? ? angle = c(NA,45,NA,NA), > ? ? ? cex = 1.25, bty = "n", xpd = TRUE) > For #1 it would be easier to just use 2 columns so that there is no question of alignment in the first place, i.e. ncol = 2. For #2 try drawing the legend from lower level functions such as text since text does respect lheight. See the source of legendg in plotrix for how to do that. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From aodhanol at gmail.com Thu Dec 1 21:07:45 2011 From: aodhanol at gmail.com (AOLeary) Date: Thu, 1 Dec 2011 12:07:45 -0800 (PST) Subject: [R] Writing a function, want a string argument to define the name of the excel sheet to be called In-Reply-To: References: <1322747017324-4128384.post@n4.nabble.com> <1DE876CE-60DE-46B7-A0AF-CF40B7E9BE12@depauw.edu> <1322748601119-4128495.post@n4.nabble.com> Message-ID: <1322770065316-4130233.post@n4.nabble.com> Thanks Michael, I'll keep that in mind if I want to do anything more complicated. -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4130233.html Sent from the R help mailing list archive at Nabble.com. From salerno.franco73 at gmail.com Thu Dec 1 22:07:46 2011 From: salerno.franco73 at gmail.com (franco salerno) Date: Thu, 1 Dec 2011 22:07:46 +0100 Subject: [R] mixed effect model (multilevel) Message-ID: Hi, I have a problem with mixed effect model (multilevel). My model that is written in following formulation using the lme4 package and Zelig package: mylogit<- lmer(OVERFLOW ~ ALTEZZA + INTENSITA + ( 1 | CODICE), family= binomial(link = "probit"),data = dati) OVERFLOW can be 0 or 1 and represents the activation of a combined sewer overflow ALTEZZA is integer and reppresents the total precipitation occured during an event INTENSITA is integer and reppresents the maximun precipitation intensity occured during an event CODICE are different (13) combined sewer overflows I am analysing 480 OVERFLOWs. Summary Generalized linear mixed model fit by the Laplace approximation Formula: OVERFLOW ~ ALTEZZA + INTENSITA + (1 | CODICE) Data: dati AIC BIC logLik deviance 509.2 525.9 -250.6 501.2 Random effects: Groups Name Variance Std.Dev. CODICE (Intercept) 0.73159 0.85533 Number of obs: 480, groups: CODICE, 13 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.818969 0.264502 -3.096 0.00196 ** ALTEZZA 0.023416 0.004184 5.596 2.19e-08 *** INTENSITA 0.069759 0.021693 3.216 0.00130 ** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Correlation of Fixed Effects: (Intr) ALTEZZ ALTEZZA -0.155 INTENSITA -0.201 -0.399 I would like to have: 1) an indicator of performarce of my model (is it good the fitness of my model?? 2) a sort of cross-validation 3) information on relative importance of predictors (marginal effects???) Please, help me!!!!! Thanks From Jean-Paul.Vallee at unige.ch Thu Dec 1 22:29:57 2011 From: Jean-Paul.Vallee at unige.ch (jean-paul.vallee) Date: Thu, 01 Dec 2011 22:29:57 +0100 Subject: [R] pb with 4D dicom data and oro.dicom Message-ID: <186E4C4A-7F9D-4BE7-8697-CA4CC1002C8D@unige.ch> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From stephg0809 at gmail.com Thu Dec 1 22:51:38 2011 From: stephg0809 at gmail.com (stephg0809) Date: Thu, 1 Dec 2011 13:51:38 -0800 (PST) Subject: [R] Error message: object 'A' not found Message-ID: <1322776298315-4140237.post@n4.nabble.com> I ran the following code: And I run into problems with the last line of code (when it says hn<-......). I keep getting an error code: Error in distsamp(~hab ~ 1, peldist, keyfun = "halfnorm", output = "density", : object 'A' not found I would appreciate any and all help. rm(list=ls(all=TRUE)) #clear the computer's memory of variables setwd("E:\\Analysis") # Part 1 library(unmarked) # this loads the 'unmarked' package in R Pellet <- read.table("PelletDistance.csv", sep=",", header=T) # read in the data head(Pellet) # this provides a header of the first few lines of data and variable names Treatment <- Pellet[66:166,] # Isolates data for just the good habitat Control <- Pellet[1:65,] # same for bad habitat hist(Pellet$Distance,freq=F,xlim=c(0,7)) # plots a histogram, or frequency distribution of the data # Part 2 # Create formated distance response matrix cp <- c(0,0.50,2,3.50,5.00,6.50) # Distance cut points defining distance intervals yDat <- formatDistData(Pellet, "Distance", "Line", cp) # This creates a formatted data matrix for number of observations at each distance interval for each transect yDat # Prepare habitat covariates for each transect based on the stratum they reside in hab <- matrix(c("C","C","C","C","C","C","C","C","C","T","T","T","T","T","T","T","T","T"),nrow=18,ncol=1) #CHANGE THIS!!! nrow=# of T and Cs or A-Ks (same #) hab <- data.frame(hab) #Year effects year <- matrix(c("Year1","Year1","Year1","Year1","Year2","Year2","Year2","Year2","Year2","Year1","Year1","Year1","Year1","Year2","Year2","Year2","Year2","Year2"),nrow=18,ncol=1) #CHANGE THIS!!! to match number of A-Ks And change nrow year <- data.frame(year) # Prepare transect lengths len <- as.numeric(c(100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100)) #Make this equal A, AA....KK for number of 10000s # Organize distance data along with covariates and metadata, MAKE SURE THESE COVARIATES ARE RIGHT, MAYBE I CAN ADD MINE HERE peldist <- unmarkedFrameDS(y=yDat, siteCovs = data.frame(hab, year), dist.breaks=cp, tlength=len, survey="Line", unitsIn="m") peldist # look at the data summary(peldist) # get a summary of the data # Part 3 # Fit models without covariates hn <- distsamp(~1 ~1, peldist, keyfun="halfnorm", output="density", unitsOut="ha") -- View this message in context: http://r.789695.n4.nabble.com/Error-message-object-A-not-found-tp4140237p4140237.html Sent from the R help mailing list archive at Nabble.com. From ccquant at gmail.com Thu Dec 1 23:07:57 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 15:07:57 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ccquant at gmail.com Thu Dec 1 23:25:50 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 15:25:50 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ccquant at gmail.com Thu Dec 1 23:43:59 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 15:43:59 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From carl at witthoft.com Fri Dec 2 00:13:16 2011 From: carl at witthoft.com (Carl Witthoft) Date: Thu, 01 Dec 2011 18:13:16 -0500 Subject: [R] strange row numbering after rbind-ing a list Message-ID: <4ED80A0C.10802@witthoft.com> "Not that it really matters, but" Can someone explain how the row numbers get assigned in the following sequence? It looks like something funky happens when rbind() coerces 'bar' into a dataframe. In either sequence of rbind below, once you get past the first two rows, the row numbers count normally. Rgames> (foo<-data.frame(x=5,y=4,r=3)) x y r 1 5 4 3 Rgames> (bar<-list(x=4,y=5,r=6)) $x [1] 4 $y [1] 5 $r [1] 6 Rgames> (foobar<- rbind(foo,bar)) x y r 1 5 4 3 2 4 5 6 Rgames> (foobar<- rbind(foobar,bar)) x y r 1 5 4 3 2 4 5 6 3 4 5 6 Rgames> (barfoo<-rbind(bar,foo)) x y r 2 4 5 6 21 5 4 3 Rgames> (barfoo<-rbind(barfoo,foo)) x y r 2 4 5 6 21 5 4 3 3 5 4 3 -- Sent from my Cray XK6 "Pendeo-navem mei anguillae plena est." From bps0002 at auburn.edu Fri Dec 2 00:23:59 2011 From: bps0002 at auburn.edu (B77S) Date: Thu, 1 Dec 2011 15:23:59 -0800 (PST) Subject: [R] Summarizing elements of a list In-Reply-To: <1322777855869-4142479.post@n4.nabble.com> References: <1322777855869-4142479.post@n4.nabble.com> Message-ID: <1322781839766-4142884.post@n4.nabble.com> Someone is bound to know a better way, but... subset(unlist(Version1_), subset=names(unlist(Version1_))=="First") LCOG1 wrote > > Hi everyone, > I looked around the list for a while but couldn't find a solution to my > problem. I am storing some results to a simulation in a list and for each > element i have two separate vectors(is that what they are called, correct > my vocab if necessary). See below > > Version1_<-list() > for(i in 1:5){ > Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1)) > } > > What I want is to put all of the elements' 'First' vectors into a single > list to box plot. But whats a more elegant solution to the below? > > c(Version1_[[1]]$First,Version1_[[2]]$First,Version1_[[3]]$First,Version1_[[4]]$First,Version1_[[5]]$First) > > since i have 50 or more simulations this is impractical and sloppy. Do I > need to store my data differently or is their a solution on the back end? > Thanks all. > > Josh > -- View this message in context: http://r.789695.n4.nabble.com/Summarizing-elements-of-a-list-tp4142479p4142884.html Sent from the R help mailing list archive at Nabble.com. From sarah.goslee at gmail.com Fri Dec 2 00:26:18 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 18:26:18 -0500 Subject: [R] strange row numbering after rbind-ing a list In-Reply-To: <4ED80A0C.10802@witthoft.com> References: <4ED80A0C.10802@witthoft.com> Message-ID: Those are row *names*, not row *numbers*. It's just that if you don't specify, numbers are assigned by default when creating a data frame. Your rbind() statements are implicitly creating a data frame, so the likely information is in ?data.frame: check.names: logical. If ?TRUE? then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names and are not duplicated. If necessary they are adjusted (by ?make.names?) so that they are. By default, row.names=NULL and check.names=TRUE. See also ?rbind.data.frame Sarah On Thu, Dec 1, 2011 at 6:13 PM, Carl Witthoft wrote: > "Not that it really matters, but" > Can someone explain how the row numbers get assigned in the following > sequence? It looks like something funky happens when rbind() coerces 'bar' > into a dataframe. > In either sequence of rbind below, once you get past the first two rows, the > row numbers count normally. > > > Rgames> (foo<-data.frame(x=5,y=4,r=3)) > ?x y r > 1 5 4 3 > Rgames> (bar<-list(x=4,y=5,r=6)) > $x > [1] 4 > > $y > [1] 5 > > $r > [1] 6 > > Rgames> (foobar<- rbind(foo,bar)) > ?x y r > 1 5 4 3 > 2 4 5 6 > > Rgames> (foobar<- rbind(foobar,bar)) > ?x y r > 1 5 4 3 > 2 4 5 6 > 3 4 5 6 > > > Rgames> (barfoo<-rbind(bar,foo)) > ? x y r > 2 ?4 5 6 > 21 5 4 3 > > Rgames> (barfoo<-rbind(barfoo,foo)) > ? x y r > 2 ?4 5 6 > 21 5 4 3 > 3 ?5 4 3 -- Sarah Goslee http://www.functionaldiversity.org From pdalgd at gmail.com Fri Dec 2 00:32:07 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Fri, 2 Dec 2011 00:32:07 +0100 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> Message-ID: <3684DD42-A6F4-487C-B7C0-220C044FF843@gmail.com> On Dec 1, 2011, at 23:43 , Ben quant wrote: > I'm not proposing this as a permanent solution, just investigating the warning. I zeroed out the three outliers and received no warning. Can someone tell me why I am getting no warning now? It's easier to explain why you got the warning before. If the OR for a one unit change is 3000, the OR for a 14 unit change is on the order of 10^48 and that causes over/underflow in the conversion to probabilities. I'm still baffled at how you can get that model fitted to your data, though. One thing is that you can have situations where there are fitted probabilities of one corresponding to data that are all one and/or fitted zeros where data are zero, but you seem to have cases where you have both zeros and ones at both ends of the range of x. Fitting a zero to a one or vice versa would make the likelihood zero, so you'd expect that the algorithm would find a better set of parameters rather quickly. Perhaps the extremely large number of observations that you have has something to do with it? You'll get the warning if the fitted zeros or ones occur at any point of the iterative procedure. Maybe it isn't actually true for the final model, but that wouldn't seem consistent with the OR that you cited. Anyways, your real problem lies with the distribution of the x values. I'd want to try transforming it to something more sane. Taking logarithms is the obvious idea, but you'd need to find out what to do about the zeros -- perhaps log(x + 1e-4) ? Or maybe just cut the outliers down to size with pmin(x,1). > > I did this 3 times to get rid of the 3 outliers: > mx_dims = arrayInd(which.max(l_yx), dim(l_yx)) > l_yx[mx_dims] = 0 > > Now this does not produce an warning: > l_logit = glm(y~x, data=as.data.frame(l_yx), family=binomial(link="logit")) > > Can someone tell me why occurred? > > Also, again, here are the screen shots of my data that I tried to send earlier (two screen shots, two pages): > http://scientia.crescat.net/static/ben/warn%20num%200%20or%201.pdf > > Thank you for your help, > > Ben > > On Thu, Dec 1, 2011 at 3:25 PM, Ben quant wrote: > Oops! Please ignore my last post. I mistakenly gave you different data I was testing with. This is the correct data: > > Here you go: > > > attach(as.data.frame(l_yx)) > > range(x[y==0]) > [1] 0.00000 14.66518 > > range(x[y==1]) > [1] 0.00000 13.49791 > > > How do I know what is acceptable? > > Also, here are the screen shots of my data that I tried to send earlier (two screen shots, two pages): > http://scientia.crescat.net/static/ben/warn%20num%200%20or%201.pdf > > Thank you, > > Ben > > On Thu, Dec 1, 2011 at 3:07 PM, Ben quant wrote: > Here you go: > > > attach(as.data.frame(l_yx)) > > range(x[y==1]) > [1] -22500.0000 746.6666 > > range(x[y==0]) > [1] -10076.5303 653.0228 > > How do I know what is acceptable? > > Also, here are the screen shots of my data that I tried to send earlier (two screen shots, two pages): > http://scientia.crescat.net/static/ben/warn%20num%200%20or%201.pdf > > Thank you, > > Ben > > > On Thu, Dec 1, 2011 at 2:24 PM, peter dalgaard wrote: > > On Dec 1, 2011, at 21:32 , Ben quant wrote: > > > Thank you for the feedback, but my data looks fine to me. Please tell me if I'm not understanding. > > Hum, then maybe it really is a case of a transition region being short relative to the range of your data. Notice that the warning is just that: a warning. I do notice that the distribution of your x values is rather extreme -- you stated a range of 0--14 and a mean of 0.01. And after all, an odds ratio of 3000 per unit is only a tad over a doubling per 0.1 units. > > Have a look at range(x[y==0]) and range(x[y==1]). > > > > > > I followed your instructions and here is a sample of the first 500 values : (info on 'd' is below that) > > > > > d <- as.data.frame(l_yx) > > > x = with(d, y[order(x)]) > > > x[1:500] # I have 1's and 0's dispersed throughout > > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 > > [101] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [201] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 > > [301] 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [401] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 > > > > # I get the warning still > > > l_df = as.data.frame(l_yx) > > > l_logit = glm(y~x, data=l_df, family=binomial(link="logit")) > > > > Warning message: > > glm.fit: fitted probabilities numerically 0 or 1 occurred > > > > # some info on 'd' above: > > > > > d[1:500,1] > > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [101] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [201] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [301] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > [401] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > > d[1:500,2] > > [1] 3.023160e-03 7.932130e-02 0.000000e+00 1.779657e-02 1.608374e-01 0.000000e+00 5.577064e-02 7.753926e-03 4.018553e-03 4.760918e-02 2.080511e-02 1.642404e-01 3.703720e-03 8.901981e-02 1.260415e-03 > > [16] 2.202523e-02 3.750940e-02 4.441975e-04 9.351171e-03 8.374567e-03 0.000000e+00 8.440448e-02 5.081017e-01 2.538640e-05 1.806017e-02 2.954641e-04 1.434859e-03 6.964976e-04 0.000000e+00 1.202162e-02 > > [31] 3.420300e-03 4.276100e-02 1.457324e-02 4.140121e-03 1.349180e-04 1.525292e-03 4.817502e-02 9.515717e-03 2.232953e-02 1.227908e-01 3.293581e-02 1.454352e-02 1.176011e-03 6.274138e-02 2.879205e-02 > > [46] 6.900926e-03 1.414648e-04 3.446349e-02 8.807174e-03 3.549332e-02 2.828509e-03 2.935003e-02 7.162872e-03 5.650050e-03 1.221191e-02 0.000000e+00 2.126334e-02 2.052020e-02 7.542409e-02 2.586269e-04 > > [61] 5.258664e-02 1.213126e-02 1.493275e-02 8.152657e-03 1.774966e-02 2.433198e-02 1.371257e-02 6.732339e-02 9.747677e-03 8.180594e-03 1.882473e-01 1.682596e-03 1.410170e-02 8.429676e-03 3.520589e-01 > > [76] 1.865160e-02 2.389941e-02 3.301558e-02 4.896605e-03 6.826244e-03 9.151337e-02 1.722270e-02 1.764039e-01 3.554063e-02 7.338532e-03 9.577793e-03 3.632366e-03 1.422400e-02 3.020497e-02 1.797096e-02 > > [91] 2.577899e-03 1.338365e-01 8.202223e-03 1.088335e-02 2.137259e-02 6.829797e-03 3.104860e-04 8.927160e-03 5.626881e-02 1.197682e-02 6.140553e-02 2.729364e-02 1.377913e-02 3.018277e-03 1.188304e-02 > > [106] 2.029268e-03 2.108815e-02 1.765503e-03 2.449253e-02 3.677046e-03 1.013463e-02 4.286642e-02 1.238931e-02 3.072090e-03 1.509613e-02 3.609885e-02 5.537268e-03 3.151614e-02 3.703148e-03 1.409401e-01 > > [121] 1.473365e-02 9.160461e-03 1.035099e-01 3.005865e-02 1.332199e-02 6.936535e-03 2.433539e-02 4.935373e-03 4.822740e-03 1.597643e-03 3.805619e-03 1.092683e-02 1.760635e-01 5.565614e-03 7.739213e-04 > > [136] 4.529198e-03 5.110359e-03 7.391258e-02 5.018207e-03 2.071417e-02 1.825787e-02 9.141405e-03 1.078386e-01 2.171470e-04 7.164583e-03 2.522077e-02 1.994428e-03 6.044653e-03 1.778078e-04 5.797706e-03 > > [151] 1.526778e-02 1.595897e-02 1.995627e-01 1.946735e-03 6.711582e-02 2.722350e-02 3.127499e-02 1.074904e-01 2.477414e-03 5.015375e-02 3.417810e-02 2.046643e-02 1.644832e-02 5.220166e-03 1.217752e-02 > > [166] 1.187352e-02 1.634016e-02 2.349568e-03 3.451811e-02 2.593540e-03 6.868595e-03 1.311236e-02 6.457757e-03 2.942391e-04 1.628352e-02 8.288831e-03 3.170856e-04 1.251331e+00 1.706954e-02 1.063723e-03 > > [181] 1.374416e-02 2.140507e-02 2.817009e-02 2.272793e-02 4.365562e-02 6.089414e-03 2.498083e-02 1.360471e-02 1.884079e-02 1.448660e-02 2.341314e-02 8.167064e-03 4.109117e-02 2.660633e-02 7.711723e-03 > > [196] 9.590278e-03 2.515490e-03 1.978033e-02 3.454990e-02 8.072748e-03 4.718885e-03 1.621131e-01 4.547743e-03 1.081195e-02 9.572051e-04 1.790391e-02 1.618026e-02 1.910230e-02 1.861914e-02 3.485475e-02 > > [211] 2.844890e-03 1.866889e-02 1.378208e-02 2.451514e-02 2.535044e-03 3.921364e-04 1.557266e-03 3.315892e-03 1.752821e-03 6.786187e-03 1.360921e-02 9.550702e-03 8.114506e-03 5.068741e-03 1.729822e-02 > > [226] 1.902033e-02 8.196564e-03 2.632880e-03 1.587969e-02 8.354079e-04 1.050023e-03 4.236195e-04 9.181120e-03 4.995919e-04 1.092234e-02 1.207544e-02 2.187243e-01 3.251349e-02 1.269134e-03 1.557751e-04 > > [241] 1.232498e-02 2.654449e-02 1.049324e-03 8.442729e-03 6.331691e-03 1.715609e-02 1.017800e-03 9.230006e-03 1.331373e-02 5.596195e-02 1.296551e-03 5.272687e-03 2.805640e-02 4.790665e-02 2.043011e-02 > > [256] 1.047226e-02 1.866499e-02 9.323001e-03 8.920536e-03 1.582911e-03 2.776238e-03 2.914762e-02 4.402356e-03 9.555274e-04 1.681966e-03 7.584319e-04 6.758914e-02 1.505431e-02 2.213308e-02 1.329330e-02 > > [271] 7.284363e-03 2.687818e-02 2.997535e-03 7.470007e-03 2.070569e-03 3.441944e-02 1.717768e-02 4.523364e-02 1.003558e-02 1.365111e-02 1.906845e-02 1.676223e-02 3.506809e-04 9.164257e-02 9.008416e-03 > > [286] 1.073903e-02 4.855937e-03 8.618043e-03 2.529247e-02 1.059375e-02 5.834253e-03 2.004309e-02 1.460387e-02 2.899190e-02 5.867984e-03 1.983956e-02 6.834339e-03 1.925821e-03 9.231870e-03 6.839616e-03 > > [301] 1.029972e-02 2.009769e-02 9.458785e-03 1.183901e-02 8.911549e-03 1.264745e-02 2.995451e-03 7.657983e-04 5.315853e-03 1.325039e-02 1.044103e-02 2.307236e-02 2.780789e-02 1.735145e-02 9.053126e-03 > > [316] 5.847638e-02 3.815715e-03 5.087690e-03 1.040513e-02 4.475672e-02 6.564791e-02 3.233571e-03 1.076193e-02 8.283819e-02 5.370256e-03 3.533256e-02 1.302812e-02 1.896783e-02 2.055282e-02 3.572239e-03 > > [331] 5.867681e-03 5.864974e-04 9.715807e-03 1.665469e-02 5.082044e-02 3.547168e-03 3.069631e-03 1.274717e-02 1.858226e-03 3.104809e-04 1.247831e-02 2.073575e-03 3.544110e-04 7.240736e-03 8.452117e-05 > > [346] 8.149151e-04 4.942461e-05 1.142303e-03 6.265512e-04 3.666717e-04 3.244669e-02 7.242018e-03 6.335951e-04 2.329072e-02 3.719716e-03 2.803425e-02 1.623981e-02 6.387102e-03 8.807679e-03 1.214914e-02 > > [361] 6.699341e-03 1.148082e-02 1.329736e-02 1.537364e-03 2.004390e-02 1.562065e-02 1.655465e-02 9.960172e-02 2.174588e-02 1.209472e-02 2.328413e-02 2.012760e-04 1.422327e-02 2.194455e-03 2.307362e-02 > > [376] 4.315764e-03 3.208576e-02 3.826598e-02 1.828001e-02 3.935978e-03 5.294211e-04 1.392423e-02 6.588394e-03 1.040147e-03 1.260787e-02 9.051757e-04 5.353215e-02 6.049058e-02 1.382630e-01 1.064124e-01 > > [391] 3.380742e-03 1.798038e-02 1.557048e-01 1.217146e-02 4.140520e-02 4.707564e-02 2.786042e-02 8.836988e-03 5.542879e-03 1.862664e-02 8.858770e-03 1.026681e-03 1.692105e-02 8.849238e-03 7.143816e-03 > > [406] 1.630118e-02 1.165920e-01 9.471496e-03 4.879998e-02 1.388216e-02 1.453267e-02 4.845224e-04 1.415190e-03 1.208627e-02 1.372348e-02 2.573131e-02 1.169595e-02 1.825447e-02 2.574299e-02 5.301360e-02 > > [421] 6.961110e-03 7.781891e-03 1.013308e-03 3.160916e-03 1.090344e-02 1.530841e-02 9.398088e-04 9.143726e-04 1.286683e-02 2.006193e-02 1.774378e-02 5.681591e-02 9.584676e-03 7.957152e-02 4.485609e-03 > > [436] 1.086684e-02 2.930273e-03 6.085481e-03 4.342320e-03 1.319999e-02 2.120402e-02 4.477545e-02 1.991814e-02 8.893947e-03 7.790133e-03 1.610199e-02 2.441280e-02 2.781231e-03 1.410080e-02 1.639912e-02 > > [451] 1.797498e-02 1.185382e-02 2.775063e-02 3.797315e-02 1.428883e-02 1.272659e-02 2.390500e-03 7.503478e-03 8.965356e-03 2.139452e-02 2.028536e-02 6.916416e-02 1.615986e-02 4.837412e-02 1.561731e-02 > > [466] 7.130332e-03 9.208406e-05 1.099934e-02 2.003469e-02 1.395857e-02 9.883482e-03 4.110852e-02 1.202052e-02 2.833039e-02 1.233236e-02 2.145801e-02 7.900161e-03 4.663819e-02 4.410819e-03 5.115056e-04 > > [481] 9.100270e-04 4.013683e-03 1.227139e-02 3.304697e-03 2.919099e-03 6.112390e-03 1.922229e-02 1.208282e-03 1.164037e-02 2.166888e-02 4.381615e-02 5.318929e-03 7.226343e-03 2.732819e-02 2.385092e-04 > > [496] 4.905250e-02 1.159876e-02 4.068228e-03 3.349013e-02 1.273468e-03 > > > > > > Thanks for your help, > > > > Ben > > > > On Thu, Dec 1, 2011 at 11:55 AM, peter dalgaard wrote: > > > > On Dec 1, 2011, at 18:54 , Ben quant wrote: > > > > > Sorry if this is a duplicate: This is a re-post because the pdf's mentioned > > > below did not go through. > > > > Still not there. Sometimes it's because your mailer doesn't label them with the appropriate mime-type (e.g. as application/octet-stream, which is "arbitrary binary"). Anyways, see below > > > > [snip] > > > > > > With the above data I do: > > >> l_logit = glm(y~x, data=as.data.frame(l_yx), > > > family=binomial(link="logit")) > > > Warning message: > > > glm.fit: fitted probabilities numerically 0 or 1 occurred > > > > > > Why am I getting this warning when I have data points of varying values for > > > y=1 and y=0? In other words, I don't think I have the linear separation > > > issue discussed in one of the links I provided. > > > > I bet that you do... You can get the warning without that effect (one of my own examples is the probability of menarche in a data set that includes infants and old age pensioners), but not with a huge odds ratio as well. Take a look at > > > > d <- as.data.frame(l_yx) > > with(d, y[order(x)]) > > > > if it comes out as all zeros followed by all ones or vice versa, then you have the problem. > > > > > > > > > > PS - Then I do this and I get a odds ratio a crazy size: > > >> l_sm = summary(l_logit) # coef pval is $coefficients[8], log odds > > > $coefficients[2] > > >> l_exp_coef = exp(l_logit$coefficients)[2] # exponentiate the > > > coeffcients > > >> l_exp_coef > > > x > > > 3161.781 > > > > > > So for one unit increase in the predictor variable I get 3160.781% > > > (3161.781 - 1 = 3160.781) increase in odds? That can't be correct either. > > > How do I correct for this issue? (I tried multiplying the predictor > > > variables by a constant and the odds ratio goes down, but the warning above > > > still persists and shouldn't the odds ratio be predictor variable size > > > independent?) > > > > > > -- > > Peter Dalgaard, Professor, > > Center for Statistics, Copenhagen Business School > > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > > Phone: (+45)38153501 > > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > > > > > > > > > > > > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > > > > -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From bps0002 at auburn.edu Fri Dec 2 01:13:17 2011 From: bps0002 at auburn.edu (B77S) Date: Thu, 1 Dec 2011 16:13:17 -0800 (PST) Subject: [R] Moving column averaging In-Reply-To: <1322769191236-4130179.post@n4.nabble.com> References: <1322769191236-4130179.post@n4.nabble.com> Message-ID: <1322784797785-4143329.post@n4.nabble.com> # need zoo to use rollapply() # your data (I called df) df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", "e", "f"), class = "data.frame", row.names = c(NA, -2L)) # transpose and make a zoo object df2 <- zoo(t(df)) #rollapply to get means and transpose back means <- t(rollapply(df2, width=2, by=2, FUN=mean)) # adding the combined column names you requested colnames(means) <- apply(matrix(names(df), nrow=2), 2, paste, collapse=", ") HTH -- View this message in context: http://r.789695.n4.nabble.com/Moving-column-averaging-tp4130179p4143329.html Sent from the R help mailing list archive at Nabble.com. From ccquant at gmail.com Fri Dec 2 02:00:23 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 1 Dec 2011 18:00:23 -0700 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: <3684DD42-A6F4-487C-B7C0-220C044FF843@gmail.com> References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> <3684DD42-A6F4-487C-B7C0-220C044FF843@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ehlers at ucalgary.ca Fri Dec 2 02:01:31 2011 From: ehlers at ucalgary.ca (Peter Ehlers) Date: Thu, 01 Dec 2011 17:01:31 -0800 Subject: [R] legend, "lheight", and alignment In-Reply-To: <1322758482556-4129402.post@n4.nabble.com> References: <1322758482556-4129402.post@n4.nabble.com> Message-ID: <4ED8236B.5060506@ucalgary.ca> On 2011-12-01 08:54, emorway wrote: > Hello, > > A bit of fairly simple code, yet I don't seem to be able to manipulate it > quite as much as I would like: > > 1) It would be nice if the objects appearing in the legend were aligned, > and by aligned I mean the boxes are centered over the lines. Do I need to > adjust the use of "NA" in the code below to accomplish this? Here's how it > appears on my machine: > > http://r.789695.n4.nabble.com/file/n4129402/example.png > > 2) Because I'm using a call to 'expression' in the text contained in the > legend, it would be nice to space the lines of text a bit more. My feeble > attempt was to increase the lheight parameter in the hopes this would affect > the legend...to no avail. Further, lheight cannot be added to the argument > list of legend. I've been unable to track down another parameter applicable > to legend, suggestions very much appreciated. > > par(lheight=2) > plot(1,1,col="white") > > legend("center", legend=c(expression(paste("Observed > ",italic(bar(EC)[e]))),expression(paste("Simulated > ",italic(bar(EC)[e]))),"test1","test2"), > lty = c(NA,NA,1,1), > col = c("black","black","red","blue"), > density = c(NA,25,NA,NA), > border=c("black","black",NA,NA), > fill = c("grey","black",NA,NA), > angle = c(NA,45,NA,NA), > cex = 1.25, bty = "n", xpd = TRUE) > You can adjust the alignment a little by adding 'merge = TRUE'; this will left-align both the boxes and the lines. For your second question, use the y.intersp argument, e.g. 'y.intersp = 2'. You might also avoid using 'paste' in your expressions; Try replacing expression(paste("Observed",italic(bar(EC)[e]))) with expression("Observed"~italic(bar(EC)[e])) Peter Ehlers > >> sessionInfo() > R version 2.13.2 (2011-09-30) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 > [2] LC_CTYPE=English_United States.1252 > [3] LC_MONETARY=English_United States.1252 > [4] LC_NUMERIC=C > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_2.13.2 >> > > > -- > View this message in context: http://r.789695.n4.nabble.com/legend-lheight-and-alignment-tp4129402p4129402.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From bps0002 at auburn.edu Fri Dec 2 02:11:39 2011 From: bps0002 at auburn.edu (B77S) Date: Thu, 1 Dec 2011 17:11:39 -0800 (PST) Subject: [R] calculate mean of multiple rows in a data frame In-Reply-To: <1322772314.57483.YahooMailClassic@web28515.mail.ukl.yahoo.com> References: <1322772314.57483.YahooMailClassic@web28515.mail.ukl.yahoo.com> Message-ID: <1322788299530-4143875.post@n4.nabble.com> -- View this message in context: http://r.789695.n4.nabble.com/calculate-mean-of-multiple-rows-in-a-data-frame-tp4130468p4143875.html Sent from the R help mailing list archive at Nabble.com. From ggrothendieck at gmail.com Fri Dec 2 02:14:17 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Thu, 1 Dec 2011 20:14:17 -0500 Subject: [R] Moving column averaging In-Reply-To: <1322784797785-4143329.post@n4.nabble.com> References: <1322769191236-4130179.post@n4.nabble.com> <1322784797785-4143329.post@n4.nabble.com> Message-ID: On Thu, Dec 1, 2011 at 7:13 PM, B77S wrote: > # need zoo to use rollapply() > > # your data (I called df) > df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), > ? ?e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", > "e", "f"), class = "data.frame", row.names = c(NA, -2L)) > > # transpose and make a zoo object > df2 <- zoo(t(df)) > > #rollapply to get means and transpose back > means <- t(rollapply(df2, width=2, by=2, FUN=mean)) > > # adding the combined column names you requested > colnames(means) <- apply(matrix(names(df), nrow=2), 2, paste, collapse=", ") > Note that zoo's rollapply also works on plain matrices and vectors. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From bps0002 at auburn.edu Fri Dec 2 02:16:44 2011 From: bps0002 at auburn.edu (B77S) Date: Thu, 1 Dec 2011 17:16:44 -0800 (PST) Subject: [R] Moving column averaging In-Reply-To: References: <1322769191236-4130179.post@n4.nabble.com> <1322784797785-4143329.post@n4.nabble.com> Message-ID: <1322788604791-4143909.post@n4.nabble.com> Sorry for that, and thanks Gabor, I could have sworn that it wouldn't. Gabor Grothendieck wrote > > On Thu, Dec 1, 2011 at 7:13 PM, B77S <bps0002@> wrote: >> # need zoo to use rollapply() >> >> # your data (I called df) >> df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), >> ? ?e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", >> "e", "f"), class = "data.frame", row.names = c(NA, -2L)) >> >> # transpose and make a zoo object >> df2 <- zoo(t(df)) >> >> #rollapply to get means and transpose back >> means <- t(rollapply(df2, width=2, by=2, FUN=mean)) >> >> # adding the combined column names you requested >> colnames(means) <- apply(matrix(names(df), nrow=2), 2, paste, collapse=", >> ") >> > > Note that zoo's rollapply also works on plain matrices and vectors. > > -- > Statistics & Software Consulting > GKX Group, GKX Associates Inc. > tel: 1-877-GKX-GROUP > email: ggrothendieck at gmail.com > > ______________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/Moving-column-averaging-tp4130179p4143909.html Sent from the R help mailing list archive at Nabble.com. From carl at witthoft.com Fri Dec 2 02:54:14 2011 From: carl at witthoft.com (Carl Witthoft) Date: Thu, 01 Dec 2011 20:54:14 -0500 Subject: [R] strange row numbering after rbind-ing a list In-Reply-To: References: <4ED80A0C.10802@witthoft.com> Message-ID: <4ED82FC6.9070805@witthoft.com> Sorry -- I meant to write 'row names,' but the question specifically is where those unlikely numbers come from. So I guess it comes down to why, when 'bar' is the first item, the row name is assigned '2' rather than '1' . On 12/1/11 6:26 PM, Sarah Goslee wrote: > Those are row *names*, not row *numbers*. It's just that if you don't specify, > numbers are assigned by default when creating a data frame. > > Your rbind() statements are implicitly creating a data frame, so the likely > information is in ?data.frame: > > check.names: logical. If ?TRUE? then the names of the variables in the > data frame are checked to ensure that they are syntactically > valid variable names and are not duplicated. If necessary > they are adjusted (by ?make.names?) so that they are. > > By default, row.names=NULL and check.names=TRUE. > > See also ?rbind.data.frame > > Sarah > > On Thu, Dec 1, 2011 at 6:13 PM, Carl Witthoft wrote: >> "Not that it really matters, but" >> Can someone explain how the row numbers get assigned in the following >> sequence? It looks like something funky happens when rbind() coerces 'bar' >> into a dataframe. >> In either sequence of rbind below, once you get past the first two rows, the >> row numbers count normally. >> >> >> Rgames> (foo<-data.frame(x=5,y=4,r=3)) >> x y r >> 1 5 4 3 >> Rgames> (bar<-list(x=4,y=5,r=6)) >> $x >> [1] 4 >> >> $y >> [1] 5 >> >> $r >> [1] 6 >> >> Rgames> (foobar<- rbind(foo,bar)) >> x y r >> 1 5 4 3 >> 2 4 5 6 >> >> Rgames> (foobar<- rbind(foobar,bar)) >> x y r >> 1 5 4 3 >> 2 4 5 6 >> 3 4 5 6 >> >> >> Rgames> (barfoo<-rbind(bar,foo)) >> x y r >> 2 4 5 6 >> 21 5 4 3 >> >> Rgames> (barfoo<-rbind(barfoo,foo)) >> x y r >> 2 4 5 6 >> 21 5 4 3 >> 3 5 4 3 > > -- Sent from my Cray XK6 "Pendeo-navem mei anguillae plena est." From l.glew at soton.ac.uk Thu Dec 1 23:51:37 2011 From: l.glew at soton.ac.uk (lglew) Date: Thu, 1 Dec 2011 14:51:37 -0800 (PST) Subject: [R] Assign name to object for each iteration in a loop. In-Reply-To: References: <1322763198075-4129752.post@n4.nabble.com> Message-ID: <1322779897063-4142684.post@n4.nabble.com> Thanks Michael! Yeah, that dealt with one of the problems. I still get the following error message: Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be handled by 'cat' I know that this has something to do with writing the names of the output file, and returning them from the function.... L. -- View this message in context: http://r.789695.n4.nabble.com/Assign-name-to-object-for-each-iteration-in-a-loop-tp4129752p4142684.html Sent from the R help mailing list archive at Nabble.com. From jroll at lcog.org Thu Dec 1 23:17:35 2011 From: jroll at lcog.org (LCOG1) Date: Thu, 1 Dec 2011 14:17:35 -0800 (PST) Subject: [R] Summarizing elements of a list Message-ID: <1322777855869-4142479.post@n4.nabble.com> Hi everyone, I looked around the list for a while but couldn't find a solution to my problem. I am storing some results to a simulation in a list and for each element i have two separate vectors(is that what they are called, correct my vocab if necessary). See below Version1_<-list() for(i in 1:5){ Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1)) } What I want is to put all of the elements' 'First' vectors into a single list to box plot. But whats a more elegant solution to the below? c(Version1_[[1]]$First,Version1_[[2]]$First,Version1_[[3]]$First,Version1_[[4]]$First,Version1_[[5]]$First) since i have 50 or more simulations this is impractical and sloppy. Do I need to store my data differently or is their a solution on the back end? Thanks all. Josh -- View this message in context: http://r.789695.n4.nabble.com/Summarizing-elements-of-a-list-tp4142479p4142479.html Sent from the R help mailing list archive at Nabble.com. From lara_bio13 at hotmail.com Fri Dec 2 01:48:21 2011 From: lara_bio13 at hotmail.com (lara) Date: Thu, 1 Dec 2011 16:48:21 -0800 (PST) Subject: [R] Plot coordinates with gradien colour according to a different column Message-ID: <1322786901097-4143712.post@n4.nabble.com> Hi everyone, I'm having problems with plotting my data. I have a set of positions with different attributes and I'm wondering if I can plot it, as x,y plot, with gradient colours according to a 3rd factor. Is it possible to show gradient segments between postions and not one-coloured segment between each one? I've been trying plotrix color.scale.lines with no luck. I'm very thankful for any help!! Cheers, Lara -- View this message in context: http://r.789695.n4.nabble.com/Plot-coordinates-with-gradien-colour-according-to-a-different-column-tp4143712p4143712.html Sent from the R help mailing list archive at Nabble.com. From sarah.goslee at gmail.com Fri Dec 2 03:41:26 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 1 Dec 2011 21:41:26 -0500 Subject: [R] Summarizing elements of a list In-Reply-To: <1322777855869-4142479.post@n4.nabble.com> References: <1322777855869-4142479.post@n4.nabble.com> Message-ID: How about: lapply(Version1_, subset, subset=c(TRUE, FALSE)) or sapply() depending on what you want the result to look like. Thanks for the reproducible example. Sarah On Thu, Dec 1, 2011 at 5:17 PM, LCOG1 wrote: > Hi everyone, > ? I looked around the list for a while but couldn't find a solution to my > problem. ?I am storing some results to a simulation in a list and for each > element i have two separate vectors(is that what they are called, correct my > vocab if necessary). See below > > Version1_<-list() > for(i in 1:5){ > ? ? ? ?Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1)) > } > > What I want is to put all of the elements' 'First' vectors into a single > list to box plot. But whats a more elegant solution to the below? > > c(Version1_[[1]]$First,Version1_[[2]]$First,Version1_[[3]]$First,Version1_[[4]]$First,Version1_[[5]]$First) > > since i have 50 or more simulations this is impractical and sloppy. ?Do I > need to store my data differently or is their a solution on the back end? > Thanks all. > > Josh > -- Sarah Goslee http://www.functionaldiversity.org From flodel at gmail.com Fri Dec 2 04:32:44 2011 From: flodel at gmail.com (Florent D.) Date: Thu, 1 Dec 2011 22:32:44 -0500 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: I used within and vapply: x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == "/")within(x, Col2 <- vapply(Col1, count.slashes, 1)) ? ? ? ? ?Col1 Col21 ? ? abc/def ? ?12 ghi/jkl/mno ? ?2 On Thu, Dec 1, 2011 at 1:05 PM, Bert Gunter wrote: > ## It's not a data frame -- it's just a vector. > >> x > [1] "abc/def" ? ? "ghi/jkl/mno" >> gsub("[^/]","",x) > [1] "/" ?"//" >> nchar(gsub("[^/]","",x)) > [1] 1 2 >> > > ?gsub > ?nchar > > -- Bert > > On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault > wrote: >> I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. >> >> My dataframe, x, ?is structured as below: >> >> Col1 >> abc/def >> ghi/jkl/mno >> >> I found this code on the board but it counts all occurrences of "/" in the dataframe. >> >> chr.pos <- which(unlist(strsplit(x,NULL))=='/') >> chr.count <- length(chr.pos) >> chr.count >> [1] 3 >> >> I'd like to append a column, say cnt, that has the count of "/" for each row. >> >> Can anyone point me in the right direction or offer some code to do this? >> >> Thanks in advance for the help. >> >> Doug Esneault >> >> >> >> >> >> >> Privileged/Confidential Information may be contained in this message. If you >> are not the addressee indicated in this message (or responsible for delivery >> of the message to such person), you may not copy or deliver this message to >> anyone. In such case, you should destroy this message and kindly notify the >> sender by reply email. Please advise immediately if you or your employer >> does not consent to email for messages of this kind. Opinions, conclusions >> and other information in this message that do not relate to the official >> business of the GroupM companies shall be understood as neither given nor >> endorsed by it. ? GroupM companies are a member of WPP plc. For more >> information on our business ethical standards and Corporate Responsibility >> policies please refer to our website at >> http://www.wpp.com/WPP/About/ >> >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm > > ______________________________________________ > R-help at 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 code. From flodel at gmail.com Fri Dec 2 04:44:48 2011 From: flodel at gmail.com (Florent D.) Date: Thu, 1 Dec 2011 22:44:48 -0500 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: Resending my code, not sure why the linebreaks got eaten: > x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) > count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == "/") > within(x, Col2 <- vapply(Col1, count.slashes, 1)) Col1 Col2 1 abc/def 1 2 ghi/jkl/mno 2 On Thu, Dec 1, 2011 at 10:32 PM, Florent D. wrote: > I used within and vapply: > > x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) > count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == > "/")within(x, Col2 <- vapply(Col1, count.slashes, 1)) > ? ? ? ? ?Col1 Col21 ? ? abc/def ? ?12 ghi/jkl/mno ? ?2 > > On Thu, Dec 1, 2011 at 1:05 PM, Bert Gunter wrote: >> ## It's not a data frame -- it's just a vector. >> >>> x >> [1] "abc/def" ? ? "ghi/jkl/mno" >>> gsub("[^/]","",x) >> [1] "/" ?"//" >>> nchar(gsub("[^/]","",x)) >> [1] 1 2 >>> >> >> ?gsub >> ?nchar >> >> -- Bert >> >> On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault >> wrote: >>> I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. >>> >>> My dataframe, x, ?is structured as below: >>> >>> Col1 >>> abc/def >>> ghi/jkl/mno >>> >>> I found this code on the board but it counts all occurrences of "/" in the dataframe. >>> >>> chr.pos <- which(unlist(strsplit(x,NULL))=='/') >>> chr.count <- length(chr.pos) >>> chr.count >>> [1] 3 >>> >>> I'd like to append a column, say cnt, that has the count of "/" for each row. >>> >>> Can anyone point me in the right direction or offer some code to do this? >>> >>> Thanks in advance for the help. >>> >>> Doug Esneault >>> >>> >>> >>> >>> >>> >>> Privileged/Confidential Information may be contained in this message. If you >>> are not the addressee indicated in this message (or responsible for delivery >>> of the message to such person), you may not copy or deliver this message to >>> anyone. In such case, you should destroy this message and kindly notify the >>> sender by reply email. Please advise immediately if you or your employer >>> does not consent to email for messages of this kind. Opinions, conclusions >>> and other information in this message that do not relate to the official >>> business of the GroupM companies shall be understood as neither given nor >>> endorsed by it. ? GroupM companies are a member of WPP plc. For more >>> information on our business ethical standards and Corporate Responsibility >>> policies please refer to our website at >>> http://www.wpp.com/WPP/About/ >>> >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> >> >> -- >> >> Bert Gunter >> Genentech Nonclinical Biostatistics >> >> Internal Contact Info: >> Phone: 467-7374 >> Website: >> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >> >> ______________________________________________ >> R-help at 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 code. From worikr at gmail.com Fri Dec 2 04:50:53 2011 From: worikr at gmail.com (Worik R) Date: Fri, 2 Dec 2011 16:50:53 +1300 Subject: [R] simple lm question Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From flodel at gmail.com Fri Dec 2 04:59:01 2011 From: flodel at gmail.com (Florent D.) Date: Thu, 1 Dec 2011 22:59:01 -0500 Subject: [R] transform data.frame holding answers --> data.frame holding logicals In-Reply-To: References: <4ED7C7BA.7040408@gmail.com> Message-ID: I have this. I have modified your input structure to be a matrix. I think it is generally recommended to use matrices over data.frames when your data allows it, i.e., when you only have one type of data, here character(). Matrices are easier to work with. x <- matrix(? c('BMW', '', '',? ? 'Mercedes', 'VW', '',? ? 'Skoda', 'VW', 'BMW',? ? '', '', '',? ? 'VW', 'Skoda', ''? ),? ncol=3, dimnames=list(? ? paste('person', 1:5, sep=''),? ? paste( 'v', 1:3, sep='' )? )) brands <- sort(unique(array(x)))[-1]has.used <- t(apply(x, 1, function(a, b){b %in% a}, brands))colnames(has.used) <- brandshas.used On Thu, Dec 1, 2011 at 2:42 PM, Jean V Adams wrote: > saschaview wrote on 12/01/2011 12:30:18 PM: > >> Hello >> >> I have a data frame, x, holding 5 persons answering the question which >> cars they have used: >> >> # the data frame >> x <- as.data.frame( >> ? ?matrix( >> ? ? ?c('BMW', '', '', >> ? ? ? ?'Mercedes', 'VW', '', >> ? ? ? ?'Skoda', 'VW', 'BMW', >> ? ? ? ?'', '', '', >> ? ? ? ?'VW', 'Skoda', '' >> ? ? ?), >> ? ? ?ncol=3, >> ? ? ?dimnames=list( >> ? ? ? ?NULL, >> ? ? ? ?paste( 'v', 1:3, sep='' ) >> ? ? ?) >> ? ?) >> ) >> >> How do I transform this data frame to a data frame stating whether they >> have used the presented car: >> >> ? ? BMW ?Mercedes ?VW ?Skoda >> 1 ?T ? ?F ? ? ? ? F ? F >> 2 ?F ? ?T ? ? ? ? T ? F >> 3 ?T ? ?F ? ? ? ? T ? T >> 4 ?F ? ?F ? ? ? ? F ? F >> 5 ?F ? ?F ? ? ? ? T ? T >> >> My idea was to first find all levels by: >> >> v <- unique(unlist(lapply(x, levels))) >> >> But then I am stuck. >> >> Thanks for help, *S* >> >> -- >> Sascha Vieweg, saschaview at gmail.com > > > Try this: > > uniq.cars <- sort(unique(unlist(x))) > y <- t(apply(x, 1, function(xrow) match(uniq.cars, unique(xrow)))) > dimnames(y)[[2]] <- uniq.cars > y2 <- !is.na(y[, -1]) > y2 > > Jean > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Fri Dec 2 05:09:24 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 1 Dec 2011 23:09:24 -0500 Subject: [R] Summarizing elements of a list In-Reply-To: References: <1322777855869-4142479.post@n4.nabble.com> Message-ID: Similarly, this might work: unlist(lapply(Version1_, `[`,"First")) Michael On Thu, Dec 1, 2011 at 9:41 PM, Sarah Goslee wrote: > How about: > > lapply(Version1_, subset, subset=c(TRUE, FALSE)) > or sapply() depending on what you want the result to look like. > > Thanks for the reproducible example. > > Sarah > > On Thu, Dec 1, 2011 at 5:17 PM, LCOG1 wrote: >> Hi everyone, >> ? I looked around the list for a while but couldn't find a solution to my >> problem. ?I am storing some results to a simulation in a list and for each >> element i have two separate vectors(is that what they are called, correct my >> vocab if necessary). See below >> >> Version1_<-list() >> for(i in 1:5){ >> ? ? ? ?Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1)) >> } >> >> What I want is to put all of the elements' 'First' vectors into a single >> list to box plot. But whats a more elegant solution to the below? >> >> c(Version1_[[1]]$First,Version1_[[2]]$First,Version1_[[3]]$First,Version1_[[4]]$First,Version1_[[5]]$First) >> >> since i have 50 or more simulations this is impractical and sloppy. ?Do I >> need to store my data differently or is their a solution on the back end? >> Thanks all. >> >> Josh >> > -- > Sarah Goslee > http://www.functionaldiversity.org > > ______________________________________________ > R-help at 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 code. From gunter.berton at gene.com Fri Dec 2 05:11:07 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Thu, 1 Dec 2011 20:11:07 -0800 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: strsplit is certainly an alternative, but your approach is unnecessarily complicated and inefficient. Do this, instead: sapply(strsplit(x,"/"),length)-1 Cheers, Bert On Thu, Dec 1, 2011 at 7:44 PM, Florent D. wrote: > Resending my code, not sure why the linebreaks got eaten: > >> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) >> count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == "/") >> within(x, Col2 <- vapply(Col1, count.slashes, 1)) > ? ? ? ? Col1 Col2 > 1 ? ? abc/def ? ?1 > 2 ghi/jkl/mno ? ?2 > > > On Thu, Dec 1, 2011 at 10:32 PM, Florent D. wrote: >> I used within and vapply: >> >> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) >> count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == >> "/")within(x, Col2 <- vapply(Col1, count.slashes, 1)) >> ? ? ? ? ?Col1 Col21 ? ? abc/def ? ?12 ghi/jkl/mno ? ?2 >> >> On Thu, Dec 1, 2011 at 1:05 PM, Bert Gunter wrote: >>> ## It's not a data frame -- it's just a vector. >>> >>>> x >>> [1] "abc/def" ? ? "ghi/jkl/mno" >>>> gsub("[^/]","",x) >>> [1] "/" ?"//" >>>> nchar(gsub("[^/]","",x)) >>> [1] 1 2 >>>> >>> >>> ?gsub >>> ?nchar >>> >>> -- Bert >>> >>> On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault >>> wrote: >>>> I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. >>>> >>>> My dataframe, x, ?is structured as below: >>>> >>>> Col1 >>>> abc/def >>>> ghi/jkl/mno >>>> >>>> I found this code on the board but it counts all occurrences of "/" in the dataframe. >>>> >>>> chr.pos <- which(unlist(strsplit(x,NULL))=='/') >>>> chr.count <- length(chr.pos) >>>> chr.count >>>> [1] 3 >>>> >>>> I'd like to append a column, say cnt, that has the count of "/" for each row. >>>> >>>> Can anyone point me in the right direction or offer some code to do this? >>>> >>>> Thanks in advance for the help. >>>> >>>> Doug Esneault >>>> >>>> >>>> >>>> >>>> >>>> >>>> Privileged/Confidential Information may be contained in this message. If you >>>> are not the addressee indicated in this message (or responsible for delivery >>>> of the message to such person), you may not copy or deliver this message to >>>> anyone. In such case, you should destroy this message and kindly notify the >>>> sender by reply email. Please advise immediately if you or your employer >>>> does not consent to email for messages of this kind. Opinions, conclusions >>>> and other information in this message that do not relate to the official >>>> business of the GroupM companies shall be understood as neither given nor >>>> endorsed by it. ? GroupM companies are a member of WPP plc. For more >>>> information on our business ethical standards and Corporate Responsibility >>>> policies please refer to our website at >>>> http://www.wpp.com/WPP/About/ >>>> >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>> >>> >>> >>> -- >>> >>> Bert Gunter >>> Genentech Nonclinical Biostatistics >>> >>> Internal Contact Info: >>> Phone: 467-7374 >>> Website: >>> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >>> >>> ______________________________________________ >>> R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From Peter.Alspach at plantandfood.co.nz Fri Dec 2 05:13:36 2011 From: Peter.Alspach at plantandfood.co.nz (Peter Alspach) Date: Fri, 2 Dec 2011 17:13:36 +1300 Subject: [R] Plot coordinates with gradien colour according to a different column In-Reply-To: <1322786901097-4143712.post@n4.nabble.com> References: <1322786901097-4143712.post@n4.nabble.com> Message-ID: <3CD374BF2C285940A54C0A71225AF7DB02CAE633DF@AKLEXM01.PFR.CO.NZ> Tena koe Lara If I understand your question correctly, I use the colorspace package for that sort of thing, but you could also use the built-in colour palettes such as rainbow and topo.colors HTH .... Peter Alspach > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of lara > Sent: Friday, 2 December 2011 1:48 p.m. > To: r-help at r-project.org > Subject: [R] Plot coordinates with gradien colour according to a > different column > > Hi everyone, > > I'm having problems with plotting my data. I have a set of positions > with > different attributes and I'm wondering if I can plot it, as x,y plot, > with > gradient colours according to a 3rd factor. Is it possible to show > gradient > segments between postions and not one-coloured segment between each > one? > I've been trying plotrix color.scale.lines with no luck. > I'm very thankful for any help!! > > Cheers, > > Lara > > -- > View this message in context: http://r.789695.n4.nabble.com/Plot- > coordinates-with-gradien-colour-according-to-a-different-column- > tp4143712p4143712.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. The contents of this e-mail are confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, disseminate, distribute or reproduce all or any part of this e-mail or attachments. If you have received this e-mail in error, please notify the sender and delete all material pertaining to this e-mail. Any opinion or views expressed in this e-mail are those of the individual sender and may not represent those of The New Zealand Institute for Plant and Food Research Limited. From flodel at gmail.com Fri Dec 2 05:26:20 2011 From: flodel at gmail.com (Florent D.) Date: Thu, 1 Dec 2011 23:26:20 -0500 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: Inefficient, maybe, but what you suggest does not work if a string starts or ends with a slash. On Thu, Dec 1, 2011 at 11:11 PM, Bert Gunter wrote: > strsplit is certainly an alternative, but your approach is > unnecessarily complicated and inefficient. Do this, instead: > > sapply(strsplit(x,"/"),length)-1 > > Cheers, > Bert > > On Thu, Dec 1, 2011 at 7:44 PM, Florent D. wrote: >> Resending my code, not sure why the linebreaks got eaten: >> >>> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) >>> count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == "/") >>> within(x, Col2 <- vapply(Col1, count.slashes, 1)) >> ? ? ? ? Col1 Col2 >> 1 ? ? abc/def ? ?1 >> 2 ghi/jkl/mno ? ?2 >> >> >> On Thu, Dec 1, 2011 at 10:32 PM, Florent D. wrote: >>> I used within and vapply: >>> >>> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), stringsAsFactors = FALSE) >>> count.slashes <- function(string)sum(unlist(strsplit(string, NULL)) == >>> "/")within(x, Col2 <- vapply(Col1, count.slashes, 1)) >>> ? ? ? ? ?Col1 Col21 ? ? abc/def ? ?12 ghi/jkl/mno ? ?2 >>> >>> On Thu, Dec 1, 2011 at 1:05 PM, Bert Gunter wrote: >>>> ## It's not a data frame -- it's just a vector. >>>> >>>>> x >>>> [1] "abc/def" ? ? "ghi/jkl/mno" >>>>> gsub("[^/]","",x) >>>> [1] "/" ?"//" >>>>> nchar(gsub("[^/]","",x)) >>>> [1] 1 2 >>>>> >>>> >>>> ?gsub >>>> ?nchar >>>> >>>> -- Bert >>>> >>>> On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault >>>> wrote: >>>>> I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. >>>>> >>>>> My dataframe, x, ?is structured as below: >>>>> >>>>> Col1 >>>>> abc/def >>>>> ghi/jkl/mno >>>>> >>>>> I found this code on the board but it counts all occurrences of "/" in the dataframe. >>>>> >>>>> chr.pos <- which(unlist(strsplit(x,NULL))=='/') >>>>> chr.count <- length(chr.pos) >>>>> chr.count >>>>> [1] 3 >>>>> >>>>> I'd like to append a column, say cnt, that has the count of "/" for each row. >>>>> >>>>> Can anyone point me in the right direction or offer some code to do this? >>>>> >>>>> Thanks in advance for the help. >>>>> >>>>> Doug Esneault >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Privileged/Confidential Information may be contained in this message. If you >>>>> are not the addressee indicated in this message (or responsible for delivery >>>>> of the message to such person), you may not copy or deliver this message to >>>>> anyone. In such case, you should destroy this message and kindly notify the >>>>> sender by reply email. Please advise immediately if you or your employer >>>>> does not consent to email for messages of this kind. Opinions, conclusions >>>>> and other information in this message that do not relate to the official >>>>> business of the GroupM companies shall be understood as neither given nor >>>>> endorsed by it. ? GroupM companies are a member of WPP plc. For more >>>>> information on our business ethical standards and Corporate Responsibility >>>>> policies please refer to our website at >>>>> http://www.wpp.com/WPP/About/ >>>>> >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>> >>>> >>>> >>>> -- >>>> >>>> Bert Gunter >>>> Genentech Nonclinical Biostatistics >>>> >>>> Internal Contact Info: >>>> Phone: 467-7374 >>>> Website: >>>> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >>>> >>>> ______________________________________________ >>>> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From dwinsemius at comcast.net Fri Dec 2 05:38:04 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 23:38:04 -0500 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: On Dec 1, 2011, at 11:11 PM, Bert Gunter wrote: > strsplit is certainly an alternative, but your approach is > unnecessarily complicated and inefficient. Do this, instead: > > sapply(strsplit(x,"/"),length)-1 Definitely more compact that the regex alternates I came up with, but one of these still might appeal in situations where it was desireable to have the source strings as labels: > sapply( sapply(x$Col1, gregexpr, patt="/"), length) abc/def ghi/jkl/mno 1 2 > nchar( sapply(x$Col1, gsub, patt="[^/]", rep="" ) ) abc/def ghi/jkl/mno 1 2 -- David > > Cheers, > Bert > > On Thu, Dec 1, 2011 at 7:44 PM, Florent D. wrote: >> Resending my code, not sure why the linebreaks got eaten: >> >>> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), >>> stringsAsFactors = FALSE) >>> count.slashes <- function(string)sum(unlist(strsplit(string, >>> NULL)) == "/") >>> within(x, Col2 <- vapply(Col1, count.slashes, 1)) >> Col1 Col2 >> 1 abc/def 1 >> 2 ghi/jkl/mno 2 >> >> >> On Thu, Dec 1, 2011 at 10:32 PM, Florent D. wrote: >>> I used within and vapply: >>> >>> x <- data.frame(Col1 = c("abc/def", "ghi/jkl/mno"), >>> stringsAsFactors = FALSE) >>> count.slashes <- function(string)sum(unlist(strsplit(string, >>> NULL)) == >>> "/")within(x, Col2 <- vapply(Col1, count.slashes, 1)) >>> Col1 Col21 abc/def 12 ghi/jkl/mno 2 >>> >>> On Thu, Dec 1, 2011 at 1:05 PM, Bert Gunter >>> wrote: >>>> ## It's not a data frame -- it's just a vector. >>>> >>>>> x >>>> [1] "abc/def" "ghi/jkl/mno" >>>>> gsub("[^/]","",x) >>>> [1] "/" "//" >>>>> nchar(gsub("[^/]","",x)) >>>> [1] 1 2 >>>>> >>>> >>>> ?gsub >>>> ?nchar >>>> >>>> -- Bert >>>> >>>> On Thu, Dec 1, 2011 at 8:32 AM, Douglas Esneault >>>> wrote: >>>>> I am new to R but am experienced SAS user and I was hoping to >>>>> get some help on counting the occurrences of a character within >>>>> a string at a row level. >>>>> >>>>> My dataframe, x, is structured as below: >>>>> >>>>> Col1 >>>>> abc/def >>>>> ghi/jkl/mno >>>>> >>>>> I found this code on the board but it counts all occurrences of >>>>> "/" in the dataframe. >>>>> >>>>> chr.pos <- which(unlist(strsplit(x,NULL))=='/') >>>>> chr.count <- length(chr.pos) >>>>> chr.count >>>>> [1] 3 >>>>> >>>>> I'd like to append a column, say cnt, that has the count of "/" >>>>> for each row. >>>>> >>>>> Can anyone point me in the right direction or offer some code to >>>>> do this? >>>>> >>>>> Thanks in advance for the help. >>>>> >>>>> Doug Esneault >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Privileged/Confidential Information may be contained in this >>>>> message. If you >>>>> are not the addressee indicated in this message (or responsible >>>>> for delivery >>>>> of the message to such person), you may not copy or deliver this >>>>> message to >>>>> anyone. In such case, you should destroy this message and kindly >>>>> notify the >>>>> sender by reply email. Please advise immediately if you or your >>>>> employer >>>>> does not consent to email for messages of this kind. Opinions, >>>>> conclusions >>>>> and other information in this message that do not relate to the >>>>> official >>>>> business of the GroupM companies shall be understood as neither >>>>> given nor >>>>> endorsed by it. GroupM companies are a member of WPP plc. For >>>>> more >>>>> information on our business ethical standards and Corporate >>>>> Responsibility >>>>> policies please refer to our website at >>>>> http://www.wpp.com/WPP/About/ >>>>> >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>> >>>> >>>> >>>> -- >>>> >>>> Bert Gunter >>>> Genentech Nonclinical Biostatistics >>>> >>>> Internal Contact Info: >>>> Phone: 467-7374 >>>> Website: >>>> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >>>> >>>> ______________________________________________ >>>> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Fri Dec 2 05:42:58 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 23:42:58 -0500 Subject: [R] simple lm question In-Reply-To: References: Message-ID: On Dec 1, 2011, at 10:50 PM, Worik R wrote: > I really would like to be able to read about this in a document but I > cannot find my way around the documentation properly > > Given the code... > > M <- matrix(runif(5*20), nrow=20) > colnames(M) <- c('a', 'b', 'c', 'd', 'e') > ind <- c(1,2,3,4) > dep <- 5 > > I can then do... > l2 <- lm(M[,dep]~M[,ind]) ## Clearly not useful! > summary(l2) > > I am not sure what my regression formula is. > > The results are (edited for brevity) > >> summary(l2)$coefficients > > Coefficients: > Estimate Std. Error t value Pr(>|t|) > (Intercept) 0.63842 0.16036 3.981 0.00120 ** > M[, ind]a -0.02912 0.17566 -0.166 0.87054 > M[, ind]b -0.21172 0.19665 -1.077 0.29865 > M[, ind]c 0.00752 0.18551 0.041 0.96820 > M[, ind]d 0.06357 0.18337 0.347 0.73366 > > Is there some way I can do this so the coefficients have better > names ('a' > through 'd')? > Use `lm` the way it is designed to be used, with a data argument: > l2 <- lm(e~. , data=as.data.frame(M)) > summary(l2) Call: lm(formula = e ~ ., data = as.data.frame(M)) Residuals: Min 1Q Median 3Q Max -0.5558 -0.2396 0.1257 0.2213 0.4586 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.41110 0.25484 1.613 0.128 a -0.03258 0.28375 -0.115 0.910 b 0.09088 0.25971 0.350 0.731 c 0.09382 0.29555 0.317 0.755 d 0.14725 0.33956 0.434 0.671 Residual standard error: 0.3317 on 15 degrees of freedom Multiple R-squared: 0.04667, Adjusted R-squared: -0.2076 F-statistic: 0.1836 on 4 and 15 DF, p-value: 0.9433 -- David. > As for what I am doing it is not... > > l3 <- lm(M[,1]+M[,2]+M[,3]+M[,4]~M[,5]) > > or > > l4 <- lm(M[,1]*M[,2]*M[,3]*M[,4]~M[,5]) > > cheers > W > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Fri Dec 2 05:55:43 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 1 Dec 2011 23:55:43 -0500 Subject: [R] Assign name to object for each iteration in a loop. In-Reply-To: <1322763198075-4129752.post@n4.nabble.com> References: <1322763198075-4129752.post@n4.nabble.com> Message-ID: On Dec 1, 2011, at 1:13 PM, lglew wrote: > Hi R-users, > > I'm trying to produce decompositions of a multiple time-series, > grouped by a > factor (called "area"). I'm modifying the code in the STLperArea > function of > package ndvits, as this function only plots produces stl plots, it > does not > return the underlying data. > > I want to extract the trend component of each decomposition > ("x$time.series[,trend]), assign a name based on the factor "area". > > My input data look like this: > Area is a factor, with three (but could be many more) levels. > area > 1 > 2 > 3 > > Ystart=2000 > > TS is a timeseries: > > X2000049 X2000065 X2000081 X2000097 X2000113 > 1 0.2080 0.2165 0.2149 0.2314 0.2028 > 2 0.1578 0.1671 0.1577 0.1593 0.1672 > 3 0.1897 0.1948 0.2290 0.2292 0.2067 > > Here's the function: > > STLpA<-function(TS, area, Ystart, period=23, nSG="5,5", DSG=0) > { > require (RTisean) > for(i in 1:unique(area)){ > vi.metric=TS[area==i] > filt.vi<-sav_gol(vi.metric,n=nSG,D=DSG) > vi.sg<-ts(filt.vi[,1], start=Ystart,frequency=period) > stld.tmp<-stl(vi.sg, s.window="periodic", robust=TRUE, > na.action=na.approx) > stld.trend<-stld.temp$time.series[,trend] The line above will probably fail. It is more likely to succeed with: stld.trend<-stld.temp$time.series[ ,"trend"] Unless you have defined a variable named `trend` with a value of "trend". > } > assign(paste("stld", i , sep= "."), stld.trend) > vi.trend<-ls(pattern= "^stld..$") > return(vi.trend) > } > > When I call this function with > signal=STLpA(TS,area,Ystart=2000,period=23, > nSG= "5,5", DSG="0")) > > I get this error: > > Error in cat(list(...), file, sep, fill, labels, append) : You might want to use traceback() at this point to see which of hte functions you did call is sending lists to `cat`. > argument 1 (type 'list') cannot be handled by 'cat' > In addition: Warning message: > In 1:unique(area) : > numerical expression has 3 elements: only the first used > > I'm guessing this is because I'm assigning names to each temporary > stl.trend > file incorrectly. I'm guessing it's not that since I think that step would fail if you got to it for the reasons described above. > Can anyone > improve on my rather poor efforts here? > > Many thanks, > > Louise > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Assign-name-to-object-for-each-iteration-in-a-loop-tp4129752p4129752.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From sachin.abeywardana at gmail.com Fri Dec 2 06:09:32 2011 From: sachin.abeywardana at gmail.com (Sachinthaka Abeywardana) Date: Fri, 2 Dec 2011 16:09:32 +1100 Subject: [R] =?windows-1252?q?R2Cuba_package=2C_failed_with_message_=91Dim?= =?windows-1252?q?ension_out_of_range=92?= Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From akpbond007 at gmail.com Fri Dec 2 05:53:58 2011 From: akpbond007 at gmail.com (arunkumar1111) Date: Thu, 1 Dec 2011 20:53:58 -0800 (PST) Subject: [R] help in dbWriteTable Message-ID: <1322801638400-4145110.post@n4.nabble.com> hi I need some help in dbWriteTable. I'm not able to insert the rows in the table if the column order are not same in the database and in the dataframe which i'm inserting. Also facing issue if the table is already created externally and inserting it thru dbWrite. is there some way that we can sepecify the rownames in the dbwrite..or any method which will solve my problem -- View this message in context: http://r.789695.n4.nabble.com/help-in-dbWriteTable-tp4145110p4145110.html Sent from the R help mailing list archive at Nabble.com. From rroa at azti.es Fri Dec 2 09:19:36 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Fri, 2 Dec 2011 09:19:36 +0100 Subject: [R] how to get inflection point in binomial glm In-Reply-To: <20111201203358.19674ghe8483ub3a@psy2.psych.tu-dresden.de> References: <20111201142447.202239j1pkf17h9b@psy2.psych.tu-dresden.de><115F31EC-7960-4157-B70E-A4DB76D5C2DE@comcast.net> <20111201203358.19674ghe8483ub3a@psy2.psych.tu-dresden.de> Message-ID: <5CD78996B8F8844D963C875D3159B94A02DFF9F8@DSRCORREO.azti.local> Ren?, Yes, to fit a re-parameterized logistic model I think you'd have to code the whole enchilada yourself, not relying on glm (but not nls() as nls() deals with least squares minimization whereas here we want to minimize a minus log binomial likelihood). I did that and have the re-parameterized logistic model in a package I wrote for a colleague (this package has the logistic fit fully functional and documented). My code though only considers one continuous predictor. If you want I may email you this package and you figure out how to deal with the categorical predictor. One thing I believe at this point is that you'd have to do the inference on the continuous predictor _conditional_ on certain level(s) of the categorical predictor. Rub?n -----Mensaje original----- De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] En nombre de Ren? Mayer Enviado el: jueves, 01 de diciembre de 2011 20:34 Para: David Winsemius CC: r-help Help Asunto: Re: [R] how to get inflection point in binomial glm Thanks David and Rub?n! @David: indeed 15 betas I forgot the interaction terms, thanks for correcting! @Rub?n: the re-parameterize would be done within nls()? how to do this practically with including the factor predictor? and yes, we can solve within each group for Y=0 getting 0=b0+b1*X |-b0 -b0=b1*X |/b1 -b0/b1=X but I was hoping there might a more general solution for the case of multiple logistic regression. HTH Ren? Zitat von "David Winsemius" : > > On Dec 1, 2011, at 8:24 AM, Ren? Mayer wrote: > >> Dear All, >> >> I have a binomial response with one continuous predictor (d) and one >> factor (g) (8 levels dummy-coded). >> >> glm(resp~d*g, data, family=binomial) >> >> Y=b0+b1*X1+b2*X2 ... b7*X7 > > Dear Dr Mayer; > > I think it might be a bit more complex than that. I think you should > get 15 betas rather than 8. Have you done it? > >> >> how can I get the inflection point per group, e.g., P(d)=.5 > > Wouldn't that just be at d=1/beta in each group? (Thinking, perhaps > naively, in the case of X=X1 that > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta *d*(X==X1) ) # all other > terms = 0 > > And taking the log of both sides, and then use "middle school" math to solve. > > Oh, wait. Muffed my first try on that for sure. Need to add back both > the constant intercept and the baseline "d" coefficient for the > non-b0 levels. > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d + > beta_n + beta_d_n *d*(X==Xn) ) > > And just > > (Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d ) # for the > reference level. > > This felt like an exam question in my categorical analysis course 25 > years ago. (Might have gotten partial credit for my first stab, > depending on how forgiving the TA was that night.) > >> >> I would be grateful for any help. >> >> Thanks in advance, >> Ren? >> > -- > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ R-help at 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 code. From paul.hiemstra at knmi.nl Fri Dec 2 09:26:52 2011 From: paul.hiemstra at knmi.nl (Paul Hiemstra) Date: Fri, 02 Dec 2011 08:26:52 +0000 Subject: [R] =?windows-1252?q?R2Cuba_package=2C_failed_with_message_=91Dim?= =?windows-1252?q?ension_out_of_range=92?= In-Reply-To: References: Message-ID: <4ED88BCC.8050005@knmi.nl> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From andreas.borg at unimedizin-mainz.de Fri Dec 2 09:53:10 2011 From: andreas.borg at unimedizin-mainz.de (Andreas Borg) Date: Fri, 02 Dec 2011 09:53:10 +0100 Subject: [R] help in dbWriteTable In-Reply-To: <1322801638400-4145110.post@n4.nabble.com> References: <1322801638400-4145110.post@n4.nabble.com> Message-ID: <4ED891F6.6040205@unimedizin-mainz.de> Hello, you can fetch the column names of a table with dbListFields and then reorder or rename the data frame according to those. If you want more specific help, provide an example (RSQLite would be a good choice as database engine to make it easily reproducible for others). Best regards, Andreas arunkumar1111 schrieb: > hi > > I need some help in dbWriteTable. > I'm not able to insert the rows in the table if the column order are not > same in the database and in the dataframe which i'm inserting. Also facing > issue if the table is already created externally and inserting it thru > dbWrite. > > is there some way that we can sepecify the rownames in the dbwrite..or any > method which will solve my problem > > > > -- > View this message in context: http://r.789695.n4.nabble.com/help-in-dbWriteTable-tp4145110p4145110.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. > > -- Andreas Borg Abteilung Medizinische Informatik Universit?tsmedizin der Johannes Gutenberg-Universit?t Mainz Institut f?r Med. Biometrie, Epidemiologie und Informatik (IMBEI) Obere Zahlbacher Stra?e 69, 55131 Mainz Tel: +49 (0) 6131 17-5062 E-Mail: andreas.borg at uni-mainz.de From a.schlicker at nki.nl Fri Dec 2 09:03:23 2011 From: a.schlicker at nki.nl (Andreas Schlicker) Date: Fri, 2 Dec 2011 09:03:23 +0100 Subject: [R] What's the baseline model when using coxph with factor variables? In-Reply-To: References: <4ED7B2A9.1090607@nki.nl> <5BC18E4E-FF2B-4689-AEB9-A755B027B986@comcast.net> Message-ID: <4ED8864B.4070109@nki.nl> William and David, thanks for your help. The contrasts option was indeed what I was looking for but didn't find. andi On 01.12.2011 20:56, David Winsemius wrote: > > On Dec 1, 2011, at 1:00 PM, William Dunlap wrote: > >> Terry will correct me if I'm wrong, but I don't think the >> answer to this question is specific to the coxph function. > > It depends on our interpretation of the questioner's intent. My answer > was predicated on the assumption that the phrase "baseline model" > meant baseline survival function, ... S_0(t) in survival analysis > notation. > > >> For all the [well-written] formula-based modelling functions >> (essentially, those that call model.frame and model.matrix to >> interpret >> the formula) the option "contrasts" controls how factor >> variables are parameterized in the model matrix. contr.treatment >> makes the baseline the first factor level, contr.SAS makes >> the baseline the last, contr.sum makes the baseline the mean, >> etc. E.g., >> >>> df<- data.frame(time=sin(1:20)+2, >> cens=rep(c(0,0,1), len=20), >> var1=factor(rep(0:1, each=10)), >> var2=factor(rep(0:1, 10))) >>> options(contrasts=c("contr.treatment", "contr.treatment")) >>> coxph(Surv(time, cens) ~ var1 + var2, data=df) >> Call: >> coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) >> >> >> coef exp(coef) se(coef) z p >> var11 0.1640 1.18 0.822 0.1995 0.84 >> var21 0.0806 1.08 0.830 0.0971 0.92 >> >> Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of >> events= 6 >>> options(contrasts=c("contr.SAS", "contr.SAS")) >>> coxph(Surv(time, cens) ~ var1 + var2, data=df) >> Call: >> coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) >> >> >> coef exp(coef) se(coef) z p >> var10 -0.1640 0.849 0.822 -0.1995 0.84 >> var20 -0.0806 0.923 0.830 -0.0971 0.92 >> >> Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of >> events= 6 >>> options(contrasts=c("contr.sum", "contr.sum")) >>> coxph(Surv(time, cens) ~ var1 + var2, data=df) >> Call: >> coxph(formula = Surv(time, cens) ~ var1 + var2, data = df) >> >> >> coef exp(coef) se(coef) z p >> var11 -0.0820 0.921 0.411 -0.1995 0.84 >> var21 -0.0403 0.960 0.415 -0.0971 0.92 >> >> Likelihood ratio test=0.05 on 2 df, p=0.974 n= 20, number of >> events= 6 >> >> (lm() has a contrasts argument that can override >> getOption("contrasts") >> and set different contrasts for each variable but coxph() does not >> have >> that argument.) >> >> Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >>> -----Original Message----- >>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org >>> ] On Behalf Of David Winsemius >>> Sent: Thursday, December 01, 2011 9:36 AM >>> To: a.schlicker at nki.nl >>> Cc: r-help at r-project.org >>> Subject: Re: [R] What's the baseline model when using coxph with >>> factor variables? >>> >>> >>> On Dec 1, 2011, at 12:00 PM, Andreas Schlicker wrote: >>> >>>> Hi all, >>>> >>>> I'm trying to fit a Cox regression model with two factor variables >>>> but have some problems with the interpretation of the results. >>>> Considering the following model, where var1 and var2 can assume >>>> value 0 and 1: >>>> >>>> coxph(Surv(time, cens) ~ factor(var1) * factor(var2), data=temp) >>>> >>>> What is the baseline model? Is that considering the whole population >>>> or the case when both var1 and var2 = 0? >>> >>> This has been discussed several times in the past on rhelp. My >>> suggestion would be to search your favorite rhelp archive using >>> "baseline hazard Therneau", since Terry Therneau is the author of >>> survival. (The answer is closer to the first than to the second.) >>> >>>> >>>> Kind regards, >>>> andi >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>> >>> David Winsemius, MD >>> West Hartford, CT >>> >>> ______________________________________________ >>> R-help at 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 code. > > David Winsemius, MD > West Hartford, CT > From aurelien.philippot at gmail.com Fri Dec 2 08:20:00 2011 From: aurelien.philippot at gmail.com (=?ISO-8859-1?Q?Aur=E9lien_PHILIPPOT?=) Date: Thu, 1 Dec 2011 23:20:00 -0800 Subject: [R] Problem subsetting: undefined columns Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From miseno77 at hotmail.com Fri Dec 2 09:55:45 2011 From: miseno77 at hotmail.com (lincoln) Date: Fri, 2 Dec 2011 00:55:45 -0800 (PST) Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis In-Reply-To: References: <1322739265192-4127990.post@n4.nabble.com> <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> <1322754549513-4129048.post@n4.nabble.com> Message-ID: <1322816145585-4145733.post@n4.nabble.com> Thanks. Anyway, it is not homework and I was not told to do that. My question has not been answered yet, I'll try to reformulate it: Does it make (statistical) sense to resample with replacement in this situation to get an estimate of the CIs? In case it does, how could I do it in R? Some further details on my real case study: 10 independent samples from a population in ten sessions. Each sample consists of a number (somehow variable) of random individuals that are classified as 0 or 1 depending on one specific state (presence or absence of a disease). I can calculate, for each session, the percentage of individuals diseased but I have nothing about the CIs, any suggestion? -- View this message in context: http://r.789695.n4.nabble.com/Resampling-with-replacement-on-a-binary-0-1-variable-to-get-CIs-tp4127990p4145733.html Sent from the R help mailing list archive at Nabble.com. From rrasterr at gmail.com Fri Dec 2 10:27:58 2011 From: rrasterr at gmail.com (Ana) Date: Fri, 2 Dec 2011 10:27:58 +0100 Subject: [R] export array Message-ID: What is the best way to export 1 array?? the array i am trying to export has 3 dimensions (long,lat,observations) how can i export each dimension independently? e.g. one csv file with only the long From jholtman at gmail.com Fri Dec 2 11:00:47 2011 From: jholtman at gmail.com (Jim Holtman) Date: Fri, 2 Dec 2011 05:00:47 -0500 Subject: [R] export array In-Reply-To: References: Message-ID: What do you want to do with it after you export; that will probably define what the data format would look like. Why would you want each dimension separately? How would you correlate them later? Is it really 3 dimensions, or is your data just three columns where each row is long, lat and observation? A small subset of the data would be helpful. Are you going to read it back into R, or send it somewhere else? More information would be useful because you can create almost any output format that you want. Sent from my iPad On Dec 2, 2011, at 4:27, Ana wrote: > What is the best way to export 1 array?? > > the array i am trying to export has 3 dimensions (long,lat,observations) > > how can i export each dimension independently? > e.g. one csv file with only the long > > ______________________________________________ > R-help at 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 code. From jholtman at gmail.com Fri Dec 2 11:07:17 2011 From: jholtman at gmail.com (Jim Holtman) Date: Fri, 2 Dec 2011 05:07:17 -0500 Subject: [R] Problem subsetting: undefined columns In-Reply-To: References: Message-ID: ?try If you know that you might have a problem with undefined columns, or whatever, then trap the error with 'try' so your program can recover. You could also validate the data that you are going to use before entering the loop; standard defensive programming - errors are always going to happen, so guard against them. Sent from my iPad On Dec 2, 2011, at 2:20, Aur?lien PHILIPPOT wrote: > Dear R-users, > -I am new to R, and I am struggling with the following problem. > > -I am repeating the following operations hundreds of times, within a loop: > I want to subset a data frame by columns. I am interested in the columns > names that are given by the rows of another data frame that was built in > parallel. The solution I have so far works well as long as the elements of > the second data frame are included in the column names of the first data > frame but if an element from the second object is not a column name of the > first one, then it bugs. > > > -More concretely, I have the following data frames d and v: > yyyymmdd<-c("19720601", "19720602", "19720605") > sret.10006<-c(1,2,3) > sret.10014<-c(5,9,7) > sret.10065<-c(10,2,11) > > > d<- data.frame(yyyymmdd=yyyymmdd, sret.10006=sret.10006, > sret.10014=sret.10014, sret.10065=sret.10065) > > v<- data.frame(V1="sret.10006", V2="sret.10090") > v<- sapply(v, function(x) levels(x)[x]) > > -I want to do the following subsetting: > sub<- subset(d, select=c(v)) > > > and I get the following error message: > Error in `[.data.frame`(x, r, vars, drop = drop) : > undefined columns selected > > > > Any help would be very much appreciated, > > Best, > Aurelien > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From paul.hiemstra at knmi.nl Fri Dec 2 11:07:09 2011 From: paul.hiemstra at knmi.nl (Paul Hiemstra) Date: Fri, 02 Dec 2011 10:07:09 +0000 Subject: [R] Problem subsetting: undefined columns In-Reply-To: References: Message-ID: <4ED8A34D.1030800@knmi.nl> On 12/02/2011 07:20 AM, Aur?lien PHILIPPOT wrote: > Dear R-users, > -I am new to R, and I am struggling with the following problem. > > -I am repeating the following operations hundreds of times, within a loop: > I want to subset a data frame by columns. I am interested in the columns > names that are given by the rows of another data frame that was built in > parallel. The solution I have so far works well as long as the elements of > the second data frame are included in the column names of the first data > frame but if an element from the second object is not a column name of the > first one, then it bugs. Hi Aurelien, I would call this a feature, not a bug. I think R does what it should do, you request a non-existent column and it throws an error. What kind of behavior are you looking for instead of this error? regards, Paul > > -More concretely, I have the following data frames d and v: > yyyymmdd<-c("19720601", "19720602", "19720605") > sret.10006<-c(1,2,3) > sret.10014<-c(5,9,7) > sret.10065<-c(10,2,11) > > > d<- data.frame(yyyymmdd=yyyymmdd, sret.10006=sret.10006, > sret.10014=sret.10014, sret.10065=sret.10065) > > v<- data.frame(V1="sret.10006", V2="sret.10090") > v<- sapply(v, function(x) levels(x)[x]) > > -I want to do the following subsetting: > sub<- subset(d, select=c(v)) > > > and I get the following error message: > Error in `[.data.frame`(x, r, vars, drop = drop) : > undefined columns selected > > > > Any help would be very much appreciated, > > Best, > Aurelien > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Paul Hiemstra, Ph.D. Global Climate Division Royal Netherlands Meteorological Institute (KNMI) Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39 P.O. Box 201 | 3730 AE | De Bilt tel: +31 30 2206 494 http://intamap.geo.uu.nl/~paul http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770 From rrasterr at gmail.com Fri Dec 2 11:07:41 2011 From: rrasterr at gmail.com (Ana) Date: Fri, 2 Dec 2011 11:07:41 +0100 Subject: [R] export array In-Reply-To: References: Message-ID: Hi! I would just like to have a way to check if my functions are working ok. If the subset I am extracting is ok (both coordinates and dataset). The files are nectdf format that I import into R (I only import a small geographic subset). Is there another software that will allow me to do this just to check if my code is ok? On Fri, Dec 2, 2011 at 11:00 AM, Jim Holtman wrote: > What do you want to do with it after you export; that will probably define what the data format would look like. ?Why would you want each dimension separately? ?How would you correlate them later? ?Is it really 3 dimensions, or is your data just three columns where each row is long, lat and observation? ?A small subset of the data would be helpful. Are you going to read it back into R, or send it somewhere else? ?More information would be useful because you can create almost any output format that you want. > > Sent from my iPad > > On Dec 2, 2011, at 4:27, Ana wrote: > >> What is the best way to export 1 array?? >> >> the array i am trying to export has 3 dimensions (long,lat,observations) >> >> how can i export each dimension independently? >> e.g. one csv file with only the long >> >> ______________________________________________ >> R-help at 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 code. From jholtman at gmail.com Fri Dec 2 11:17:19 2011 From: jholtman at gmail.com (Jim Holtman) Date: Fri, 2 Dec 2011 05:17:19 -0500 Subject: [R] export array In-Reply-To: References: Message-ID: <7720466E-8023-488D-960E-4743ACEBCE88@gmail.com> Depends on how you want to 'check'. I usually use 'View' to see if the data looks OK. You could write some more code to check the 'reasonableness' of the data. It sounds like you have to learn some ways of 'debugging' your code. Checking your data depends on what the criteria is for determining correctness. I will also export to Excel to let other people see if it is reasonable, but again it depends on the problem you are trying to solve. Sent from my iPad On Dec 2, 2011, at 5:07, Ana wrote: > Hi! > > I would just like to have a way to check if my functions are working ok. > If the subset I am extracting is ok (both coordinates and dataset). > > The files are nectdf format that I import into R (I only import a > small geographic subset). > Is there another software that will allow me to do this just to check > if my code is ok? > > > > > On Fri, Dec 2, 2011 at 11:00 AM, Jim Holtman wrote: >> What do you want to do with it after you export; that will probably define what the data format would look like. Why would you want each dimension separately? How would you correlate them later? Is it really 3 dimensions, or is your data just three columns where each row is long, lat and observation? A small subset of the data would be helpful. Are you going to read it back into R, or send it somewhere else? More information would be useful because you can create almost any output format that you want. >> >> Sent from my iPad >> >> On Dec 2, 2011, at 4:27, Ana wrote: >> >>> What is the best way to export 1 array?? >>> >>> the array i am trying to export has 3 dimensions (long,lat,observations) >>> >>> how can i export each dimension independently? >>> e.g. one csv file with only the long >>> >>> ______________________________________________ >>> R-help at 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 code. From b.h.mevik at usit.uio.no Fri Dec 2 11:59:07 2011 From: b.h.mevik at usit.uio.no (=?iso-8859-1?Q?Bj=F8rn-Helge_Mevik?=) Date: Fri, 02 Dec 2011 11:59:07 +0100 Subject: [R] question about plsr() results In-Reply-To: <1322767611.79460.YahooMailNeo@web121513.mail.ne1.yahoo.com> (Vytautas Rakeviius's message of "Thu\, 1 Dec 2011 11\:26\:51 -0800 \(PST\)") References: <1322767611.79460.YahooMailNeo@web121513.mail.ne1.yahoo.com> Message-ID: Vytautas Rakeviius writes: > But still I have question about results interpretation. In the end I > want to construct prediction function in form: > Y=a1x1+a2x2 The predict() function does the prediction for you. If you want to construct the prediction _equation_, you can extract the coefficients from the model with coef(yourmodel, ncomp = thenumberofcomponents, intercept = TRUE) See ?coef.mvr for details. > Documentation do not describe this. The pls package is designed to work as much as possible like the lm() function and its methods, helpers. So read any introduction to linear models in R, and you will come a long way. There is also a paper in JSS about the pls package: http://www.jstatsoft.org/v18/i02/ -- Cheers, Bj?rn-Helge Mevik From alaios at yahoo.com Fri Dec 2 12:30:44 2011 From: alaios at yahoo.com (Alaios) Date: Fri, 2 Dec 2011 03:30:44 -0800 (PST) Subject: [R] find and replace string Message-ID: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Fri Dec 2 13:51:13 2011 From: jholtman at gmail.com (jim holtman) Date: Fri, 2 Dec 2011 07:51:13 -0500 Subject: [R] find and replace string In-Reply-To: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> References: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: try this: > x <- c('sta_+1+0_field2ndtry_0000$01.cfg' + , 'sta_+1+0_field2ndtry_0000$01.cfg' + , 'sta_+1-0_field2ndtry_0000$01.cfg' + , 'sta_+1+0_field2ndtry_0000$01.cfg' + ) > # find matching fields > values <- grep("[^+]*\\+[^+]*\\+0", x, value = TRUE) > # split into two pieces > splitValues <- sub("([^+]*\\+[^+]*\\+)0(.*)", "\\1^\\2", values) > for (i in splitValues){ + for (j in 0:3){ + print(sub("\\^", j, i)) + } + } [1] "sta_+1+0_field2ndtry_0000$01.cfg" [1] "sta_+1+1_field2ndtry_0000$01.cfg" [1] "sta_+1+2_field2ndtry_0000$01.cfg" [1] "sta_+1+3_field2ndtry_0000$01.cfg" [1] "sta_+1+0_field2ndtry_0000$01.cfg" [1] "sta_+1+1_field2ndtry_0000$01.cfg" [1] "sta_+1+2_field2ndtry_0000$01.cfg" [1] "sta_+1+3_field2ndtry_0000$01.cfg" [1] "sta_+1+0_field2ndtry_0000$01.cfg" [1] "sta_+1+1_field2ndtry_0000$01.cfg" [1] "sta_+1+2_field2ndtry_0000$01.cfg" [1] "sta_+1+3_field2ndtry_0000$01.cfg" On Fri, Dec 2, 2011 at 6:30 AM, Alaios wrote: > Dear all, > I would like to search in a string for the second occurrence of a symbol and replace the symbol after it > > For example my strings look like > > sta_+1+0_field2ndtry_0000$01.cfg > > I want to find the digit that comes after the second +, in that case is zero > and then over a loop create the strings below > > sta_+1+0_field2ndtry_0000$01.cfg > > sta_+1+1_field2ndtry_0000$01.cfg > > sta_+1+2_field2ndtry_0000$01.cfg > > sta_+1+3_field2ndtry_0000$01.cfg > > and so on.. > I have already tried strsplit but this will make things more complex... > > Could you please help me with that? > > B.R > Alex > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From wolemi2 at yahoo.com Fri Dec 2 10:20:53 2011 From: wolemi2 at yahoo.com (oluwole oyebamiji) Date: Fri, 2 Dec 2011 01:20:53 -0800 (PST) Subject: [R] Intersection of 2 matrices Message-ID: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jos at yuliuskitchen.com Fri Dec 2 10:19:50 2011 From: jos at yuliuskitchen.com (Jos Elkink) Date: Fri, 2 Dec 2011 09:19:50 +0000 Subject: [R] Rmpi installation problems In-Reply-To: References: Message-ID: <20111202091950.GA28128@kaliurang> Hi all, I am trying to install the Rmpi package in R and, while the installation itself works, it breaks down when trying to load the library. I think it has something to do with shared vs static loading of helper libraries, or the order in which shared libraries are loaded, but I am not sure. R version: 2.14.0 Linux version: Gentoo, i686-pc-linux-gnu (32-bit) GCC version: 4.5.3 (Gentoo 4.5.3-r1 p1.0) OpenMPI version: 1.5.4 Output from R CMD INSTALL . in Rmpi source directory: * installing to library ?/home/jos/R/i686-pc-linux-gnu-library/2.14? * installing *source* package ?Rmpi? ... checking for gcc... i686-pc-linux-gnu-gcc -std=gnu99 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether i686-pc-linux-gnu-gcc -std=gnu99 accepts -g... yes checking for i686-pc-linux-gnu-gcc -std=gnu99 option to accept ISO C89... none needed I am here /usr and it is OpenMPI Trying to find mpi.h ... Found in /usr/include Trying to find libmpi.so or libmpich.a ... Found libmpi in /usr/lib checking for openpty in -lutil... yes checking for main in -lpthread... yes configure: creating ./config.status config.status: creating src/Makevars ** Creating default NAMESPACE file ** libs make: Nothing to be done for `all'. installing to /home/jos/R/i686-pc-linux-gnu-library/2.14/Rmpi/libs ** R ** demo ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded /usr/lib/R/bin/exec/R: symbol lookup error: /usr/lib/openmpi/mca_paffinity_hwloc.so: undefined symbol: mca_base_param_reg_int ERROR: loading failed * removing ?/home/jos/R/i686-pc-linux-gnu-library/2.14/Rmpi? Any help would be greatly appreciated! Jos From cjpauw at gmail.com Fri Dec 2 13:52:36 2011 From: cjpauw at gmail.com (christiaan pauw) Date: Fri, 2 Dec 2011 14:52:36 +0200 Subject: [R] find and replace string In-Reply-To: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> References: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: If the length of the fists part is constant (the "sta_+1+" part) the you can use substr() On 2 December 2011 13:30, Alaios wrote: > Dear all, > I would like to search in a string for the second occurrence of a symbol and replace the symbol after it > > For example my strings look like > > sta_+1+0_field2ndtry_0000$01.cfg > > I want to find the digit that comes after the second +, in that case is zero > and then over a loop create the strings below > > sta_+1+0_field2ndtry_0000$01.cfg > > sta_+1+1_field2ndtry_0000$01.cfg > > sta_+1+2_field2ndtry_0000$01.cfg > > sta_+1+3_field2ndtry_0000$01.cfg > > and so on.. > I have already tried strsplit but this will make things more complex... > > Could you please help me with that? > > B.R > Alex > -- Christiaan Pauw Nova Institute www.nova.org.za From narendarcse007 at gmail.com Fri Dec 2 12:23:03 2011 From: narendarcse007 at gmail.com (narendarreddy kalam) Date: Fri, 2 Dec 2011 03:23:03 -0800 (PST) Subject: [R] about quantreg() package loading Message-ID: <1322824983856-4146366.post@n4.nabble.com> Hi all, i have installed the quantreg Package using the install packages from local zip fiels option. then i got the following message utils:::menuInstallLocal() package ?quantreg? successfully unpacked and MD5 sums checked is that mean quantreg package got installed on my machine?? if so why i am encountered the following error when loading quantreg package using library(quantreg) command Loading required package: SparseM Error: package ?SparseM? could not be loaded In addition: Warning message: In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called ?SparseM? what is the reason for it.. pls reply as early as possible -- View this message in context: http://r.789695.n4.nabble.com/about-quantreg-package-loading-tp4146366p4146366.html Sent from the R help mailing list archive at Nabble.com. From narendarcse007 at gmail.com Fri Dec 2 12:30:21 2011 From: narendarcse007 at gmail.com (narendarreddy kalam) Date: Fri, 2 Dec 2011 03:30:21 -0800 (PST) Subject: [R] about quantreg() package loading In-Reply-To: <1322824983856-4146366.post@n4.nabble.com> References: <1322824983856-4146366.post@n4.nabble.com> Message-ID: <1322825421006-4146390.post@n4.nabble.com> Hi all, my os is windows 7 and R version is 2.14.and i used the qunatreg zip file(binary version for windows) to install. -- View this message in context: http://r.789695.n4.nabble.com/about-quantreg-package-loading-tp4146366p4146390.html Sent from the R help mailing list archive at Nabble.com. From shyamabc2002 at yahoo.com Fri Dec 2 12:56:13 2011 From: shyamabc2002 at yahoo.com (shyam basnet) Date: Fri, 2 Dec 2011 03:56:13 -0800 (PST) Subject: [R] Error message in Genetic Matching Message-ID: <1322826973.76013.YahooMailNeo@web161703.mail.bf1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From alaios at yahoo.com Fri Dec 2 14:04:43 2011 From: alaios at yahoo.com (Alaios) Date: Fri, 2 Dec 2011 05:04:43 -0800 (PST) Subject: [R] find and replace string In-Reply-To: References: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: <1322831083.83340.YahooMailNeo@web120104.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Fri Dec 2 14:40:35 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Fri, 2 Dec 2011 08:40:35 -0500 Subject: [R] about quantreg() package loading In-Reply-To: <1322825421006-4146390.post@n4.nabble.com> References: <1322824983856-4146366.post@n4.nabble.com> <1322825421006-4146390.post@n4.nabble.com> Message-ID: <9F1B41A6-46AD-46A1-AFE0-6ACEBCC06234@gmail.com> It means you also need to install SparseM on which quantreg depends. This can be done in exactly the same way, either by direct download using install.packages() or local install. Michael On Dec 2, 2011, at 6:30 AM, narendarreddy kalam wrote: > Hi all, > my os is windows 7 and R version is 2.14.and i used the qunatreg zip > file(binary version for windows) to install. > > -- > View this message in context: http://r.789695.n4.nabble.com/about-quantreg-package-loading-tp4146366p4146390.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From dwinsemius at comcast.net Fri Dec 2 14:48:59 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 08:48:59 -0500 Subject: [R] Intersection of 2 matrices In-Reply-To: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> References: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> Message-ID: <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> On Dec 2, 2011, at 4:20 AM, oluwole oyebamiji wrote: > Hi all, > I have matrix A of 67420 by 2 and another matrix B of 59199 by > 2. I would like to find the number of rows of matrix B that I can > find in matrix A (rows that are common to both matrices with or > without sorting). > > I have tried the "intersection" and "is.element" functions in R but > it only working for the vectors and not matrix > i.e, intersection(A,B) and is.element(A,B). Have you considered the 'duplicated' function? -- David Winsemius, MD West Hartford, CT From patrick.breheny at uky.edu Fri Dec 2 15:08:18 2011 From: patrick.breheny at uky.edu (Patrick Breheny) Date: Fri, 2 Dec 2011 09:08:18 -0500 Subject: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred In-Reply-To: References: <2F36BA38-DD8B-4660-ACA1-709750BE0D35@gmail.com> <3684DD42-A6F4-487C-B7C0-220C044FF843@gmail.com> Message-ID: <4ED8DBD2.3080505@uky.edu> On 12/01/2011 08:00 PM, Ben quant wrote: > The data I am using is the last file called l_yx.RData at this link (the > second file contains the plots from earlier): > http://scientia.crescat.net/static/ben/ The logistic regression model you are fitting assumes a linear relationship between x and the log odds of y; that does not seem to be the case for your data. To illustrate: x <- l_yx[,"x"] y <- l_yx[,"y"] ind1 <- x <= .002 ind2 <- (x > .002 & x <= .0065) ind3 <- (x > .0065 & x <= .13) ind4 <- (x > .0065 & x <= .13) > summary(glm(y[ind1]~x[ind1],family=binomial)) ... Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.79174 0.02633 -106.03 <2e-16 *** x[ind1] 354.98852 22.78190 15.58 <2e-16 *** > summary(glm(y[ind2]~x[ind2],family=binomial)) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.15805 0.02966 -72.766 <2e-16 *** x[ind2] -59.92934 6.51650 -9.197 <2e-16 *** > summary(glm(y[ind3]~x[ind3],family=binomial)) ... Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.367206 0.007781 -304.22 <2e-16 *** x[ind3] 18.104314 0.346562 52.24 <2e-16 *** > summary(glm(y[ind4]~x[ind4],family=binomial)) ... Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.31511 0.08549 -15.383 <2e-16 *** x[ind4] 0.06261 0.08784 0.713 0.476 To summarize, the relationship between x and the log odds of y appears to vary dramatically in both magnitude and direction depending on which interval of x's range we're looking at. Trying to summarize this complicated pattern with a single line is leading to the fitted probabilities near 0 and 1 you are observing (note that only 0.1% of the data is in region 4 above, although region 4 accounts for 99.1% of the range of x). -- Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky From dwinsemius at comcast.net Fri Dec 2 15:22:05 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 09:22:05 -0500 Subject: [R] Resampling with replacement on a binary (0, 1) dataset to get Cis In-Reply-To: <1322816145585-4145733.post@n4.nabble.com> References: <1322739265192-4127990.post@n4.nabble.com> <69C9F7F8-E011-470C-B89D-D21611ED0FA4@comcast.net> <1322754549513-4129048.post@n4.nabble.com> <1322816145585-4145733.post@n4.nabble.com> Message-ID: On Dec 2, 2011, at 3:55 AM, lincoln wrote: > Thanks. > Anyway, it is not homework and I was not told to do that. My > question has > not been answered yet, I'll try to reformulate it: > Does it make (statistical) sense to resample with replacement in this > situation to get an estimate of the CIs? In case it does, how could > I do it > in R? > Some further details on my real case study: > 10 independent samples from a population in ten sessions. Each sample > consists of a number (somehow variable) of random individuals that are > classified as 0 or 1 depending on one specific state (presence or > absence of > a disease). > I can calculate, for each session, the percentage of individuals > diseased > but I have nothing about the CIs, any suggestion? I do not see much advantage to using resampling in this instance. The variance of a proportion is not theoretically complicated and you have introduced no further complicating factors that would call into question the validity of the estimates you would get from prop.test. -- David Winsemius, MD West Hartford, CT From sarah.goslee at gmail.com Fri Dec 2 15:25:57 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Fri, 2 Dec 2011 09:25:57 -0500 Subject: [R] find and replace string In-Reply-To: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> References: <1322825444.44008.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: You've been given a workable solution already, but here's a one-liner: > x <- c('sta_+1+0_field2ndtry_0000$01.cfg' , 'sta_+B+0_field2ndtry_0000$01.cfg' , 'sta_+1+0_field2ndtry_0000$01.cfg' , 'sta_+9+0_field2ndtry_0000$01.cfg') > sapply(1:length(x), function(i)gsub("\\+(.*)\\+.", paste("\\+\\1\\+", i, sep=""), x[i])) [1] "sta_+1+1_field2ndtry_0000$01.cfg" "sta_+B+2_field2ndtry_0000$01.cfg" [3] "sta_+1+3_field2ndtry_0000$01.cfg" "sta_+9+4_field2ndtry_0000$01.cfg" Sarah, fan of regular expressions On Fri, Dec 2, 2011 at 6:30 AM, Alaios wrote: > Dear all, > I would like to search in a string for the second occurrence of a symbol and replace the symbol after it > > For example my strings look like > > sta_+1+0_field2ndtry_0000$01.cfg > > I want to find the digit that comes after the second +, in that case is zero > and then over a loop create the strings below > > sta_+1+0_field2ndtry_0000$01.cfg > > sta_+1+1_field2ndtry_0000$01.cfg > > sta_+1+2_field2ndtry_0000$01.cfg > > sta_+1+3_field2ndtry_0000$01.cfg > > and so on.. > I have already tried strsplit but this will make things more complex... > > Could you please help me with that? > > B.R > Alex > -- Sarah Goslee http://www.functionaldiversity.org From jvadams at usgs.gov Fri Dec 2 15:29:38 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Fri, 2 Dec 2011 08:29:38 -0600 Subject: [R] Fw: calculate mean of multiple rows in a data frame In-Reply-To: <1322774139.12733.YahooMailClassic@web28501.mail.ukl.yahoo.com> References: <1322774139.12733.YahooMailClassic@web28501.mail.ukl.yahoo.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tal.galili at gmail.com Fri Dec 2 15:51:33 2011 From: tal.galili at gmail.com (Tal Galili) Date: Fri, 2 Dec 2011 16:51:33 +0200 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From james.foadi at diamond.ac.uk Fri Dec 2 16:03:58 2011 From: james.foadi at diamond.ac.uk (james.foadi at diamond.ac.uk) Date: Fri, 2 Dec 2011 15:03:58 +0000 Subject: [R] what is used as height in hclust for ward linkage? Message-ID: Dear R community, I am trying to understand how the ward linkage works from a quantitative point of view. To test it I have devised a simple 3-members set: G = c(0,2,10) The distances between all couples are: d(0,2) = 2 d(0,10) = 10 d(2,10) = 8 The smallest distance corresponds to merging 0 and 2. The corresponding ESS are: ESS(0,2) = 2*var(c(0,2)) = 4 ESS(0,10) = 2*var(c(0,10)) = 100 ESS(2,10) = 2*var(c(2,10)) = 64 and, indeed, the smallest ESS corresponds to merging 0 and 2. The next element that should be added to 0 and 2 is obviously 10. This is where I don't understand how the hclust algorithm in R works. We have > G <- c(0,2,10) > G.dist <- dist(G) > G.hc <- hclust(G.dist,method="ward") > G.hc$merge [,1] [,2] [1,] -1 -2 [2,] -3 1 > G.hc$height [1] 2.00000 11.33333 Now, according to standard definitions, the distance between two clusters with elements Nr and Ns is: d(Rs,Rr) = sqrt(2*Nr*Ns/(Nr+Ns))*|| - || where < > in the last expression indicates averages (centroids). If I carry out this operation to merge cluster c(0,2) with 10, I get: d(c(0,2),10) = sqrt(2*2*1/(2+1))*|1-9| = 9.237604 This is different from 11.3333 in the R output. Does anyone know what's the exact value for the ward linkage, as displayed in the hclust height output? Thanks in advance for any help! J -- This e-mail and any attachments may contain confidential...{{dropped:8}} From gunter.berton at gene.com Fri Dec 2 16:06:30 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Fri, 2 Dec 2011 07:06:30 -0800 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? In-Reply-To: References: Message-ID: ?ordered ?C ?contr.poly If you don't know what polynomial contrasts are, consult any good linear models text. MASS has a good, though a bit terse, section on this. -- Bert On Fri, Dec 2, 2011 at 6:51 AM, Tal Galili wrote: > Hello dear all, > > I am unable to understand why when I run the following three lines: > > set.seed(4254) >> a <- data.frame(y = rnorm(40), x=ordered(sample(1:5, 40, T))) >> summary(lm(y ~ x, a)) > > > The output I get includes factor levels which are not relevant to what I am > actually using: > > Call: >> lm(formula = y ~ x, data = a) >> Residuals: >> ? ? Min ? ? ?1Q ?Median ? ? ?3Q ? ? Max >> -1.4096 -0.6400 -0.1244 ?0.5886 ?2.1891 >> Coefficients: >> ? ? ? ? ? ? Estimate Std. Error t value Pr(>|t|) >> (Intercept) -0.03276 ? ?0.15169 ?-0.216 ? ?0.830 >> x.L ? ? ? ? -0.28968 ? ?0.33866 ?-0.855 ? ?0.398 >> x.Q ? ? ? ? -0.38813 ? ?0.33851 ?-1.147 ? ?0.259 >> x.C ? ? ? ? -0.27183 ? ?0.34027 ?-0.799 ? ?0.430 >> x^4 ? ? ? ? ?0.25993 ? ?0.33935 ? 0.766 ? ?0.449 >> Residual standard error: 0.9564 on 35 degrees of freedom >> Multiple R-squared: 0.08571, Adjusted R-squared: -0.01878 >> F-statistic: 0.8202 on 4 and 35 DF, ?p-value: 0.5211 > > > I am guessing that this is having something to do with the contrast matrix > that is used, but this is not clear to me. > Can anyone suggest a good read, or an explanation? > > Thanks. > > > ----------------Contact > Details:------------------------------------------------------- > Contact me: Tal.Galili at gmail.com | ?972-52-7275845 > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | > www.r-statistics.com (English) > ---------------------------------------------------------------------------------------------- > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From gunter.berton at gene.com Fri Dec 2 16:08:49 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Fri, 2 Dec 2011 07:08:49 -0800 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? In-Reply-To: References: Message-ID: Maybe should have explicitly said: > C(ordered(1:5)) [1] 1 2 3 4 5 attr(,"contrasts") ordered contr.poly Levels: 1 < 2 < 3 < 4 < 5 -- Bert On Fri, Dec 2, 2011 at 7:06 AM, Bert Gunter wrote: > ?ordered > ?C > ?contr.poly > > If you don't know what polynomial contrasts are, consult any good > linear models text. MASS has a good, though a bit terse, section on > this. > > -- Bert > > On Fri, Dec 2, 2011 at 6:51 AM, Tal Galili wrote: >> Hello dear all, >> >> I am unable to understand why when I run the following three lines: >> >> set.seed(4254) >>> a <- data.frame(y = rnorm(40), x=ordered(sample(1:5, 40, T))) >>> summary(lm(y ~ x, a)) >> >> >> The output I get includes factor levels which are not relevant to what I am >> actually using: >> >> Call: >>> lm(formula = y ~ x, data = a) >>> Residuals: >>> ? ? Min ? ? ?1Q ?Median ? ? ?3Q ? ? Max >>> -1.4096 -0.6400 -0.1244 ?0.5886 ?2.1891 >>> Coefficients: >>> ? ? ? ? ? ? Estimate Std. Error t value Pr(>|t|) >>> (Intercept) -0.03276 ? ?0.15169 ?-0.216 ? ?0.830 >>> x.L ? ? ? ? -0.28968 ? ?0.33866 ?-0.855 ? ?0.398 >>> x.Q ? ? ? ? -0.38813 ? ?0.33851 ?-1.147 ? ?0.259 >>> x.C ? ? ? ? -0.27183 ? ?0.34027 ?-0.799 ? ?0.430 >>> x^4 ? ? ? ? ?0.25993 ? ?0.33935 ? 0.766 ? ?0.449 >>> Residual standard error: 0.9564 on 35 degrees of freedom >>> Multiple R-squared: 0.08571, Adjusted R-squared: -0.01878 >>> F-statistic: 0.8202 on 4 and 35 DF, ?p-value: 0.5211 >> >> >> I am guessing that this is having something to do with the contrast matrix >> that is used, but this is not clear to me. >> Can anyone suggest a good read, or an explanation? >> >> Thanks. >> >> >> ----------------Contact >> Details:------------------------------------------------------- >> Contact me: Tal.Galili at gmail.com | ?972-52-7275845 >> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | >> www.r-statistics.com (English) >> ---------------------------------------------------------------------------------------------- >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From dwinsemius at comcast.net Fri Dec 2 16:04:42 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 10:04:42 -0500 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? In-Reply-To: References: Message-ID: <10642CFF-6870-4674-A1BE-7F78520B4878@comcast.net> On Dec 2, 2011, at 9:51 AM, Tal Galili wrote: > Hello dear all, > > I am unable to understand why when I run the following three lines: > > set.seed(4254) >> a <- data.frame(y = rnorm(40), x=ordered(sample(1:5, 40, T))) >> summary(lm(y ~ x, a)) > > > The output I get includes factor levels which are not relevant to > what I am > actually using: > > Call: >> lm(formula = y ~ x, data = a) >> Residuals: >> Min 1Q Median 3Q Max >> -1.4096 -0.6400 -0.1244 0.5886 2.1891 >> Coefficients: >> Estimate Std. Error t value Pr(>|t|) >> (Intercept) -0.03276 0.15169 -0.216 0.830 >> x.L -0.28968 0.33866 -0.855 0.398 >> x.Q -0.38813 0.33851 -1.147 0.259 >> x.C -0.27183 0.34027 -0.799 0.430 >> x^4 0.25993 0.33935 0.766 0.449 Those are polynomial contrasts: linear, quadratic, cubic and quartic. If you don't want contrasts based on ordered factors then just use regular factors. You should probably be looking at: ?"C" (...yet another function whose name should be avoided in naming data- objects.) -- David. >> Residual standard error: 0.9564 on 35 degrees of freedom >> Multiple R-squared: 0.08571, Adjusted R-squared: -0.01878 >> F-statistic: 0.8202 on 4 and 35 DF, p-value: 0.5211 > > > I am guessing that this is having something to do with the contrast > matrix > that is used, but this is not clear to me. > Can anyone suggest a good read, or an explanation? > > Thanks. > > > ----------------Contact > Details:------------------------------------------------------- > Contact me: Tal.Galili at gmail.com | 972-52-7275845 > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il > (Hebrew) | > www.r-statistics.com (English) > ---------------------------------------------------------------------------------------------- > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From sonja.braaker at wsl.ch Fri Dec 2 14:39:22 2011 From: sonja.braaker at wsl.ch (Sonja Braaker) Date: Fri, 02 Dec 2011 14:39:22 +0100 Subject: [R] Save Venn-diagram (Vennerable) together with table and plot in single pdf page Message-ID: <4ED8D50A.4050707@wsl.ch> Dear R-users I want to save a list with characters a point plot and a Venn diagram in a single pdf page. I am successful to do this when I use a character list and two point plots. However when I try to replace the first point plots with my Venn diagram (built with Vennerable package, compute.Venn() and plot.Venn()) the Venn plot will not position at the right place in the pdf. I guess there are some parameters in the plot.Venn function, that I need to change but I did not find out which ones. Here an example of the pdf with two point plots as I want it: library(gplots) library(Vennerable) Varnames<-c("A","B","C") x <- Venn(SetNames = Varnames,Weight = c(`100`=2,`010`=6,`001`=10,`110`=1, `011`=0.2, `101`=0.5,`111`=1)) cx<-compute.Venn(x,doWeights = TRUE) tabletext<-paste("Variable: ",letters[1:8],sep="") pdf("path/plot_test.pdf", fillOddEven=TRUE,paper="a4", onefile=TRUE,width=7,height=10) layout(matrix(c(1,2,2,1,2,2,3,3,3), 3, 3, byrow = TRUE),heights=c(1,1,2)) par(mar=c(6,2,2,4)) textplot(tabletext,valign="top",halign="left",cex=2) plot(rnorm(100),main="Random 1") plot(rnorm(100),col="red",main="Random2") dev.off() And here the example of the pdf with where I try to replace the "Random1" point plot with a Venn diagram (wrong size and position of Venn diagram): pdf("path/venn_test.pdf", fillOddEven=TRUE,paper="a4", onefile=TRUE,width=7,height=10) layout(matrix(c(1,2,2,1,2,2,3,3,3), 3, 3, byrow = TRUE),heights=c(1,1,2)) par(mar=c(6,2,2,4)) textplot(tabletext,valign="top",halign="left",cex=2) plot(cx) plot(rnorm(100),col="red",main="Random2") dev.off() Would be thankful for any hints Sonja -- Sonja Braaker Swiss Federal Research Institute WSL Community Ecology Z?rcherstrasse 111 CH-8903 Birmensdorf Tel. +41 44 7392 230 Fax +41 44 7392 215 sonja.braaker at wsl.ch http://www.wsl.ch/info/mitarbeitende/braaker/index_EN From dyb at noc.ac.uk Fri Dec 2 14:46:19 2011 From: dyb at noc.ac.uk (Berry, David I.) Date: Fri, 2 Dec 2011 13:46:19 +0000 Subject: [R] R, PostgresSQL and poor performance In-Reply-To: Message-ID: On 01/12/2011 17:01, "Gabor Grothendieck" wrote: >On Thu, Dec 1, 2011 at 10:02 AM, Berry, David I. wrote: >> Hi List >> >> Apologies if this isn't the correct place for this query (I've tried a >>search of the mail archives but not had much joy). >> >> I'm running R (2.14.0) on a Mac (OSX v 10.5.8, 2.66GHz, 4GB memory) >>and am having a few performance issues with reading data in from a >>Postres database (using RPostgreSQL). My query / code are as below >> >> # ----------------------------- >> library('RPostgreSQL') >> >> drv <- dbDriver("PostgreSQL") >> >> dbh <- dbConnect(drv,user="?",password="?",dbname="?",host="?") >> >> sql <- "select id, date, lon, lat, date_trunc('day' , date) as jday, >>extract('hour' from date) as hour, extract('year' from date) as year >>from observations where pt = 6 and date >= '1990-01-01' and date < >>'1995-01-01' and lon > 180 and lon < 290 and lat > -30 and lat < 30 and >>sst is not null" >> >> dataIn <- dbGetQuery(dbh,sql) > >If this is a large table of which the desired rows are a small >fraction of all rows then be sure there indexes on the variables in >your where clause. > >You can also try it with the RpgSQL driver although there is no reason >to think that that would be faster. > >-- >Statistics & Software Consulting >GKX Group, GKX Associates Inc. >tel: 1-877-GKX-GROUP >email: ggrothendieck at gmail.com Thanks for the reply and suggestions. I've tried the RpgSQL drivers and the results are pretty similar in terms of performance. The ~1.5M records I'm trying to read into R are being extracted from a table with ~300M rows (and ~60 columns) that has been indexed on the relevant columns and horizontally partitioned (with constraint checking on). I do need to try and optimize the database a bit more but I don?t think this is the cause of the performance issues. As an example, when I run the query purely in R it takes 273s to run (using system.time() to time it). When I extract the data via psql and system() and then import it into R using read.table() it takes 32s. The code I've used for both are below. The second way of doing it (psql and read.table()) is less than ideal but does seem to have a big performance advantage at the moment ? the only difference in the results is that the date variables are stored as strings in the second example. # Query purely in R # ------------------------ dbh <- dbConnect(drv,user="?",password="?", dbname="?",host="?") sql <- "select id, date, lon, lat, date_trunc('day' , date) as jday, extract('hour' from date) as hour, extract('year' from date) as year from observations where pt = 6 and date >= '1990-01-01' and date < '1995-01-01' and lon > 180 and lon < 290 and lat > -30 and lat < 30 and sst is not null;" dataIn <- dbGetQuery(dbh,sql) # Query via command line # ---------------------------------- system('psql ?h myhost ?d mydb ?U myuid ?f getData.sql') system('cat tmp.csv | sed 's/^,/""&/g;s/^[0-9a-zA-Z]\+/"&"/g' > tmp2.csv') # This just ensures the first column is quoted dataIn <- read.table('tmp2.csv',sep=',' ,col.names=c( "id","date","lon","lat","jday","hour","year") ) # Contents of getData.sql # --------------------------------- \o ./tmp.csv \pset format unaligned \pset fieldsep ',' \pset tuples_only select id, date, lon, lat, date_trunc('day' , date) as jday, extract('hour' from date) as hour, extract('year' from date) as year from observations where pt = 6 and date >= '1990-01-01' and date < '1995-01-01' and lon > 180 and lon < 290 and lat > -30 and lat < 30 and sst is not null; \q ---------------------------------------------- David Berry National Oceanography Centre, UK -- This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system. From shyamabc2002 at yahoo.com Fri Dec 2 15:16:12 2011 From: shyamabc2002 at yahoo.com (shyam basnet) Date: Fri, 2 Dec 2011 06:16:12 -0800 (PST) Subject: [R] Error in Genetic Matching Message-ID: <1322835372.39181.YahooMailNeo@web161706.mail.bf1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From richardtoss at hotmail.com Fri Dec 2 15:43:00 2011 From: richardtoss at hotmail.com (RToss) Date: Fri, 2 Dec 2011 06:43:00 -0800 (PST) Subject: [R] How to test for Poisson? Message-ID: <1322836980746-4147356.post@n4.nabble.com> Hi! I am sitting with a school assignment, but I got stuck on this one. I am suppose to test if my data is Poisson-distributed. The data I?m using is the studie "Bids", found in the Ecdat-package, and the variable of interest is the dependent "numbids". How do I practically perform a test for this? Kind regards/ Richard -- View this message in context: http://r.789695.n4.nabble.com/How-to-test-for-Poisson-tp4147356p4147356.html Sent from the R help mailing list archive at Nabble.com. From irene_vrbik at hotmail.com Fri Dec 2 16:09:21 2011 From: irene_vrbik at hotmail.com (statfan) Date: Fri, 2 Dec 2011 07:09:21 -0800 (PST) Subject: [R] breaking up n object into random groups Message-ID: <1322838561294-4147476.post@n4.nabble.com> say n = 100 I want to partition this into 4 random groups wheren n1 + n2 + n3 + n4 = n and ni is the number of elements in group i. Thank you for you help -- View this message in context: http://r.789695.n4.nabble.com/breaking-up-n-object-into-random-groups-tp4147476p4147476.html Sent from the R help mailing list archive at Nabble.com. From bps0002 at auburn.edu Fri Dec 2 16:18:25 2011 From: bps0002 at auburn.edu (B77S) Date: Fri, 2 Dec 2011 07:18:25 -0800 (PST) Subject: [R] How to test for Poisson? In-Reply-To: <1322836980746-4147356.post@n4.nabble.com> References: <1322836980746-4147356.post@n4.nabble.com> Message-ID: <1322839105718-4147519.post@n4.nabble.com> A simple way to determine if it is NOT is to see if the mean (the single parameter of a poisson: lambda) and variance are the same. This really has nothing to do with R (other than the data source), and since it is homework, you will likely get no further help here. Good luck. RToss wrote > > Hi! > > I am sitting with a school assignment, but I got stuck on this one. > I am suppose to test if my data is Poisson-distributed. > The data I?m using is the studie "Bids", found in the Ecdat-package, and > the variable of interest is the dependent "numbids". > How do I practically perform a test for this? > > Kind regards/ Richard > -- View this message in context: http://r.789695.n4.nabble.com/How-to-test-for-Poisson-tp4147356p4147519.html Sent from the R help mailing list archive at Nabble.com. From dwinsemius at comcast.net Fri Dec 2 16:22:34 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 10:22:34 -0500 Subject: [R] breaking up n object into random groups In-Reply-To: <1322838561294-4147476.post@n4.nabble.com> References: <1322838561294-4147476.post@n4.nabble.com> Message-ID: On Dec 2, 2011, at 10:09 AM, statfan wrote: > say n = 100 > I want to partition this into 4 random groups wheren n1 + n2 + n3 + > n4 = n > and ni is the number of elements in group i. > Try assigning with a sample() from: unlist(mapply(rep, c(1:4), each=c(n1,n2,n3,n4))) -- David Winsemius, MD West Hartford, CT From gunter.berton at gene.com Fri Dec 2 16:28:15 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Fri, 2 Dec 2011 07:28:15 -0800 Subject: [R] breaking up n object into random groups In-Reply-To: <1322838561294-4147476.post@n4.nabble.com> References: <1322838561294-4147476.post@n4.nabble.com> Message-ID: There are a million ways to do this, probably. brks <- c(1,sort(sample(seq_len(99),3)),100) ## 4 random groups and then use brks as the breaks parameter in cut() with include.lowest = TRUE ?cut -- Bert On Fri, Dec 2, 2011 at 7:09 AM, statfan wrote: > say n = 100 > I want to partition this into 4 random groups wheren n1 + n2 + n3 + n4 = n > and ni is the number of elements in group i. > > Thank you for you help > > -- > View this message in context: http://r.789695.n4.nabble.com/breaking-up-n-object-into-random-groups-tp4147476p4147476.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From kendejan at yahoo.fr Fri Dec 2 17:15:24 2011 From: kendejan at yahoo.fr (kende jan) Date: Fri, 2 Dec 2011 16:15:24 +0000 (GMT) Subject: [R] CART with rpart Message-ID: <1322842524.46799.YahooMailNeo@web25401.mail.ukl.yahoo.com> Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : From tal.galili at gmail.com Fri Dec 2 17:40:49 2011 From: tal.galili at gmail.com (Tal Galili) Date: Fri, 2 Dec 2011 18:40:49 +0200 Subject: [R] CART with rpart In-Reply-To: <1322842524.46799.YahooMailNeo@web25401.mail.ukl.yahoo.com> References: <1322842524.46799.YahooMailNeo@web25401.mail.ukl.yahoo.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tal.galili at gmail.com Fri Dec 2 17:42:43 2011 From: tal.galili at gmail.com (Tal Galili) Date: Fri, 2 Dec 2011 18:42:43 +0200 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From karajamu at hotmail.com Fri Dec 2 17:43:35 2011 From: karajamu at hotmail.com (karajamu) Date: Fri, 2 Dec 2011 17:43:35 +0100 Subject: [R] Willkommen bei der "R-help" Mailingliste In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mjekel at uni-bonn.de Fri Dec 2 16:17:49 2011 From: mjekel at uni-bonn.de (Marc Jekel) Date: Fri, 02 Dec 2011 16:17:49 +0100 Subject: [R] R + memory of objects Message-ID: <4ED8EC1D.1060806@uni-bonn.de> Dear R community, I am still struggling a bit on how R does memory allocation and how to optimize my code to minimize working memory load. Simon (thanks!) and others gave me a hint to use the command "gc()" to clean up memory which works quite nice but appears to me to be more like a "fix" to a problem. To give you an impression of what I am talking, here is a short code example + I will give rough measure (system track app) of my working memory needed for each computational step (R64bit latest version on WIN 7 64 bit system, 2 Cores, approx 4 GB Ram): ########################## # example 1: y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) # used working memory increases from 1044 --> 1808 MB # (same command again, i.e.) y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) # 1808 MB --> 2178 MB Why does memory increase? # (give the matrix column names) colnames(y) = c("col1", "col2") # 2178 MB --> 1781 MB Why does the size of an object decrease if I assign column labels? ### # example 2: y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) 1016 --> 1780 MB y = data.frame(y) # increase from 1780 MB --> 3315 MB ########################## Why does it take so much extra memory to store this matrix as a data.frame? It is not the object per se (i.e. that data.frames need more memory) because if I use gc() memory size drops to 1387 MB. Does this mean that it may be more memory-efficient not to use any data.frames but matrices only? etc. This puzzles me a lot. From my experience these effects are also accentuated for larger objects. As an anecdotal comparison: I also used Stata in my last project due to these memory problems and I could do a lot of variable manipulations of the same (!) data with significant (I am talking about GB) less memory needed. Best, Marc From robgriffin247 at hotmail.com Fri Dec 2 17:41:00 2011 From: robgriffin247 at hotmail.com (robgriffin247) Date: Fri, 2 Dec 2011 08:41:00 -0800 (PST) Subject: [R] Graphics - Axis Labels overlap window edges Message-ID: <1322844060868-4147897.post@n4.nabble.com> Hi, I am trying to put larger axis labels on my graphs (using cex.axis and cex.label) but when I do this the top of the text on the Y axis goes outside of the window which you can see in this picture -http://twitter.com/#!/robgriffin247/status/142642881436450816/photo/1 - (if you click on the picture it opens a larger version so it is easier to see the problem) is there anyway I can get R to not cut the top off the letters? Thanks, Rob -- View this message in context: http://r.789695.n4.nabble.com/Graphics-Axis-Labels-overlap-window-edges-tp4147897p4147897.html Sent from the R help mailing list archive at Nabble.com. From aurelien.philippot at gmail.com Fri Dec 2 18:01:36 2011 From: aurelien.philippot at gmail.com (=?ISO-8859-1?Q?Aur=E9lien_PHILIPPOT?=) Date: Fri, 2 Dec 2011 09:01:36 -0800 Subject: [R] Problem subsetting: undefined columns In-Reply-To: <4ED8A34D.1030800@knmi.nl> References: <4ED8A34D.1030800@knmi.nl> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Fri Dec 2 18:13:11 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Fri, 02 Dec 2011 18:13:11 +0100 Subject: [R] R + memory of objects In-Reply-To: <4ED8EC1D.1060806@uni-bonn.de> References: <4ED8EC1D.1060806@uni-bonn.de> Message-ID: <4ED90727.2060206@statistik.tu-dortmund.de> I guess the numbers your report are what your OS shows you? R runs garbage collection (which can be manually triggred by gc()) after certain fuzzy rules. So what you report below is not always the current required memory but what was allocated and not yet garbnage collected. See ?object.size to get the memory consumption of objects. Uwe Ligges On 02.12.2011 16:17, Marc Jekel wrote: > Dear R community, > > I am still struggling a bit on how R does memory allocation and how to > optimize my code to minimize working memory load. Simon (thanks!) and > others gave me a hint to use the command "gc()" to clean up memory which > works quite nice but appears to me to be more like a "fix" to a problem. > > To give you an impression of what I am talking, here is a short code > example + I will give rough measure (system track app) of my working > memory needed for each computational step (R64bit latest version on WIN > 7 64 bit system, 2 Cores, approx 4 GB Ram): > > ########################## > > # example 1: > > y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) > > # used working memory increases from 1044 --> 1808 MB > > # (same command again, i.e.) > > y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) > > # 1808 MB --> 2178 MB Why does memory increase? > > # (give the matrix column names) > > colnames(y) = c("col1", "col2") > > # 2178 MB --> 1781 MB Why does the size of an object decrease if I > assign column labels? > > ### > > # example 2: > > y= matrix(rep(1,50000000), nrow = 50000000/2 , ncol = 2) > > 1016 --> 1780 MB > > y = data.frame(y) > > # increase from 1780 MB --> 3315 MB > > ########################## > > Why does it take so much extra memory to store this matrix as a data.frame? > > It is not the object per se (i.e. that data.frames need more memory) > because if I use gc() memory size drops to 1387 MB. Does this mean that > it may be more memory-efficient not to use any data.frames but matrices > only? etc. > > This puzzles me a lot. From my experience these effects are also > accentuated for larger objects. > > As an anecdotal comparison: I also used Stata in my last project due to > these memory problems and I could do a lot of variable manipulations of > the same (!) data with significant (I am talking about GB) less memory > needed. > > Best, > > Marc > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Fri Dec 2 18:18:22 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Fri, 02 Dec 2011 18:18:22 +0100 Subject: [R] Graphics - Axis Labels overlap window edges In-Reply-To: <1322844060868-4147897.post@n4.nabble.com> References: <1322844060868-4147897.post@n4.nabble.com> Message-ID: <4ED9085E.2070504@statistik.tu-dortmund.de> On 02.12.2011 17:41, robgriffin247 wrote: > Hi, > > I am trying to put larger axis labels on my graphs (using cex.axis and > cex.label) but when I do this the top of the text on the Y axis goes outside > of the window which you can see in this picture > -http://twitter.com/#!/robgriffin247/status/142642881436450816/photo/1 - (if > you click on the picture it opens a larger version so it is easier to see > the problem) is there anyway I can get R to not cut the top off the letters? Increase the margins. See ?par and its "mar" argument. Uwe Ligges > Thanks, > Rob > > -- > View this message in context: http://r.789695.n4.nabble.com/Graphics-Axis-Labels-overlap-window-edges-tp4147897p4147897.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From axel.urbiz at gmail.com Fri Dec 2 18:21:21 2011 From: axel.urbiz at gmail.com (Axel Urbiz) Date: Fri, 2 Dec 2011 12:21:21 -0500 Subject: [R] Random Forests in R In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mailinglist.honeypot at gmail.com Fri Dec 2 18:22:47 2011 From: mailinglist.honeypot at gmail.com (Steve Lianoglou) Date: Fri, 2 Dec 2011 12:22:47 -0500 Subject: [R] Unexplained behavior of level names when using ordered factors in lm? In-Reply-To: References: Message-ID: Hi Bert, Since you opened the door ... On Fri, Dec 2, 2011 at 10:06 AM, Bert Gunter wrote: > ?ordered > ?C > ?contr.poly > > If you don't know what polynomial contrasts are, consult any good > linear models text. MASS has a good, though a bit terse, section on > this. Do you have a "favorite" liner model text with a bit more exposition than MASS? Even though this list isn't for teaching stats, whenever I can catch some of the tried and true statisticians talking about texts on specific subject matter, I like to take advantage of it to see what I need to add to my amazon wish list to help sharpen the old saw :-) Thanks, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact From michael.weylandt at gmail.com Fri Dec 2 18:30:05 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Fri, 2 Dec 2011 12:30:05 -0500 Subject: [R] Problem subsetting: undefined columns In-Reply-To: References: <4ED8A34D.1030800@knmi.nl> Message-ID: <33DACDEA-8EF7-4414-A81B-D869C0AB94FD@gmail.com> How about this? d[, v[v %in% colnames(d)]] Michael On Dec 2, 2011, at 12:01 PM, Aur?lien PHILIPPOT wrote: > Hi Paul and Jim, > Thanks for your messages. > > I just wanted R to give me the columns of my data frame d, whose names > appear in v. I do not care about the names of v that are not in d. In > addition, every time, there will be at least one element of v that has a > corresponding column in d, for sure, so I know there is at least one match > between the 2. > > Initially, I tried something in the spirit: > sub<- subset(d, colnames(d) %in% v) > > but I could not make it work properly. > > > Best, > Aurelien > > 2011/12/2 Paul Hiemstra > >> On 12/02/2011 07:20 AM, Aur?lien PHILIPPOT wrote: >>> Dear R-users, >>> -I am new to R, and I am struggling with the following problem. >>> >>> -I am repeating the following operations hundreds of times, within a >> loop: >>> I want to subset a data frame by columns. I am interested in the columns >>> names that are given by the rows of another data frame that was built in >>> parallel. The solution I have so far works well as long as the elements >> of >>> the second data frame are included in the column names of the first data >>> frame but if an element from the second object is not a column name of >> the >>> first one, then it bugs. >> >> Hi Aurelien, >> >> I would call this a feature, not a bug. I think R does what it should >> do, you request a non-existent column and it throws an error. What kind >> of behavior are you looking for instead of this error? >> >> regards, >> Paul >> >>> >>> -More concretely, I have the following data frames d and v: >>> yyyymmdd<-c("19720601", "19720602", "19720605") >>> sret.10006<-c(1,2,3) >>> sret.10014<-c(5,9,7) >>> sret.10065<-c(10,2,11) >>> >>> >>> d<- data.frame(yyyymmdd=yyyymmdd, sret.10006=sret.10006, >>> sret.10014=sret.10014, sret.10065=sret.10065) >>> >>> v<- data.frame(V1="sret.10006", V2="sret.10090") >>> v<- sapply(v, function(x) levels(x)[x]) >>> >>> -I want to do the following subsetting: >>> sub<- subset(d, select=c(v)) >>> >>> >>> and I get the following error message: >>> Error in `[.data.frame`(x, r, vars, drop = drop) : >>> undefined columns selected >>> >>> >>> >>> Any help would be very much appreciated, >>> >>> Best, >>> Aurelien >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> >> -- >> Paul Hiemstra, Ph.D. >> Global Climate Division >> Royal Netherlands Meteorological Institute (KNMI) >> Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39 >> P.O. Box 201 | 3730 AE | De Bilt >> tel: +31 30 2206 494 >> >> http://intamap.geo.uu.nl/~paul >> http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770 >> >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From sas0025 at auburn.edu Fri Dec 2 18:39:21 2011 From: sas0025 at auburn.edu (Stephen Sefick) Date: Fri, 02 Dec 2011 11:39:21 -0600 Subject: [R] Partitioning Around Mediods then rpart to follow - is this sensible Message-ID: <4ED90D49.8050803@auburn.edu> The problem: There are no a priori groupings to run a classification on My solution: This is a non-R code question, so I appreciate any thoughts. I have used pam in the cluster package proceeded by sillohouette to find the optimum number of clusters on scaled and centered data. I have followed this by a classification tree analysis with rpart to discern which variables drive the clustering on the original data. Is this a sensible approach? many thanks, Stephen Sefick From momadou at yahoo.fr Fri Dec 2 18:15:56 2011 From: momadou at yahoo.fr (Komine) Date: Fri, 2 Dec 2011 09:15:56 -0800 (PST) Subject: [R] Problem with loop Message-ID: <1322846156594-4148083.post@n4.nabble.com> Hi, I try to build a loop difficultly. I have in a folder called Matrices several files (.csv) called Mat2002273, Mat2002274 to Mat2002361. I want to calculate for each file the mean of the column called Pixelvalues. I try this code but as result, I have this message: Mat2002273 not found >essai<-read.table("C:\\Users\\Desktop\\Matrices\\Mat2002273.csv",sep=";",dec=",",header=TRUE) >essai >a <- NULL >for(i in Mat2002273:Mat2002361){ >paste(mean(essai$Pixelvalues)) >a[i] <- paste(mean(essai$Pixelvalues)) >print(a[i]) >} Thank you for your help -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-loop-tp4148083p4148083.html Sent from the R help mailing list archive at Nabble.com. From mkao006rmail at gmail.com Fri Dec 2 18:47:07 2011 From: mkao006rmail at gmail.com (Michael Kao) Date: Fri, 02 Dec 2011 18:47:07 +0100 Subject: [R] Intersection of 2 matrices In-Reply-To: <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> References: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> Message-ID: <4ED90F1B.8090706@gmail.com> On 2/12/2011 2:48 p.m., David Winsemius wrote: > > On Dec 2, 2011, at 4:20 AM, oluwole oyebamiji wrote: > >> Hi all, >> I have matrix A of 67420 by 2 and another matrix B of 59199 by 2. >> I would like to find the number of rows of matrix B that I can find >> in matrix A (rows that are common to both matrices with or without >> sorting). >> >> I have tried the "intersection" and "is.element" functions in R but >> it only working for the vectors and not matrix >> i.e, intersection(A,B) and is.element(A,B). > > Have you considered the 'duplicated' function? > Here is an example based on the duplicated function test.mat1 <- matrix(1:20, nc = 5) test.mat2 <- rbind(test.mat1[sample(1:5, 2), ], matrix(101:120, nc = 5)) compMat <- function(mat1, mat2){ nr1 <- nrow(mat1) nr2 <- nrow(mat2) mat2[duplicated(rbind(mat1, mat2))[(nr1 + 1):(nr1 + nr2)], ] } compMat(test.mat1, test.mat2) From michael.weylandt at gmail.com Fri Dec 2 18:55:31 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Fri, 2 Dec 2011 12:55:31 -0500 Subject: [R] Problem with loop In-Reply-To: <1322846156594-4148083.post@n4.nabble.com> References: <1322846156594-4148083.post@n4.nabble.com> Message-ID: You never create a variable called "Mat2002273" or "Mat2002361" so you can't ask R to loop over all the values between them. If I were you, I'd code something like this: lf <- list.files() # PUT IN SOME CODE TO REMOVE FILES YOU DON'T WANT TO USE pv <- vector("numeric", length(lf)) for(i in lf) pv[i] <- mean( read.csv(lf, header = TRUE)[,"Pixelvalues"]) print(pv) Michael On Fri, Dec 2, 2011 at 12:15 PM, Komine wrote: > Hi, > I try to build a loop difficultly. > I have in a folder called Matrices several files (.csv) called Mat2002273, > Mat2002274 ?to Mat2002361. > I want to calculate for each file the mean of the column called Pixelvalues. > I try this code but as result, I have this message: ?Mat2002273 not found > >>essai<-read.table("C:\\Users\\Desktop\\Matrices\\Mat2002273.csv",sep=";",dec=",",header=TRUE) >>essai >>a <- NULL >>for(i in Mat2002273:Mat2002361){ >>paste(mean(essai$Pixelvalues)) >>a[i] <- paste(mean(essai$Pixelvalues)) >>print(a[i]) >>} > > Thank you for your help > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Problem-with-loop-tp4148083p4148083.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From desviostandard at gmail.com Fri Dec 2 19:01:43 2011 From: desviostandard at gmail.com (=?ISO-8859-1?Q?Pablo_Dom=EDnguez_Vaselli?=) Date: Fri, 2 Dec 2011 15:01:43 -0300 Subject: [R] References for book "R In Action" by Kabacoff Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dschruth at u.washington.edu Fri Dec 2 18:46:27 2011 From: dschruth at u.washington.edu (David M. Schruth) Date: Fri, 02 Dec 2011 09:46:27 -0800 Subject: [R] help in dbWriteTable In-Reply-To: <1322801638400-4145110.post@n4.nabble.com> References: <1322801638400-4145110.post@n4.nabble.com> Message-ID: <4ED90EF3.4030109@u.washington.edu> Hi, The following code should work: fields <- dbListFields(con, db.table.name) reordered.names <- names(df)[match(fields, names(df))] df <- df[ ,reordered.names] But, you might want to try using the function 'dbWriteTable2' in the 'caroline' package. (In fact the three lines above have been copied verbatim out of said function). It works much like the original dbWriteTable but also addresses the column reordering frustration you mention and more: na's in NOT NULL columns, length mismatches, adding NA columns for missing fields, type checking as well as primary key support for PostgreSQL. I use it mainly with Postgres so I can't say for sure if it'll work for you. But let me know if it doesn't! -Dave Schruth On 12/1/2011 8:53 PM, arunkumar1111 wrote: > hi > > I need some help in dbWriteTable. > I'm not able to insert the rows in the table if the column order are not > same in the database and in the dataframe which i'm inserting. Also facing > issue if the table is already created externally and inserting it thru > dbWrite. > > is there some way that we can sepecify the rownames in the dbwrite..or any > method which will solve my problem > > > > -- > View this message in context: http://r.789695.n4.nabble.com/help-in-dbWriteTable-tp4145110p4145110.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From rpickeri at mail.nih.gov Fri Dec 2 19:25:32 2011 From: rpickeri at mail.nih.gov (RogerP) Date: Fri, 2 Dec 2011 10:25:32 -0800 (PST) Subject: [R] Compiling R using Solaris Studio Message-ID: <1322850332340-4148407.post@n4.nabble.com> I am trying to compile R using Solaris Studio, but it keeps trying to use the GNU compiler! I've tried editing all the Makeconf files I can find, but configure keeps changing them back! I tried to rename the GNU directory so it could not find gcc, but then I got a missing lib error. How does one change the compiler used to compile R? Thanks! Roger -- View this message in context: http://r.789695.n4.nabble.com/Compiling-R-using-Solaris-Studio-tp4148407p4148407.html Sent from the R help mailing list archive at Nabble.com. From michael.weylandt at gmail.com Fri Dec 2 19:42:35 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Fri, 2 Dec 2011 13:42:35 -0500 Subject: [R] Error in Genetic Matching In-Reply-To: <1322835372.39181.YahooMailNeo@web161706.mail.bf1.yahoo.com> References: <1322835372.39181.YahooMailNeo@web161706.mail.bf1.yahoo.com> Message-ID: The error message is pretty explicit: your problem is taht one of your inputs has NA (missing value) in it and the GenMatch() function is not prepared to handle the. You can find which one by running: any(is.na(Tr)) any(is.na(X.binarynp) any(is.na(BalanceMatrix.binarynp)) and then use View() on the object with NAs to take a look and see where they are coming from. Michael On Fri, Dec 2, 2011 at 9:16 AM, shyam basnet wrote: > Dear R Users, > > I am a novice learner of R software. I am working with Genetic Matching -?GenMatch(), but I am getting an Error message as follows: > > Error in GenMatch(Tr = Tr, X = X.binarynp, BalanceMatrix = BalanceMatrix.binarynp, ?: > ? GenMatch(): input includes NAs > > Could you please suggest me correcting the above problem? > > My GenMatch command is, > >> gen1 <- GenMatch(Tr = Tr, X = X.binarynp, BalanceMatrix = BalanceMatrix.binarynp, popsize = 1000) > > Thanking you, > > Sincerely Yours, > > Shyam Kumar Basnet > SLU,?Uppsala > Sweden > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From hadley at rice.edu Fri Dec 2 20:04:59 2011 From: hadley at rice.edu (Hadley Wickham) Date: Fri, 2 Dec 2011 13:04:59 -0600 Subject: [R] Project local libraries (reproducible research) Message-ID: Hi all, I was wondering if any one had scripts that they could share for capturing the current version of R packages used for a project. I'm interested in creating a project local library so that you're safe if someone (e.g. the ggplot2 author) updates a package you're relying on and breaks your code. I could fairly easily hack together, but I was wondering if any one had any neat scripts they'd care to share. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ From hwborchers at googlemail.com Fri Dec 2 20:22:31 2011 From: hwborchers at googlemail.com (Hans W Borchers) Date: Fri, 2 Dec 2011 19:22:31 +0000 Subject: [R] Intersection of 2 matrices References: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> <4ED90F1B.8090706@gmail.com> Message-ID: Michael Kao gmail.com> writes: > Your solution is fast, but not completely correct, because you are also counting possible duplicates within the second matrix. The 'refitted' function could look as follows: compMat2 <- function(A, B) { # rows of B present in A B0 <- B[!duplicated(B), ] na <- nrow(A); nb <- nrow(B0) AB <- rbind(A, B0) ab <- duplicated(AB)[(na+1):(na+nb)] return(sum(ab)) } and testing an example the size the OR was asking for: set.seed(8237) A <- matrix(sample(1:1000, 2*67420, replace=TRUE), 67420, 2) B <- matrix(sample(1:1000, 2*59199, replace=TRUE), 59199, 2) system.time(n <- compMat2(A, B)) # n = 3790 while compMat() will return 5522 rows, with 1732 duplicates within B ! A 3.06 GHz iMac needs about 2 -- 2.5 seconds. Hans Werner > On 2/12/2011 2:48 p.m., David Winsemius wrote: > > > > On Dec 2, 2011, at 4:20 AM, oluwole oyebamiji wrote: > > > >> Hi all, > >> I have matrix A of 67420 by 2 and another matrix B of 59199 by 2. > >> I would like to find the number of rows of matrix B that I can find > >> in matrix A (rows that are common to both matrices with or without > >> sorting). > >> > >> I have tried the "intersection" and "is.element" functions in R but > >> it only working for the vectors and not matrix > >> i.e, intersection(A,B) and is.element(A,B). > > > > Have you considered the 'duplicated' function? > > > > Here is an example based on the duplicated function > > test.mat1 <- matrix(1:20, nc = 5) > > test.mat2 <- rbind(test.mat1[sample(1:5, 2), ], matrix(101:120, nc = 5)) > > compMat <- function(mat1, mat2){ > nr1 <- nrow(mat1) > nr2 <- nrow(mat2) > mat2[duplicated(rbind(mat1, mat2))[(nr1 + 1):(nr1 + nr2)], ] > } > > compMat(test.mat1, test.mat2) > > From ihok at hotmail.com Fri Dec 2 20:28:33 2011 From: ihok at hotmail.com (Jack Tanner) Date: Fri, 2 Dec 2011 19:28:33 +0000 Subject: [R] RFE: vectorized behavior for as.POSIXct tz argument Message-ID: x <- 1472562988 + 1:10; tz <- rep("EST",10) # Case 1: Works as documented ct <- as.POSIXct(x, tz=tz[1], origin="1960-01-01") # Case 2: Fails ct <- as.POSIXct(x, tz=tz, origin="1960-01-01") If case 2 worked, it'd be a little easier to process paired (time, time zone) vectors from different time zones. From hwborchers at googlemail.com Fri Dec 2 20:46:11 2011 From: hwborchers at googlemail.com (Hans W Borchers) Date: Fri, 2 Dec 2011 19:46:11 +0000 Subject: [R] Intersection of 2 matrices References: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> <4ED90F1B.8090706@gmail.com> Message-ID: Michael Kao gmail.com> writes: > Well, taking a second look, I'd say it depends on the exact formulation. In the applications I have in mind, I would like to count each occurrence in B only once. Perhaps the OP never thought about duplicates in B Hans Werner > > Here is an example based on the duplicated function > > test.mat1 <- matrix(1:20, nc = 5) > > test.mat2 <- rbind(test.mat1[sample(1:5, 2), ], matrix(101:120, nc = 5)) > > compMat <- function(mat1, mat2){ > nr1 <- nrow(mat1) > nr2 <- nrow(mat2) > mat2[duplicated(rbind(mat1, mat2))[(nr1 + 1):(nr1 + nr2)], ] > } > > compMat(test.mat1, test.mat2) > From aurelien.philippot at gmail.com Fri Dec 2 19:28:35 2011 From: aurelien.philippot at gmail.com (=?ISO-8859-1?Q?Aur=E9lien_PHILIPPOT?=) Date: Fri, 2 Dec 2011 10:28:35 -0800 Subject: [R] Problem subsetting: undefined columns In-Reply-To: <33DACDEA-8EF7-4414-A81B-D869C0AB94FD@gmail.com> References: <4ED8A34D.1030800@knmi.nl> <33DACDEA-8EF7-4414-A81B-D869C0AB94FD@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jroll at lcog.org Fri Dec 2 20:03:51 2011 From: jroll at lcog.org (LCOG1) Date: Fri, 2 Dec 2011 11:03:51 -0800 (PST) Subject: [R] Summarizing elements of a list In-Reply-To: References: <1322777855869-4142479.post@n4.nabble.com> Message-ID: <506F591A54F21D4480EE337F77369C056B10085E@LCEXG03.lc100.net> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jroll at lcog.org Fri Dec 2 20:04:21 2011 From: jroll at lcog.org (LCOG1) Date: Fri, 2 Dec 2011 11:04:21 -0800 (PST) Subject: [R] Summarizing elements of a list In-Reply-To: References: <1322777855869-4142479.post@n4.nabble.com> Message-ID: <506F591A54F21D4480EE337F77369C056B10085F@LCEXG03.lc100.net> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Bauermartin at gmx.at Fri Dec 2 20:45:13 2011 From: Bauermartin at gmx.at (Martin Bauer) Date: Fri, 02 Dec 2011 20:45:13 +0100 Subject: [R] order function give back row name Message-ID: <20111202194513.13370@gmx.net> Hello, I have a matrix results with dimension 1x9 double matrix XLB XLE XLF XLI 1 53.3089 55.77923 37.64458 83.08646 I'm trying to order this matrix > print(order(results)) [1] 3 1 2 4 how can the function order return the columnname XLF XLB XLE XLI instead of 3 1 2 4 any idea ? Thank you in advance -- From jholtman at gmail.com Fri Dec 2 21:05:32 2011 From: jholtman at gmail.com (jim holtman) Date: Fri, 2 Dec 2011 15:05:32 -0500 Subject: [R] Intersection of 2 matrices In-Reply-To: References: <1322817653.56306.YahooMailNeo@web38408.mail.mud.yahoo.com> <63DA3A2C-BEA8-4E80-AD40-550BB915686F@comcast.net> <4ED90F1B.8090706@gmail.com> Message-ID: Here is one way of doing it: > compMat2 <- function(A, B) { # rows of B present in A + B0 <- B[!duplicated(B), ] + na <- nrow(A); nb <- nrow(B0) + AB <- rbind(A, B0) + ab <- duplicated(AB)[(na+1):(na+nb)] + return(sum(ab)) + } > > > set.seed(8237) > A <- matrix(sample(1:1000, 2*67420, replace=TRUE), 67420, 2) > B <- matrix(sample(1:1000, 2*59199, replace=TRUE), 59199, 2) > > system.time({ + # convert for comparison + A.1 <- apply(A, 1, function(x) paste(x, collapse = ' ')) + B.1 <- apply(B, 1, function(x) paste(x, collapse = ' ')) + count <- sum(B.1 %in% A.1) + }) user system elapsed 1.77 0.00 1.79 > > > count [1] 3905 > On Fri, Dec 2, 2011 at 2:46 PM, Hans W Borchers wrote: > Michael Kao gmail.com> writes: > >> > Well, taking a second look, I'd say it depends on the exact formulation. > > In the applications I have in mind, I would like to count each occurrence > in B only once. Perhaps the OP never thought about duplicates in B > > Hans Werner > >> >> Here is an example based on the duplicated function >> >> test.mat1 <- matrix(1:20, nc = 5) >> >> test.mat2 <- rbind(test.mat1[sample(1:5, 2), ], matrix(101:120, nc = 5)) >> >> compMat <- function(mat1, mat2){ >> ? ? ?nr1 <- nrow(mat1) >> ? ? ?nr2 <- nrow(mat2) >> ? ? ?mat2[duplicated(rbind(mat1, mat2))[(nr1 + 1):(nr1 + nr2)], ] >> } >> >> compMat(test.mat1, test.mat2) >> > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From michael.weylandt at gmail.com Fri Dec 2 21:09:54 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Fri, 2 Dec 2011 15:09:54 -0500 Subject: [R] order function give back row name In-Reply-To: <20111202194513.13370@gmx.net> References: <20111202194513.13370@gmx.net> Message-ID: names(results)[order(results)] Michael On Fri, Dec 2, 2011 at 2:45 PM, Martin Bauer wrote: > Hello, > > > I have a matrix results with dimension 1x9 double matrix > > ? ? ? ? XLB ? ? ? XLE ? ? ? ? ? ? XLF ? ? ? ? XLI > 1 ? ? ? 53.3089 ?55.77923 ? ? ? 37.64458 ? ? 83.08646 > > I'm trying to order this matrix > >> print(order(results)) > [1] 3 1 2 4 > > how can the function order return the columnname XLF ? XLB ? XLE ?XLI ?instead of 3 1 2 4 > > any idea ? > > Thank you in advance > -- > > ______________________________________________ > R-help at 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 code. From sarah.goslee at gmail.com Fri Dec 2 21:12:00 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Fri, 2 Dec 2011 15:12:00 -0500 Subject: [R] order function give back row name In-Reply-To: <20111202194513.13370@gmx.net> References: <20111202194513.13370@gmx.net> Message-ID: With similar data, since you didn't include reproducible example of your own: > results <- matrix(c(53, 55, 37, 83), nrow=1) > colnames(results) <- letters[1:4] > results a b c d [1,] 53 55 37 83 > order(results) [1] 3 1 2 4 > colnames(results)[order(results)] [1] "c" "a" "b" "d" On Fri, Dec 2, 2011 at 2:45 PM, Martin Bauer wrote: > Hello, > > > I have a matrix results with dimension 1x9 double matrix > > ? ? ? ? XLB ? ? ? XLE ? ? ? ? ? ? XLF ? ? ? ? XLI > 1 ? ? ? 53.3089 ?55.77923 ? ? ? 37.64458 ? ? 83.08646 > > I'm trying to order this matrix > >> print(order(results)) > [1] 3 1 2 4 > > how can the function order return the columnname XLF ? XLB ? XLE ?XLI ?instead of 3 1 2 4 > > any idea ? > > Thank you in advance > -- > -- Sarah Goslee http://www.functionaldiversity.org From michael.weylandt at gmail.com Fri Dec 2 21:19:56 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Fri, 2 Dec 2011 15:19:56 -0500 Subject: [R] Summarizing elements of a list In-Reply-To: <506F591A54F21D4480EE337F77369C056B10085F@LCEXG03.lc100.net> References: <1322777855869-4142479.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B10085F@LCEXG03.lc100.net> Message-ID: Here's a slight modification that is even faster if speed is a consideration: sapply(Version1_, `[[`, "First") The thought process is to go through the list "Version1_" and apply the operation `[[` to each element individually. This requires a second operator (here the element name "First") which we pass through the "..." of sapply() -- I hope that helps you get a sense of the mechanics. We use sapply() instead of lapply() because it does some internal simplification for us to get one big vector back, effectively cutting out the "unlist" of the first solution I gave you. Michael On Fri, Dec 2, 2011 at 2:04 PM, LCOG1 wrote: > Great, this worked the fastest of all the suggestions. ?Cheers, > > Josh > > ________________________________ > From: Michael Weylandt [via R] [mailto:ml-node+s789695n4144941h1 at n4.nabble.com] > Sent: Thursday, December 01, 2011 8:11 PM > To: ROLL Josh F > Subject: Re: Summarizing elements of a list > > Similarly, this might work: > > unlist(lapply(Version1_, `[`,"First")) > > Michael > > On Thu, Dec 1, 2011 at 9:41 PM, Sarah Goslee <[hidden email]> wrote: > >> How about: >> >> lapply(Version1_, subset, subset=c(TRUE, FALSE)) >> or sapply() depending on what you want the result to look like. >> >> Thanks for the reproducible example. >> >> Sarah >> >> On Thu, Dec 1, 2011 at 5:17 PM, LCOG1 <[hidden email]> wrote: >>> Hi everyone, >>> ? I looked around the list for a while but couldn't find a solution to my >>> problem. ?I am storing some results to a simulation in a list and for each >>> element i have two separate vectors(is that what they are called, correct my >>> vocab if necessary). See below >>> >>> Version1_<-list() >>> for(i in 1:5){ >>> ? ? ? ?Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1)) >>> } >>> >>> What I want is to put all of the elements' 'First' vectors into a single >>> list to box plot. But whats a more elegant solution to the below? >>> >>> c(Version1_[[1]]$First,Version1_[[2]]$First,Version1_[[3]]$First,Version1_[[4]]$First,Version1_[[5]]$First) >>> >>> since i have 50 or more simulations this is impractical and sloppy. ?Do I >>> need to store my data differently or is their a solution on the back end? >>> Thanks all. >>> >>> Josh >>> >> -- >> Sarah Goslee >> http://www.functionaldiversity.org >> >> ______________________________________________ >> [hidden email] 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 code. > > ______________________________________________ > [hidden email] 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 code. > > > ________________________________ > If you reply to this email, your message will be added to the discussion below: > http://r.789695.n4.nabble.com/Summarizing-elements-of-a-list-tp4142479p4144941.html > To unsubscribe from Summarizing elements of a list, click here. > NAML > > > -- > View this message in context: http://r.789695.n4.nabble.com/Summarizing-elements-of-a-list-tp4142479p4148571.html > Sent from the R help mailing list archive at Nabble.com. > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From dwinsemius at comcast.net Fri Dec 2 21:54:44 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 15:54:44 -0500 Subject: [R] RFE: vectorized behavior for as.POSIXct tz argument In-Reply-To: References: Message-ID: <1A760C01-FF69-42DC-8DF2-474E6B771572@comcast.net> On Dec 2, 2011, at 2:28 PM, Jack Tanner wrote: > x <- 1472562988 + 1:10; tz <- rep("EST",10) > > # Case 1: Works as documented > ct <- as.POSIXct(x, tz=tz[1], origin="1960-01-01") > > # Case 2: Fails > ct <- as.POSIXct(x, tz=tz, origin="1960-01-01") sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt, origin="1960-01-01"),simplify=FALSE) > > If case 2 worked, it'd be a little easier to process paired (time, > time zone) > vectors from different time zones. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From santosh2005 at gmail.com Fri Dec 2 22:03:37 2011 From: santosh2005 at gmail.com (Santosh) Date: Fri, 2 Dec 2011 13:03:37 -0800 Subject: [R] Plot and polygon in log scale Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ihok at hotmail.com Fri Dec 2 22:06:38 2011 From: ihok at hotmail.com (Jack Tanner) Date: Fri, 2 Dec 2011 21:06:38 +0000 Subject: [R] RFE: vectorized behavior for as.POSIXct tz argument References: <1A760C01-FF69-42DC-8DF2-474E6B771572@comcast.net> Message-ID: David Winsemius comcast.net> writes: > sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt, > origin="1960-01-01"),simplify=FALSE) Sure, there's no end of workarounds. It would just be consistent to treat both the x and the tz arguments as vectors. From dwinsemius at comcast.net Fri Dec 2 22:47:49 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 16:47:49 -0500 Subject: [R] RFE: vectorized behavior for as.POSIXct tz argument In-Reply-To: References: <1A760C01-FF69-42DC-8DF2-474E6B771572@comcast.net> Message-ID: <6CA5D915-90A9-40D6-8DA1-8EE87E16B935@comcast.net> On Dec 2, 2011, at 4:06 PM, Jack Tanner wrote: > David Winsemius comcast.net> writes: > >> sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt, >> origin="1960-01-01"),simplify=FALSE) > > Sure, there's no end of workarounds. It would just be consistent to > treat both > the x and the tz arguments as vectors. I've wondered abut that too. The function where I would like to see a dual vectorized application is 'rep'. In cases where the x argument is the same length as the 'times' or 'each' arguments I would like to see it produce a vector that is sum(each) or tume(times) long. The problem is most likely in the ambiguity of how to apply the arguments: > unlist(sapply(1:5, function(tt) rep(1:5, each=tt))) [1] 1 2 3 4 5 1 1 2 2 3 3 4 4 5 5 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 1 1 1 1 2 2 2 2 3 [40] 3 3 3 4 4 4 4 5 5 5 5 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 > mapply("rep", x=1:5, each=1:5) [[1]] [1] 1 [[2]] [1] 2 2 [[3]] [1] 3 3 3 [[4]] [1] 4 4 4 4 [[5]] [1] 5 5 5 5 5 > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From mark.heckmann at gmx.de Fri Dec 2 23:08:04 2011 From: mark.heckmann at gmx.de (Mark Heckmann) Date: Fri, 2 Dec 2011 23:08:04 +0100 Subject: [R] Sweave problem on Mac OS when using umlauts and summary() Message-ID: <94D1C064-31EA-41EA-981A-81DA7E650BCF@gmx.de> Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: From jabezwuk at yahoo.co.uk Fri Dec 2 23:17:56 2011 From: jabezwuk at yahoo.co.uk (Jabez Wilson) Date: Fri, 2 Dec 2011 22:17:56 +0000 Subject: [R] Fw: calculate mean of multiple rows in a data frame In-Reply-To: Message-ID: <1322864276.97726.YahooMailClassic@web28515.mail.ukl.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From khlam at ucsc.edu Fri Dec 2 23:16:24 2011 From: khlam at ucsc.edu (khlam) Date: Fri, 2 Dec 2011 14:16:24 -0800 (PST) Subject: [R] Imputing data Message-ID: <1322864184144-4150041.post@n4.nabble.com> So I have a very big matrix of about 900 by 400 and there are a couple of NA in the list. I have used the following functions to impute the missing data data(pc) pc.na<-pc pc.roughfix <- na.roughfix(pc.na) pc.narf <- randomForest(pc.na, na.action=na.roughfix) yet it does not replace the NA in the list. Presently I want to replace the NA with maybe the mean of the rows or columns or some type of correlation. Any help would be appreciated. -- View this message in context: http://r.789695.n4.nabble.com/Imputing-data-tp4150041p4150041.html Sent from the R help mailing list archive at Nabble.com. From mcooganj at gmail.com Fri Dec 2 23:50:27 2011 From: mcooganj at gmail.com (Matthew Johnson) Date: Sat, 3 Dec 2011 09:50:27 +1100 Subject: [R] Writing data including NAs to access using RODBC Message-ID: <-2627912397493008455@unknownmsgid> Hi, I have run into a problem writing data using RODBC. The dataframe i have read in from access includes some NAs. I have put the data into an xts object, manipulated the data, and would now like to append two columns of the manipulated data to the original table in access. I cannot append the data, nor write a new table. After some fiddling about i think that it is that the vectors i wish to append to the original dataframe /write include some NAs. Is there a work around? Thanks Matt Johnson From xie at yihui.name Fri Dec 2 23:55:32 2011 From: xie at yihui.name (Yihui Xie) Date: Fri, 2 Dec 2011 16:55:32 -0600 Subject: [R] Sweave problem on Mac OS when using umlauts and summary() In-Reply-To: <94D1C064-31EA-41EA-981A-81DA7E650BCF@gmx.de> References: <94D1C064-31EA-41EA-981A-81DA7E650BCF@gmx.de> Message-ID: This problem comes up so frequently that I have made options(useFancyQuotes=FALSE) by default in my knitr package: http://yihui.github.com/knitr/ You can also use options(useFancyQuotes='TeX'). Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Fri, Dec 2, 2011 at 4:08 PM, Mark Heckmann wrote: > I have the following Sweave file which gets sweaved correctly. > > <<>>= > m <- lm(y1 ~x1, anscombe) > summary(m) > @ > > I include the sweaved .tex file into another .tex file via include. > When I use a single umlaut in the .snw file a warning occurs. > As a result part of the summary output is not contained in the .tex file. > > ? > <<>>= > m <- lm(y1 ~x1, anscombe) > summary(m) > @ > > You can now run (pdf)latex on 'ch1.tex' > Warnmeldungen: > 1: ?ch1.Snw? has unknown encoding: assuming Latin-1 > 2: ung?ltige Zeichenkette in Konvertierung der Ausgabe (wrong character in conversion of output) > > Interestingly, this error does NOT occur, when I omit the summary(m) statement. > > ? > <<>>= > m <- lm(y1 ~x1, anscombe) > #summary(m) > @ > > You can now run (pdf)latex on 'ch1.tex' > Warnmeldung: > ?ch1.Snw? has unknown encoding: assuming Latin-1 > > I know that I can prevent this by adding a line at the beginning of the .snw file: > > \usepackage[utf8]{inputenc} > > ? > <<>>= > m <- lm(y1 ~x1, anscombe) > summary(m) > @ > > This gets sweaved correctly without warnings: > > But this solution is not good as it is not the preamble of the .tex document where I add the usepackage line. > This will cause an error when processing the entire document with tex. > > How can I achieve the last result in another way? > I tried: > > Sweave('/Users/markheckmann/Desktop/test_sweave/ch1.Snw', encoding="UFT-8") > > But this does not work either when the usepackage line is omitted. > > I am stuck here. Can anyone help? > > TIA > Mark > > > ???????????????????????????????????? > Mark Heckmann > Blog: www.markheckmann.de > R-Blog: http://ryouready.wordpress.com > > > > > > > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From peter.langfelder at gmail.com Sat Dec 3 00:00:03 2011 From: peter.langfelder at gmail.com (Peter Langfelder) Date: Fri, 2 Dec 2011 15:00:03 -0800 Subject: [R] Imputing data In-Reply-To: <1322864184144-4150041.post@n4.nabble.com> References: <1322864184144-4150041.post@n4.nabble.com> Message-ID: On Fri, Dec 2, 2011 at 2:16 PM, khlam wrote: > So I have a very big matrix of about 900 by 400 and there are a couple of NA > in the list. I have used the following functions to impute the missing data > > data(pc) > pc.na<-pc > pc.roughfix <- na.roughfix(pc.na) > pc.narf <- randomForest(pc.na, na.action=na.roughfix) > > > yet it does not replace the NA in the list. ?Presently I want to replace the > NA with maybe the mean of the rows or columns or some type of correlation. > > Any help would be appreciated. There are several imputation functions available in the various packages - for example, packages Hmisc and e1071 both contain a function called impute, and the package impute contains the function impute.knn for nearest neighbor imputation. HTH, Peter From mail at joeconway.com Sat Dec 3 00:43:45 2011 From: mail at joeconway.com (Joe Conway) Date: Sat, 03 Dec 2011 07:43:45 +0800 Subject: [R] R, PostgresSQL and poor performance In-Reply-To: References: Message-ID: <4ED962B1.1080703@joeconway.com> On 12/02/2011 09:46 PM, Berry, David I. wrote: > Thanks for the reply and suggestions. I've tried the RpgSQL drivers and > the results are pretty similar in terms of performance. > > The ~1.5M records I'm trying to read into R are being extracted from a > table with ~300M rows (and ~60 columns) that has been indexed on the > relevant columns and horizontally partitioned (with constraint checking > on). I do need to try and optimize the database a bit more but I don?t > think this is the cause of the performance issues. With that much data you might want to consider PL/R: http://www.joeconway.com/plr/ HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support From anopheles123 at gmail.com Sat Dec 3 01:08:58 2011 From: anopheles123 at gmail.com (Weidong Gu) Date: Fri, 2 Dec 2011 19:08:58 -0500 Subject: [R] Imputing data In-Reply-To: References: <1322864184144-4150041.post@n4.nabble.com> Message-ID: Hi, For imputation using randomForest package, check ?rfImpute Weidong On Fri, Dec 2, 2011 at 6:00 PM, Peter Langfelder wrote: > On Fri, Dec 2, 2011 at 2:16 PM, khlam wrote: >> So I have a very big matrix of about 900 by 400 and there are a couple of NA >> in the list. I have used the following functions to impute the missing data >> >> data(pc) >> pc.na<-pc >> pc.roughfix <- na.roughfix(pc.na) >> pc.narf <- randomForest(pc.na, na.action=na.roughfix) >> >> >> yet it does not replace the NA in the list. ?Presently I want to replace the >> NA with maybe the mean of the rows or columns or some type of correlation. >> >> Any help would be appreciated. > > There are several imputation functions available in the various > packages - for example, packages Hmisc and e1071 both contain a > function called impute, and the package impute contains the function > impute.knn for nearest neighbor imputation. > > HTH, > > Peter > > ______________________________________________ > R-help at 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 code. From ehlers at ucalgary.ca Sat Dec 3 02:29:28 2011 From: ehlers at ucalgary.ca (Peter Ehlers) Date: Fri, 02 Dec 2011 17:29:28 -0800 Subject: [R] Plot and polygon in log scale In-Reply-To: References: Message-ID: <4ED97B78.6000308@ucalgary.ca> On 2011-12-02 13:03, Santosh wrote: > Dear Experts, > > When using "plot" and "polygon", I can change the density and angle of the > shaded area lines when plotting is done in regular scale. It does not seem > to work in 'log' scale. Any suggestions would be highly appreciated! > > below is an example: > > plot(1:10,c(1:10)^2*20,log="y") > polygon(c(3:7,7:3),c((3:7)^2*20,c(7:3)^2*10),col='grey',angle=45,dens=30) > > Warning message: > In polygon.fullhatch(xy$x[start:(end - 1)], xy$y[start:(end - 1)], : > cannot hatch with logarithmic scale active > > Regards, > Santosh It looks like density is not implemented for log scales. (There is a comment in the source file.) Perhaps a note in the help file might be useful, but I would think that nowadays most users would want colour or shades of gray anyway. Of course, you can always do the logging on the data before plotting. You'll just have to use the axis() function to print appropriate axis labels. Peter Ehlers > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Sat Dec 3 02:38:38 2011 From: comtech.usa at gmail.com (Michael) Date: Fri, 2 Dec 2011 19:38:38 -0600 Subject: [R] Help! Big problem when using "browser()" to do R debugging? Message-ID: Hi all, Could you please help me? I am having the following weird problem when debugging R programs using "browser()": In my function, I've inserted a "browser()" in front of Step 1. My function has 3 steps and at the end of each step, it will print out the message "Step i is done"... However, after I hit when the program stopped before Step 1 and entered into the debugging mode, it not only executed the next line(i.e. the Step 1), but also all the (many) remaining lines in that function, as shown below: Browse[1]> [1] "Step 1 is done.." [1] "Step 2 is done.." [1] "Step 3 is done.." Then it automatically quited the debugging mode and when I tried to check the value of "myobj", I've got the following error message: > names(myobj) Error: object 'myobj' not found No suitable frames for recover() ---------------------------------------------------- So my question is: why did one key stroke lead it to execute all the remaining lines in that function and then "returned" from the function and quited the debugging mode? Thanks a lot! From murdoch.duncan at gmail.com Sat Dec 3 02:43:59 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Fri, 2 Dec 2011 20:43:59 -0500 Subject: [R] Help! Big problem when using "browser()" to do R debugging? In-Reply-To: References: Message-ID: <4ED97EDF.2000700@gmail.com> On 11-12-02 8:38 PM, Michael wrote: > Hi all, > > Could you please help me? > > I am having the following weird problem when debugging R programs > using "browser()": > > In my function, I've inserted a "browser()" in front of Step 1. My > function has 3 steps and at the end of each step, it will print out > the message "Step i is done"... > > However, after I hit when the program stopped before Step 1 > and entered into the debugging mode, it not only executed the next > line(i.e. the Step 1), but also all the (many) remaining lines in that > function, as shown below: > > > Browse[1]> > [1] "Step 1 is done.." > [1] "Step 2 is done.." > [1] "Step 3 is done.." > > Then it automatically quited the debugging mode and when I tried to > check the value of "myobj", I've got the following error message: > >> names(myobj) > Error: object 'myobj' not found > No suitable frames for recover() > > ---------------------------------------------------- > > So my question is: why did one key stroke lead it to execute > all the remaining lines in that function and then "returned" from the > function and quited the debugging mode? See ?browser. Duncan Murdoch From davideps at umich.edu Sat Dec 3 03:39:47 2011 From: davideps at umich.edu (David Epstein) Date: Sat, 03 Dec 2011 04:39:47 +0200 Subject: [R] side-by-side map with different geographies using spplot Message-ID: <4ED98BF3.6060509@umich.edu> Hello, I want to create side-by-side maps of similar attribute data in two different cities using a single legend. To simply display side-by-side census block group boundary (non-thematic) maps for Minneapolis & Cleveland I do the following: library(rgdal) library(sp) Minneapolis=readOGR("../Minneapolis/Census/2010/Census_BlockGroup_GEO/","tl_2010_27053_bg10") Cleveland=readOGR("../Cleveland/Census/2010/Census_BlockGroup_GEO/","tl_2010_39035_bg10") par(mfrow=c(1,2)) plot(Minneapolis) plot(Cleveland) I can display a single thematic map for a city using spplot as follows: spplot(Minneapolis,"Thematic_Data_Column") But, calling the function again for Cleveland just overwrites the window. I am unsure how to use spplot's layout tools with two different geographies. Most examples use a single geography and multiple attribute columns. Alternatively, is there a way to use "par" together with spplot to allow for multiple spplot calls? thank you, -david From worikr at gmail.com Sat Dec 3 05:03:08 2011 From: worikr at gmail.com (Worik R) Date: Sat, 3 Dec 2011 17:03:08 +1300 Subject: [R] simple lm question In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Sat Dec 3 05:10:18 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Fri, 2 Dec 2011 23:10:18 -0500 Subject: [R] simple lm question In-Reply-To: References: Message-ID: In your code by supplying a vector M[,"e"] you are regressing "e" against all the variables provided in the data argument, including "e" itself -- this gives the very strange regression coefficients you observe. R has no way to know that that's somehow related to the "e" it sees in the data argument. In the suggested way, lm(formula = e ~ ., data = as.data.frame(M)) e is regressed against everything that is not e and sensible results are given. Michael On Fri, Dec 2, 2011 at 11:03 PM, Worik R wrote: >> >> Use `lm` the way it is designed to be used, with a data argument: >> >> > l2 <- lm(e~. , data=as.data.frame(M)) >> > summary(l2) >> >> Call: >> lm(formula = e ~ ., data = as.data.frame(M)) >> >> > And what is the regression being done in this case? ?How are the > independent ?variables used? > > It looks like M[,5]~M[,1]+M[,2]+M[,3]+M[,4] as those are the > coefficients. ? But the results are different when I do that explicitly: > >> M <- matrix(runif(5*20), nrow=20) >> colnames(M) <- c('a', 'b', 'c', 'd', 'e') >> l1 <- lm(df[,'e']~., data=df) >> summary(l1) > > Call: > lm(formula = df[, "e"] ~ ., data = df) > > Residuals: > ? ? ? Min ? ? ? ? 1Q ? ? Median ? ? ? ? 3Q ? ? ? ?Max > -9.580e-17 -3.360e-17 -8.596e-18 ?9.114e-18 ?2.032e-16 > > Coefficients: > ? ? ? ? ? ? ?Estimate Std. Error ? ?t value Pr(>|t|) > (Intercept) -7.505e-17 ?7.158e-17 -1.048e+00 ? ?0.312 > a ? ? ? ? ? -1.653e-17 ?7.117e-17 -2.320e-01 ? ?0.820 > b ? ? ? ? ? -5.042e-17 ?5.480e-17 -9.200e-01 ? ?0.373 > c ? ? ? ? ? ?4.236e-17 ?5.774e-17 ?7.340e-01 ? ?0.475 > d ? ? ? ? ? -3.878e-17 ?4.946e-17 -7.840e-01 ? ?0.446 > e ? ? ? ? ? ?1.000e+00 ?6.083e-17 ?1.644e+16 ? <2e-16 *** > --- > Signif. codes: ?0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > > Residual standard error: 6.763e-17 on 14 degrees of freedom > Multiple R-squared: ? ? 1, ? ?Adjusted R-squared: ? ? 1 > F-statistic: 6.435e+31 on 5 and 14 DF, ?p-value: < 2.2e-16 > >> l3 <- lm(M[,5]~M[,1]+M[,2]+M[,3]+M[,4]) >> summary(l3) > > Call: > lm(formula = M[, 5] ~ M[, 1] + M[, 2] + M[, 3] + M[, 4]) > > Residuals: > ? ? Min ? ? ? 1Q ? Median ? ? ? 3Q ? ? ?Max > -0.49398 -0.14203 ?0.01588 ?0.14157 ?0.31335 > > Coefficients: > ? ? ? ? ? ?Estimate Std. Error t value Pr(>|t|) > (Intercept) ? 0.6681 ? ? 0.1859 ? 3.594 ?0.00266 ** > M[, 1] ? ? ? -0.1767 ? ? 0.2419 ?-0.730 ?0.47644 > M[, 2] ? ? ? -0.3874 ? ? 0.2135 ?-1.814 ?0.08970 . > M[, 3] ? ? ? ?0.3695 ? ? 0.2180 ? 1.695 ?0.11078 > M[, 4] ? ? ? ?0.1361 ? ? 0.2366 ? 0.575 ?0.57360 > --- > Signif. codes: ?0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > > Residual standard error: 0.2449 on 15 degrees of freedom > Multiple R-squared: 0.2988, ? ?Adjusted R-squared: 0.1119 > F-statistic: 1.598 on 4 and 15 DF, ?p-value: 0.2261 > > > cheers > Worik > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From worikr at gmail.com Sat Dec 3 05:20:28 2011 From: worikr at gmail.com (Worik R) Date: Sat, 3 Dec 2011 17:20:28 +1300 Subject: [R] simple lm question In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Sat Dec 3 05:41:01 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Fri, 2 Dec 2011 23:41:01 -0500 Subject: [R] simple lm question In-Reply-To: References: Message-ID: <6D2E99CF-7BAB-4084-BAC6-662DF0BC27B9@comcast.net> On Dec 2, 2011, at 11:20 PM, Worik R wrote: > Duh! Silly me! But my confusion persits: What is the regression > being > done? See below.... Please note that your "df" and "M" are undoubtedly different objects by now: > M <- matrix(runif(5*20), nrow=20) > colnames(M) <- c('a', 'b', 'c', 'd', 'e') > l1 <- lm(e~., data=as.data.frame(M)) > l1 Call: lm(formula = e ~ ., data = as.data.frame(M)) Coefficients: (Intercept) a b c d 0.40139 -0.15032 -0.06242 0.13139 0.23905 > l3 <- lm(M[,5]~M[,1]+M[,2]+M[,3]+M[,4]) > l3 Call: lm(formula = M[, 5] ~ M[, 1] + M[, 2] + M[, 3] + M[, 4]) Coefficients: (Intercept) M[, 1] M[, 2] M[, 3] M[, 4] 0.40139 -0.15032 -0.06242 0.13139 0.23905 As expected. -- David. > > On Sat, Dec 3, 2011 at 5:10 PM, R. Michael Weylandt < > michael.weylandt at gmail.com> wrote: > >> In your code by supplying a vector M[,"e"] you are regressing "e" >> against all the variables provided in the data argument, including >> "e" >> itself -- this gives the very strange regression coefficients you >> observe. R has no way to know that that's somehow related to the "e" >> it sees in the data argument. >> > >> In the suggested way, >> >> lm(formula = e ~ ., data = as.data.frame(M)) >> >> e is regressed against everything that is not e and sensible >> results are >> given. >> > > But still 'l1 <- lm(e~., data=df)' is not the same as 'l3 <- > lm(M[,5]~M[,1]+M[,2]+M[,3]+M[,4])' > >> M <- matrix(runif(5*20), nrow=20) >> colnames(M) <- c('a', 'b', 'c', 'd', 'e') >> l1 <- lm(e~., data=df) >> summary(l1) > > Call: > lm(formula = e ~ ., data = df) > > Residuals: > Min 1Q Median 3Q Max > -0.38343 -0.21367 0.03067 0.13757 0.49080 > > Coefficients: > Estimate Std. Error t value Pr(>|t|) > (Intercept) 0.28521 0.29477 0.968 0.349 > a 0.09283 0.30112 0.308 0.762 > b 0.23921 0.22425 1.067 0.303 > c -0.16027 0.24154 -0.664 0.517 > d 0.24025 0.20054 1.198 0.250 > > Residual standard error: 0.2871 on 15 degrees of freedom > Multiple R-squared: 0.1602, Adjusted R-squared: -0.06375 > F-statistic: 0.7153 on 4 and 15 DF, p-value: 0.5943 > >> l3 <- lm(M[,5]~M[,1]+M[,2]+M[,3]+M[,4]) >> summary(l3) > > Call: > lm(formula = M[, 5] ~ M[, 1] + M[, 2] + M[, 3] + M[, 4]) > > Residuals: > Min 1Q Median 3Q Max > -0.36355 -0.22679 -0.01202 0.18462 0.37377 > > Coefficients: > Estimate Std. Error t value Pr(>|t|) > (Intercept) 0.76972 0.24501 3.142 0.00672 ** > M[, 1] -0.23830 0.24123 -0.988 0.33890 > M[, 2] -0.02046 0.21958 -0.093 0.92699 > M[, 3] -0.29518 0.22559 -1.308 0.21040 > M[, 4] -0.31545 0.24570 -1.284 0.21866 > --- > Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > > Residual standard error: 0.2668 on 15 degrees of freedom > Multiple R-squared: 0.2762, Adjusted R-squared: 0.08317 > F-statistic: 1.431 on 4 and 15 DF, p-value: 0.272 > >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From hcatbr at yahoo.co.in Sat Dec 3 05:47:36 2011 From: hcatbr at yahoo.co.in (HC) Date: Fri, 2 Dec 2011 20:47:36 -0800 (PST) Subject: [R] Downloading tab separated data from internet Message-ID: <1322887656326-4152318.post@n4.nabble.com> Hi all, I am trying to download some tab separated data from the internet. The data is not available directly at the URL that could be known apriori. There is an intermediate form where start and end dates have to be given to get to the required page. For example, I want to download data for a station 03015795. The form for this station is at: http://ida.water.usgs.gov/ida/available_records.cfm?sn=03015795 I could get the start date and end date from this form using: # # Specifying station and reading from the opening form stn<-"03015795" myurl<-paste("http://ida.water.usgs.gov/ida/available_records.cfm?sn=",stn,sep="") mypage1 = readLines(myurl) # Getting the start and end dates mypattern = '([^<]*)' datalines = grep(mypattern, mypage1[124], value=TRUE) getexpr = function(s,g)substring(s,g,g+attr(g,'match.length')-1) gg = gregexpr(mypattern, datalines) matches = mapply(getexpr,datalines,gg) result = gsub(mypattern,'\\1',matches) names(result)=NULL mydates<-result[1:2] I want to know how I can feed these start and end dates to the form and execute the button to go to the data page and then to download the data, either as displayed in the browser or by saving as a file. Any help on this is most appreciated. Thanks. HC -- View this message in context: http://r.789695.n4.nabble.com/Downloading-tab-separated-data-from-internet-tp4152318p4152318.html Sent from the R help mailing list archive at Nabble.com. From manoharan.arun at gmail.com Sat Dec 3 04:25:26 2011 From: manoharan.arun at gmail.com (stillerfan) Date: Fri, 2 Dec 2011 19:25:26 -0800 (PST) Subject: [R] Problem installing Rtools Message-ID: <1322882726581-4152013.post@n4.nabble.com> I'm a new user to R and recently installed R 2.14 for Windows 7 (64 bit). I have downloaded and ran Rtools 2.14 but do not see any new packages in the install packages section of R. I installed Rtools in a subdirectory to the /library/ directory. Does anyone have any idea what I could be doing wrong? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Problem-installing-Rtools-tp4152013p4152013.html Sent from the R help mailing list archive at Nabble.com. From holland.aggie at gmail.com Sat Dec 3 05:51:05 2011 From: holland.aggie at gmail.com (James Holland) Date: Fri, 2 Dec 2011 22:51:05 -0600 Subject: [R] Reading multiple text files and then combining into a dataframe In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From worikr at gmail.com Sat Dec 3 06:05:26 2011 From: worikr at gmail.com (Worik R) Date: Sat, 3 Dec 2011 18:05:26 +1300 Subject: [R] simple lm question In-Reply-To: <6D2E99CF-7BAB-4084-BAC6-662DF0BC27B9@comcast.net> References: <6D2E99CF-7BAB-4084-BAC6-662DF0BC27B9@comcast.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From akpbond007 at gmail.com Sat Dec 3 08:06:50 2011 From: akpbond007 at gmail.com (arunkumar1111) Date: Fri, 2 Dec 2011 23:06:50 -0800 (PST) Subject: [R] help in removal of fixed pattern Message-ID: <1322896010158-4152524.post@n4.nabble.com> Hi I have column name as given below If the variable is in log(X1 + 1) pattern it should be removed and i need only X1 Input log(x1 + 1) x2 log(X3 +1) Expected Output X1 X2 X3 Please help me -- View this message in context: http://r.789695.n4.nabble.com/help-in-removal-of-fixed-pattern-tp4152524p4152524.html Sent from the R help mailing list archive at Nabble.com. From nevil.amos at gmail.com Sat Dec 3 08:26:00 2011 From: nevil.amos at gmail.com (Nevil Amos) Date: Sat, 3 Dec 2011 18:26:00 +1100 Subject: [R] partial mantel tests in ecodist with intential NA values. Message-ID: <6371C695-933D-49CE-875B-7DA23CAE28DD@gmail.com> I would like to perform partial mantel tests on only within group values, with "between group" values assigned to NA. This is possible in package ncf partial.mantel.test, however this sues a different permutation to that used in ecodist.ecodist will not accept data with NA values, returning a "matrix is not square error. is it possible to perform this test in ecodist? many thanks Nevil Amos > library(ecodist) > library(ncf) > x<-sample(1:1000,20) > y<-sample(1:1000,20) > z<-sample(1:1000,20) > M1<-as.matrix( distance(x)) > M2 <-as.matrix( distance(y )) > M3<-as.matrix( distance(z )) > D1<-(lower(M1)) > D2<-(lower(M2)) > D3<-(lower(M3)) > mantel(D1 ~ D2+D3, nperm=1000) mantelr pval1 pval2 pval3 llim.2.5% ulim.97.5% 0.09014696 0.10300000 0.89800000 0.18400000 0.01857311 0.18468621 > partial.mantel.test(M1,M2,M3,quiet=T) $MantelR r12 r13 r23 r12.3 r13.2 0.08977575 0.02170997 -0.01561346 0.09014696 0.02320821 $p [1] 0.09590410 0.30769231 0.47552448 0.09490509 0.30169830 $call [1] "partial.mantel.test(M1 = M1, M2 = M2, M3 = M3, quiet = T)" attr(,"class") [1] "partial.Mantel" > M1[1:10,11:20]<-NA > M1[11:20,1:10]<-NA > D1<-(lower(M1)) > mantel(D1 ~ D2+D3, nperm=1000) Error in mantel(D1 ~ D2 + D3, nperm = 1000) : Matrix not square. > partial.mantel.test(M1,M2,M3,quiet=T) $MantelR r12 r13 r23 r12.3 r13.2 0.054906562 0.003446670 -0.015613460 0.054967403 0.004310979 $p [1] 0.2837163 0.4275724 0.4555445 0.2857143 0.4235764 $call [1] "partial.mantel.test(M1 = M1, M2 = M2, M3 = M3, quiet = T)" attr(,"class") [1] "partial.Mantel" Warning message: In partial.mantel.test(M1, M2, M3, quiet = T) : Missing values exist; Pairwise deletion will be used From ripley at stats.ox.ac.uk Sat Dec 3 09:09:05 2011 From: ripley at stats.ox.ac.uk (Prof Brian Ripley) Date: Sat, 03 Dec 2011 08:09:05 +0000 Subject: [R] Downloading tab separated data from internet In-Reply-To: <1322887656326-4152318.post@n4.nabble.com> References: <1322887656326-4152318.post@n4.nabble.com> Message-ID: <4ED9D921.3080300@stats.ox.ac.uk> AFAICS what you mean is 'how can I fill in an HTML form using R'. Answer: use package RCurl. Do study the posting guide: none of the 'at a minimum' information was given here. On 03/12/2011 04:47, HC wrote: > Hi all, > > I am trying to download some tab separated data from the internet. The data > is not available directly at the URL that could be known apriori. There is > an intermediate form where start and end dates have to be given to get to > the required page. > > For example, I want to download data for a station 03015795. The form for > this station is at: > > http://ida.water.usgs.gov/ida/available_records.cfm?sn=03015795 > > I could get the start date and end date from this form using: > > # > # Specifying station and reading from the opening form > stn<-"03015795" > myurl<-paste("http://ida.water.usgs.gov/ida/available_records.cfm?sn=",stn,sep="") > mypage1 = readLines(myurl) > > # Getting the start and end dates > mypattern = '([^<]*)' > datalines = grep(mypattern, mypage1[124], value=TRUE) > getexpr = function(s,g)substring(s,g,g+attr(g,'match.length')-1) > gg = gregexpr(mypattern, datalines) > matches = mapply(getexpr,datalines,gg) > result = gsub(mypattern,'\\1',matches) > names(result)=NULL > mydates<-result[1:2] > > I want to know how I can feed these start and end dates to the form and > execute the button to go to the data page and then to download the data, > either as displayed in the browser or by saving as a file. > > Any help on this is most appreciated. > > Thanks. > HC -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 From landronimirc at gmail.com Sat Dec 3 09:15:56 2011 From: landronimirc at gmail.com (Liviu Andronic) Date: Sat, 3 Dec 2011 09:15:56 +0100 Subject: [R] Help! Big problem when using "browser()" to do R debugging? In-Reply-To: References: Message-ID: On Sat, Dec 3, 2011 at 2:38 AM, Michael wrote: > Hi all, > > Could you please help me? > > I am having the following weird problem when debugging R programs > using "browser()": > > In my function, I've inserted a "browser()" in front of Step 1. My > function has 3 steps and at the end of each step, it will print out > the message "Step i is done"... > > However, after I hit when the program stopped before Step 1 > and entered into the debugging mode, it not only executed the next > line(i.e. the Step 1), but also all the (many) remaining lines in that > function, as shown below: > > > Browse[1]> > [1] "Step 1 is done.." > [1] "Step 2 is done.." > [1] "Step 3 is done.." > > Then it automatically quited the debugging mode and when I tried to > check the value of "myobj", I've got the following error message: > >> names(myobj) > Error: object 'myobj' not found > No suitable frames for recover() > > ---------------------------------------------------- > > So my question is: why did one key stroke lead it to execute > all the remaining lines in that function and then "returned" from the > function and quited the debugging mode? > As soon as you get into 'debug' mode, type 'n', hit , then you can simply hit to evaluate the fun step by step. To exit the step-by-step, type 'c' and hit enter: this will evaluate the rest of the function. Regards Liviu > Thanks a lot! > > ______________________________________________ > R-help at 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 code. -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail From murdoch.duncan at gmail.com Sat Dec 3 11:10:25 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Sat, 03 Dec 2011 05:10:25 -0500 Subject: [R] Problem installing Rtools In-Reply-To: <1322882726581-4152013.post@n4.nabble.com> References: <1322882726581-4152013.post@n4.nabble.com> Message-ID: <4ED9F591.5050109@gmail.com> On 11-12-02 10:25 PM, stillerfan wrote: > I'm a new user to R and recently installed R 2.14 for Windows 7 (64 bit). I > have downloaded and ran Rtools 2.14 but do not see any new packages in the > install packages section of R. I installed Rtools in a subdirectory to the > /library/ directory. Does anyone have any idea what I could be doing wrong? > Rtools doesn't contain R packages, it contains various compilers and tools that you could use to build R and R packages. So you should install it in its own directory. I usually use c:/Rtools. Duncan Murdoch From jim at bitwrit.com.au Sat Dec 3 12:16:32 2011 From: jim at bitwrit.com.au (Jim Lemon) Date: Sat, 03 Dec 2011 22:16:32 +1100 Subject: [R] Project local libraries (reproducible research) In-Reply-To: References: Message-ID: <4EDA0510.9080003@bitwrit.com.au> On 12/03/2011 06:04 AM, Hadley Wickham wrote: > Hi all, > > I was wondering if any one had scripts that they could share for > capturing the current version of R packages used for a project. I'm > interested in creating a project local library so that you're safe if > someone (e.g. the ggplot2 author) updates a package you're relying on > and breaks your code. I could fairly easily hack together, but I was > wondering if any one had any neat scripts they'd care to share. > Hi Hadley, This makes quite a few assumptions, but I would build a list of packages called in R scripts: # get all calls to library or require in a subdirectory of scripts packagestrings<-c(system("grep library *.R",intern=TRUE), system("grep require *.R",intern=TRUE)) # get the unique package names packagenames<-unique(sapply(strsplit(packagestrings,"[()]"),"[",2)) # get the information on all installed packages in the system installedpackages<-installed.packages() # get the indices of the packages used in the subdirectory whichpackages<-which(match(rownames(installedpackages),packagenames,0)>0) # get the version information for each used package installedpackages[whichpackages,"Built"] Jim From mentor_ at gmx.net Sat Dec 3 12:43:26 2011 From: mentor_ at gmx.net (syrvn) Date: Sat, 3 Dec 2011 03:43:26 -0800 (PST) Subject: [R] Data alignment Message-ID: <1322912606118-4153024.post@n4.nabble.com> Hello! I have a data.frame which looks like: Name - Value A - 400 A - 300 B - 200 B - 350 C - 500 C - 350 D - 450 D - 600 E - 700 E - 750 F - 630 F - 650 I want to add another column where all A,B should get an index 1, all C,D an index of 2 and all E,F an index of 3 so that the data.frame looks like: ID - Name - Value 1 - A - 400 1 - A - 300 1 - B - 200 1 - B - 350 2 - C - 500 2 - C - 350 2 - D - 450 2 - D - 600 3 - E - 700 3 - E - 750 3 - F - 630 3 - F - 650 My data.frame is quite big so I cannot add all values by hand. Cheers -- View this message in context: http://r.789695.n4.nabble.com/Data-alignment-tp4153024p4153024.html Sent from the R help mailing list archive at Nabble.com. From Roger.bivand at nhh.no Sat Dec 3 12:50:03 2011 From: Roger.bivand at nhh.no (Roger Bivand) Date: Sat, 3 Dec 2011 11:50:03 +0000 Subject: [R] side-by-side map with different geographies using spplot References: <4ED98BF3.6060509@umich.edu> Message-ID: David Epstein umich.edu> writes: > > Hello, > > I want to create side-by-side maps of similar attribute data in two > different cities using a single legend. > > To simply display side-by-side census block group boundary > (non-thematic) maps for Minneapolis & Cleveland I do the following: > .... > > I can display a single thematic map for a city using spplot as follows: > > spplot(Minneapolis,"Thematic_Data_Column") > The spplot function uses lattice graphics, so you may use the standard methods for the "trellis" objects that it returns. If you did something like: sp_out_Minneapolis <- spplot(Minneapolis, "your_var") print(sp_out_Minneapolis, split=c(1, 1, 2, 1), more=TRUE) sp_out_Cleveland <- spplot(Cleveland, "your_var") print(sp_out_,Cleveland split=c(2, 1, 2, 1), more=FALSE) you will get some of the way there. If in addition you would like only one legend using the same breaks and colours, you'll need to use appropriate arguments to spplot() in both calls to handle this. It may be worth considering posting queries of this kind on R-sig-geo, as response may be forthcoming more quickly there. Hope this helps, Roger > > thank you, > -david > > From sarah.goslee at gmail.com Sat Dec 3 13:01:59 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sat, 3 Dec 2011 07:01:59 -0500 Subject: [R] partial mantel tests in ecodist with intential NA values. In-Reply-To: <6371C695-933D-49CE-875B-7DA23CAE28DD@gmail.com> References: <6371C695-933D-49CE-875B-7DA23CAE28DD@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Sat Dec 3 13:06:39 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sat, 3 Dec 2011 07:06:39 -0500 Subject: [R] Data alignment In-Reply-To: <1322912606118-4153024.post@n4.nabble.com> References: <1322912606118-4153024.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Sat Dec 3 13:12:11 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sat, 3 Dec 2011 07:12:11 -0500 Subject: [R] help in removal of fixed pattern In-Reply-To: <1322896010158-4152524.post@n4.nabble.com> References: <1322896010158-4152524.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Sat Dec 3 13:15:34 2011 From: jholtman at gmail.com (jim holtman) Date: Sat, 3 Dec 2011 07:15:34 -0500 Subject: [R] Data alignment In-Reply-To: References: <1322912606118-4153024.post@n4.nabble.com> Message-ID: try this: > match(x$Name> x <- read.table(text = "Name - Value + A - 400 + A - 300 + B - 200 + B - 350 + C - 500 + C - 350 + D - 450 + D - 600 + E - 700 + E - 750 + F - 630 + F - 650", header = TRUE, as.is = TRUE) > map <- data.frame(key = c("A", "B", "C", "D", "E", "F") + , value = c( 1, 1, 2, 2, 3, 3) + , stringsAsFactors = FALSE + ) > x$ID <- map$value[match(x$Name, map$key)] > x Name X. Value ID 1 A - 400 1 2 A - 300 1 3 B - 200 1 4 B - 350 1 5 C - 500 2 6 C - 350 2 7 D - 450 2 8 D - 600 2 9 E - 700 3 10 E - 750 3 11 F - 630 3 12 F - 650 3 On Sat, Dec 3, 2011 at 7:06 AM, Sarah Goslee wrote: > I doubt your data frame looks like that, with all the -, but regardless you > can use ifelse() to construct your column. > > Sarah > > On Saturday, December 3, 2011, syrvn wrote: >> Hello! >> >> I have a data.frame which looks like: >> >> Name - Value >> A - 400 >> A - 300 >> B - 200 >> B - 350 >> C - 500 >> C - 350 >> D - 450 >> D - 600 >> E - 700 >> E - 750 >> F - 630 >> F - 650 >> >> I want to add another column where all A,B should get an index 1, all C,D > an >> index of 2 and all E,F an index of 3 so that the data.frame looks like: >> >> ID - Name - Value >> 1 - A - 400 >> 1 - A - 300 >> 1 - B - 200 >> 1 - B - 350 >> 2 - C - 500 >> 2 - C - 350 >> 2 - D - 450 >> 2 - D - 600 >> 3 - E - 700 >> 3 - E - 750 >> 3 - F - 630 >> 3 - F - 650 >> >> My data.frame is quite big so I cannot add all values by hand. >> >> >> Cheers >> >> >> >> >> -- >> View this message in context: > http://r.789695.n4.nabble.com/Data-alignment-tp4153024p4153024.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. >> > > -- > Sarah Goslee > http://www.stringpage.com > http://www.sarahgoslee.com > http://www.functionaldiversity.org > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From jholtman at gmail.com Sat Dec 3 13:22:42 2011 From: jholtman at gmail.com (jim holtman) Date: Sat, 3 Dec 2011 07:22:42 -0500 Subject: [R] Reading multiple text files and then combining into a dataframe In-Reply-To: References: Message-ID: Does this do it for you: > #Creating example data in similar format to data I have > sub <- rep(1,10) > trial <- seq(1,10,1) > size <- rep(3,10) > shortest <- rep(444,10) > startlab <- rep(444,10) > endlab <- rep(444,10) > startconf <- rep(444,10) > endconf <- rep(444,10) > steps <- sample(1:30,10) > time <- sample(1:300,10) > > #creating example of text file and saving into a shared director with other txt files > > subject1 <- + cbind(sub,trial,size,shortest,startlab,endlab,startconf,endconf,steps,time) > write.table(subject1, "/temp/subject1.txt", sep=" ") > > #2nd example of same text file > sub <- rep(2,10) > trial <- seq(1,10,1) > size <- rep(3,10) > shortest <- rep(444,10) > startlab <- rep(444,10) > endlab <- rep(444,10) > startconf <- rep(444,10) > endconf <- rep(444,10) > steps <- sample(1:30,10) > time <- sample(1:300,10) > > subject1 <- + cbind(sub,trial,size,shortest,startlab,endlab,startconf,endconf,steps,time) > write.table(subject1, "/temp/subject2.txt", sep=" ") > > > setwd("/temp") > > #Getting list of file names > file_name <- list.files(pattern="subject*") > > mydata <- lapply (file_name, read.table, sep=" ", header=T, row.names=NULL) > > # rbind to dataframe > mydf <- do.call(rbind, mydata) > > # or use the plyr package > require(plyr) > mydf.1 <- ldply(file_name, read.table, sep = ' ', header = TRUE, row.names = NULL) > > str(mydf) 'data.frame': 20 obs. of 11 variables: $ row.names: chr "1" "2" "3" "4" ... $ sub : int 1 1 1 1 1 1 1 1 1 1 ... $ trial : int 1 2 3 4 5 6 7 8 9 10 ... $ size : int 3 3 3 3 3 3 3 3 3 3 ... $ shortest : int 444 444 444 444 444 444 444 444 444 444 ... $ startlab : int 444 444 444 444 444 444 444 444 444 444 ... $ endlab : int 444 444 444 444 444 444 444 444 444 444 ... $ startconf: int 444 444 444 444 444 444 444 444 444 444 ... $ endconf : int 444 444 444 444 444 444 444 444 444 444 ... $ steps : int 10 28 20 18 4 21 5 3 8 7 ... $ time : int 225 188 205 189 103 227 148 221 275 14 ... > str(mydf.1) 'data.frame': 20 obs. of 11 variables: $ row.names: chr "1" "2" "3" "4" ... $ sub : int 1 1 1 1 1 1 1 1 1 1 ... $ trial : int 1 2 3 4 5 6 7 8 9 10 ... $ size : int 3 3 3 3 3 3 3 3 3 3 ... $ shortest : int 444 444 444 444 444 444 444 444 444 444 ... $ startlab : int 444 444 444 444 444 444 444 444 444 444 ... $ endlab : int 444 444 444 444 444 444 444 444 444 444 ... $ startconf: int 444 444 444 444 444 444 444 444 444 444 ... $ endconf : int 444 444 444 444 444 444 444 444 444 444 ... $ steps : int 10 28 20 18 4 21 5 3 8 7 ... $ time : int 225 188 205 189 103 227 148 221 275 14 ... > On Fri, Dec 2, 2011 at 11:51 PM, James Holland wrote: > I have a multiple text files, separated by a single space, that I need to > combine into a single data.frame. ?Below is the track I'm on using > list.files to capture the names of the files and then lapply with > read.table. ?But I run into problems making a usable dataframe out of the > data. > > > #Creating example data in similar format to data I have > sub <- rep(1,10) > trial <- seq(1,10,1) > size <- rep(3,10) > shortest <- rep(444,10) > startlab <- rep(444,10) > endlab <- rep(444,10) > startconf <- rep(444,10) > endconf <- rep(444,10) > steps <- sample(1:30,10) > time <- sample(1:300,10) > > #creating example of text file and saving into a shared director with other > txt files > > subject1 <- > cbind(sub1,trial,size,shortest,startlab,endlab,startconf,endconf,steps,time) > write.table(subject1, "C:Folder/R/subject1.txt", sep=" ") > > #2nd example of same text file > sub <- rep(2,10) > trial <- seq(1,10,1) > size <- rep(3,10) > shortest <- rep(444,10) > startlab <- rep(444,10) > endlab <- rep(444,10) > startconf <- rep(444,10) > endconf <- rep(444,10) > steps <- sample(1:30,10) > time <- sample(1:300,10) > > subject1 <- > cbind(sub1,trial,size,shortest,startlab,endlab,startconf,endconf,steps,time) > write.table(subject1, "C:Folder/R/subject2.txt", sep=" ") > > > setwd("C:Folder/R/") > > #Getting list of file names > file_name <- list.files(pattern="subject*") > > mydata <- lapply (file_name, read.table, sep=" ", header=T, row.names=NULL) > > > > Thank you, > James > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From mark.heckmann at gmx.de Sat Dec 3 13:30:12 2011 From: mark.heckmann at gmx.de (Mark Heckmann) Date: Sat, 3 Dec 2011 13:30:12 +0100 Subject: [R] Sweave problem on Mac OS when using umlauts and summary() In-Reply-To: References: <94D1C064-31EA-41EA-981A-81DA7E650BCF@gmx.de> Message-ID: <4B251308-61D9-4DBE-B745-4CC2BBC073DE@gmx.de> Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: From mentor_ at gmx.net Sat Dec 3 13:33:07 2011 From: mentor_ at gmx.net (syrvn) Date: Sat, 3 Dec 2011 04:33:07 -0800 (PST) Subject: [R] Data alignment In-Reply-To: References: <1322912606118-4153024.post@n4.nabble.com> Message-ID: <1322915587713-4153112.post@n4.nabble.com> Thanks for your suggestions. I will try them. The "-" in my original post was actually only there to serve as a separator so that it is easier for you to see the data structure but apparently it rather confused you... sorry :) -- View this message in context: http://r.789695.n4.nabble.com/Data-alignment-tp4153024p4153112.html Sent from the R help mailing list archive at Nabble.com. From Mintewab.Bezabih at economics.gu.se Sat Dec 3 13:03:30 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Sat, 3 Dec 2011 13:03:30 +0100 Subject: [R] problems using the thin plate spline method Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> Dear R users, I am a beginner in R trying to apply the thin plate spline method to my climate data. I used the example in R to do so, and the lines seem to run fine ( I am not getting errors) but I am not getting any output in the form of graph or anything. I got a warning message saying that 'surface extends beyond box'. Any help is much appreciated. thanks minti From hcatbr at yahoo.co.in Sat Dec 3 13:06:38 2011 From: hcatbr at yahoo.co.in (HC) Date: Sat, 3 Dec 2011 04:06:38 -0800 (PST) Subject: [R] Downloading tab separated data from internet In-Reply-To: <1322887656326-4152318.post@n4.nabble.com> References: <1322887656326-4152318.post@n4.nabble.com> Message-ID: <1322913998408-4153063.post@n4.nabble.com> Thanks for your reply. I tried to use the postForm function of RCurl as below but do not have much clue as to how to go further with what it does. library(RCurl) stn<-"03015795" myurl<-paste("http://ida.water.usgs.gov/ida/available_records.cfm?sn=",stn,sep="") mypage1 = readLines(myurl) # Getting the start and end dates mypattern = '([^<]*)' datalines = grep(mypattern, mypage1[124], value=TRUE) getexpr = function(s,g)substring(s,g,g+attr(g,'match.length')-1) gg = gregexpr(mypattern, datalines) matches = mapply(getexpr,datalines,gg) result = gsub(mypattern,'\\1',matches) names(result)=NULL mydates<-result[1:2] result = postForm(myurl,fromdate=mydates[1], todate=mydates[2],rtype="Save to File", submit1="Retrieve Data") I tried to read the RCurl's documentation but do not know what functions I should be using. Are there any examples available that could be helpful. Could you point me to those please. Thanks for the help. HC -- View this message in context: http://r.789695.n4.nabble.com/Downloading-tab-separated-data-from-internet-tp4152318p4153063.html Sent from the R help mailing list archive at Nabble.com. From mentor_ at gmx.net Sat Dec 3 14:41:07 2011 From: mentor_ at gmx.net (syrvn) Date: Sat, 3 Dec 2011 05:41:07 -0800 (PST) Subject: [R] replace values Message-ID: <1322919667580-4153301.post@n4.nabble.com> Hello, imagine the following data.frame: ID name 1 *_A 2 *_A 3 *_B 4 *_B * = can be any pattern I want to replace every row which ends with _A by 1 and every row which ends by _B with a 0 so that the data.frame looks like the following: ID name 1 1 2 1 3 0 4 0 Which function do I use best to achieve this? Cheers, Syrvn -- View this message in context: http://r.789695.n4.nabble.com/replace-values-tp4153301p4153301.html Sent from the R help mailing list archive at Nabble.com. From dwinsemius at comcast.net Sat Dec 3 15:33:17 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sat, 3 Dec 2011 09:33:17 -0500 Subject: [R] replace values In-Reply-To: <1322919667580-4153301.post@n4.nabble.com> References: <1322919667580-4153301.post@n4.nabble.com> Message-ID: <3D879875-E506-4126-BCE5-46330B4A12BA@comcast.net> On Dec 3, 2011, at 8:41 AM, syrvn wrote: > Hello, > > > imagine the following data.frame: > > ID name > 1 *_A > 2 *_A > 3 *_B > 4 *_B > > * = can be any pattern > > I want to replace every row which ends with _A by 1 and every row > which ends > by _B with a 0 You can use grep(patt, x, value=TRUE) to return vlaues that can be used in the prior answers to your earlier question today. I would have worked it out and tested the strategy, but you continue to fail to produce workable examples.... and then apologize that people are "confused" by them. We are NOT confused... only annoyed ... that you fail to use dput() or code for constructing workable code. -- David. > > so that the data.frame looks like the following: > > ID name > 1 1 > 2 1 > 3 0 > 4 0 > > > Which function do I use best to achieve this? > > Cheers, > Syrvn > > > > -- > View this message in context: http://r.789695.n4.nabble.com/replace-values-tp4153301p4153301.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From manoharan.arun at gmail.com Sat Dec 3 14:59:10 2011 From: manoharan.arun at gmail.com (stillerfan) Date: Sat, 3 Dec 2011 05:59:10 -0800 (PST) Subject: [R] Problem installing Rtools In-Reply-To: <4ED9F591.5050109@gmail.com> References: <1322882726581-4152013.post@n4.nabble.com> <4ED9F591.5050109@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jdnewmil at dcn.davis.ca.us Sat Dec 3 17:45:02 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Sat, 03 Dec 2011 08:45:02 -0800 Subject: [R] problems using the thin plate spline method In-Reply-To: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> Message-ID: I can tell that you are puzzled and confused. Unfortunately, I am not psychic, so I cannot tell what you did, and therefore cannot tell where you went astray. The solution is for you to read the posting guide mentioned at the bottom of every R-help message. Spend a little time to create a small bit of data like yours if your actual data is large (subset and dput are useful for this). Remember to include the output of sessionInfo, and so on. Many times you are likely to find the answer yourself by going through these steps, but they are essential for communication. Good luck. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Mintewab Bezabih wrote: >Dear R users, > >I am a beginner in R trying to apply the thin plate spline method to my >climate data. I used the example in R to do so, and the lines seem to >run fine ( I am not getting errors) but I am not getting any output in >the form of graph or anything. I got a warning message saying that >'surface extends beyond box'. > >Any help is much appreciated. >thanks >minti >______________________________________________ >R-help at 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 code. From martin2005z at yahoo.com Sat Dec 3 19:10:38 2011 From: martin2005z at yahoo.com (Martin Zonyrah) Date: Sat, 3 Dec 2011 10:10:38 -0800 (PST) Subject: [R] Iteration in R Message-ID: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From momadou at yahoo.fr Sat Dec 3 19:19:19 2011 From: momadou at yahoo.fr (Komine) Date: Sat, 3 Dec 2011 10:19:19 -0800 (PST) Subject: [R] Problem with loop In-Reply-To: References: <1322846156594-4148083.post@n4.nabble.com> Message-ID: <1322936359572-4154147.post@n4.nabble.com> Hi, Thank Michael for your help. Komine -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-loop-tp4148083p4154147.html Sent from the R help mailing list archive at Nabble.com. From hadley at rice.edu Sat Dec 3 20:10:04 2011 From: hadley at rice.edu (Hadley Wickham) Date: Sat, 3 Dec 2011 13:10:04 -0600 Subject: [R] Counting the occurences of a charater within a string In-Reply-To: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> References: <974A7A659261804FA954D102472EA32E03D37A85@NYCEMBP01101.ad.insidemedia.net> Message-ID: On Thu, Dec 1, 2011 at 10:32 AM, Douglas Esneault wrote: > I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level. > > My dataframe, x, ?is structured as below: > > Col1 > abc/def > ghi/jkl/mno > > I found this code on the board but it counts all occurrences of "/" in the dataframe. > > chr.pos <- which(unlist(strsplit(x,NULL))=='/') > chr.count <- length(chr.pos) > chr.count > [1] 3 > > I'd like to append a column, say cnt, that has the count of "/" for each row. Here's an easy way from stringr: library(stringr) str_count( c("abc/def", "ghi/jkl/mno"), "/") # [1] 1 2 Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ From dwinsemius at comcast.net Sat Dec 3 20:11:02 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sat, 3 Dec 2011 14:11:02 -0500 Subject: [R] Iteration in R In-Reply-To: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> Message-ID: <8B0DAD2A-966F-4BB5-B05E-D27FE71E8C34@comcast.net> On Dec 3, 2011, at 1:10 PM, Martin Zonyrah wrote: > Hi, > I need help. I am trying to iterate this command x <- rnorm(100, > 1.0, 2.0) one hundred times in R but I don't seem to have a clue. ?replicate > == David Winsemius, MD West Hartford, CT From michael.weylandt at gmail.com Sat Dec 3 20:11:46 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sat, 3 Dec 2011 14:11:46 -0500 Subject: [R] Iteration in R In-Reply-To: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> Message-ID: ? replicate or a for loop or do all one hundred simulations at once x <- matrix(rnorm(100^2, 1, 2), 100) It's going to depend on what you want to do with the numbers. Michael On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah wrote: > Hi, > I need help. I am trying to iterate this command? x <- rnorm(100, 1.0, 2.0) one hundred times in R but I don't seem to have a clue. > Can anyone help? > Your help is very much appreciated. > > Martin > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From djandrija at gmail.com Sat Dec 3 20:16:52 2011 From: djandrija at gmail.com (andrija djurovic) Date: Sat, 3 Dec 2011 20:16:52 +0100 Subject: [R] Iteration in R In-Reply-To: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Sat Dec 3 20:21:05 2011 From: bps0002 at auburn.edu (B77S) Date: Sat, 3 Dec 2011 11:21:05 -0800 (PST) Subject: [R] Iteration in R In-Reply-To: References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> Message-ID: <1322940065440-4154479.post@n4.nabble.com> Hi Michael, How would you do this with lapply to return a list? I can't seem to get that to work (I haven't used these much and am trying to learn). Thanks Brad Michael Weylandt wrote > > ? replicate > > or a for loop > > or do all one hundred simulations at once > > x <- matrix(rnorm(100^2, 1, 2), 100) > > It's going to depend on what you want to do with the numbers. > > Michael > > On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah <martin2005z@> wrote: >> Hi, >> I need help. I am trying to iterate this command? x <- rnorm(100, 1.0, >> 2.0) one hundred times in R but I don't seem to have a clue. >> Can anyone help? >> Your help is very much appreciated. >> >> Martin >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> >> ______________________________________________ >> R-help@ 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 code. >> > > ______________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154479.html Sent from the R help mailing list archive at Nabble.com. From djandrija at gmail.com Sat Dec 3 20:38:21 2011 From: djandrija at gmail.com (andrija djurovic) Date: Sat, 3 Dec 2011 20:38:21 +0100 Subject: [R] Iteration in R In-Reply-To: <1322940065440-4154479.post@n4.nabble.com> References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> <1322940065440-4154479.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Sat Dec 3 20:42:37 2011 From: bps0002 at auburn.edu (B77S) Date: Sat, 3 Dec 2011 11:42:37 -0800 (PST) Subject: [R] Iteration in R In-Reply-To: References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> <1322940065440-4154479.post@n4.nabble.com> Message-ID: <1322941357495-4154559.post@n4.nabble.com> Interesting and thank you; I'm confused as to why this doesn't work with: lapply(rep(1,6), FUN=rnorm, n=10, mean=1.0, sd=1) andrija djurovic wrote > > Hi Brad. Maybe something like this: > > lapply(rep(1,6), function(x) rnorm(10,0,1)) > > Andrija > > On Sat, Dec 3, 2011 at 8:21 PM, B77S <bps0002@> wrote: > >> Hi Michael, >> How would you do this with lapply to return a list? >> I can't seem to get that to work (I haven't used these much and am trying >> to >> learn). >> Thanks >> Brad >> >> >> Michael Weylandt wrote >> > >> > ? replicate >> > >> > or a for loop >> > >> > or do all one hundred simulations at once >> > >> > x <- matrix(rnorm(100^2, 1, 2), 100) >> > >> > It's going to depend on what you want to do with the numbers. >> > >> > Michael >> > >> > On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah <martin2005z@> >> wrote: >> >> Hi, >> >> I need help. I am trying to iterate this command x <- rnorm(100, 1.0, >> >> 2.0) one hundred times in R but I don't seem to have a clue. >> >> Can anyone help? >> >> Your help is very much appreciated. >> >> >> >> Martin >> >> >> >> [[alternative HTML version deleted]] >> >> >> >> >> >> ______________________________________________ >> >> R-help@ 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 code. >> >> >> > >> > ______________________________________________ >> > R-help@ 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 code. >> > >> >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154479.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help@ 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 code. >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154559.html Sent from the R help mailing list archive at Nabble.com. From michael.weylandt at gmail.com Sat Dec 3 20:43:32 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sat, 3 Dec 2011 14:43:32 -0500 Subject: [R] Iteration in R In-Reply-To: References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> <1322940065440-4154479.post@n4.nabble.com> Message-ID: And with replicate: replicate(100, rnorm(100, 1,2), simplify = FALSE) Michael On Sat, Dec 3, 2011 at 2:38 PM, andrija djurovic wrote: > Hi Brad. Maybe something like this: > > lapply(rep(1,6), function(x) rnorm(10,0,1)) > > Andrija > > On Sat, Dec 3, 2011 at 8:21 PM, B77S wrote: > >> Hi Michael, >> How would you do this with lapply to return a list? >> I can't seem to get that to work (I haven't used these much and am trying >> to >> learn). >> Thanks >> Brad >> >> >> Michael Weylandt wrote >> > >> > ? replicate >> > >> > or a for loop >> > >> > or do all one hundred simulations at once >> > >> > x <- matrix(rnorm(100^2, 1, 2), 100) >> > >> > It's going to depend on what you want to do with the numbers. >> > >> > Michael >> > >> > On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah <martin2005z@> >> wrote: >> >> Hi, >> >> I need help. I am trying to iterate this command ?x <- rnorm(100, 1.0, >> >> 2.0) one hundred times in R but I don't seem to have a clue. >> >> Can anyone help? >> >> Your help is very much appreciated. >> >> >> >> Martin >> >> >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> >> >> >> >> ______________________________________________ >> >> R-help@ 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 code. >> >> >> > >> > ______________________________________________ >> > R-help@ 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 code. >> > >> >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154479.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Sat Dec 3 20:45:39 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sat, 3 Dec 2011 14:45:39 -0500 Subject: [R] Iteration in R In-Reply-To: <1322941357495-4154559.post@n4.nabble.com> References: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com> <1322940065440-4154479.post@n4.nabble.com> <1322941357495-4154559.post@n4.nabble.com> Message-ID: Because lapply() tries to pass an argument to FUN and there's none that it can receive. This would work however: lapply(rep(100, 6), rnorm, mean = 1, sd = 2) Michael On Sat, Dec 3, 2011 at 2:42 PM, B77S wrote: > Interesting and thank you; I'm confused as to why this doesn't work with: > > lapply(rep(1,6), FUN=rnorm, n=10, mean=1.0, sd=1) > > > > andrija djurovic wrote >> >> Hi Brad. Maybe something like this: >> >> lapply(rep(1,6), function(x) rnorm(10,0,1)) >> >> Andrija >> >> On Sat, Dec 3, 2011 at 8:21 PM, B77S <bps0002@> wrote: >> >>> Hi Michael, >>> How would you do this with lapply to return a list? >>> I can't seem to get that to work (I haven't used these much and am trying >>> to >>> learn). >>> Thanks >>> Brad >>> >>> >>> Michael Weylandt wrote >>> > >>> > ? replicate >>> > >>> > or a for loop >>> > >>> > or do all one hundred simulations at once >>> > >>> > x <- matrix(rnorm(100^2, 1, 2), 100) >>> > >>> > It's going to depend on what you want to do with the numbers. >>> > >>> > Michael >>> > >>> > On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah <martin2005z@> >>> wrote: >>> >> Hi, >>> >> I need help. I am trying to iterate this command ?x <- rnorm(100, 1.0, >>> >> 2.0) one hundred times in R but I don't seem to have a clue. >>> >> Can anyone help? >>> >> Your help is very much appreciated. >>> >> >>> >> Martin >>> >> >>> >> ? ? ? ?[[alternative HTML version deleted]] >>> >> >>> >> >>> >> ______________________________________________ >>> >> R-help@ 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 code. >>> >> >>> > >>> > ______________________________________________ >>> > R-help@ 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 code. >>> > >>> >>> >>> -- >>> View this message in context: >>> http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154479.html >>> Sent from the R help mailing list archive at Nabble.com. >>> >>> ______________________________________________ >>> R-help@ 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 code. >>> >> >> ? ? ? [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@ 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 code. >> > > > -- > View this message in context: http://r.789695.n4.nabble.com/Iteration-in-R-tp4154433p4154559.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From bps0002 at auburn.edu Sat Dec 3 21:39:18 2011 From: bps0002 at auburn.edu (B77S) Date: Sat, 3 Dec 2011 12:39:18 -0800 (PST) Subject: [R] Moving column averaging In-Reply-To: <1322943110.21725.YahooMailNeo@web122513.mail.ne1.yahoo.com> References: <1322769191236-4130179.post@n4.nabble.com> <1322784797785-4143329.post@n4.nabble.com> <1322788604791-4143909.post@n4.nabble.com> <1322943110.21725.YahooMailNeo@web122513.mail.ne1.yahoo.com> Message-ID: <1322944758336-4154770.post@n4.nabble.com> I don't know the answer, but would suppose not. You could test this for yourself using: system.time() example: system.time(rnorm(100000,0,1)) Chega wrote > > This solved my problem - Thanks a lot for your help! Please allow me one > more question: Works zoo's rollapply on a plain matrix faster than on a > zoo object? I am asking since I wanted to apply the provided averaging > code to a larger matrix (2500 rows x 200 cols), which is quite time > consuming... > > Thanks again! > > Chega > > ________________________________ > From: B77S [via R] <ml-node+s789695n4143909h3 at .nabble> > To: Chega <chegaga@> > Sent: Friday, December 2, 2011 6:16 AM > Subject: Re: Moving column averaging > > > Sorry for that, and thanks Gabor, > I could have sworn that it wouldn't. > > > > Gabor Grothendieck wrote >>On Thu, Dec 1, 2011 at 7:13 PM, B77S <[hidden email]> wrote: >>> # need zoo to use rollapply() >>> >>> # your data (I called df) >>> df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), >>> ? ?e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", >>> "e", "f"), class = "data.frame", row.names = c(NA, -2L)) >>> >>> # transpose and make a zoo object >>> df2 <- zoo(t(df)) >>> >>> #rollapply to get means and transpose back >>> means <- t(rollapply(df2, width=2, by=2, FUN=mean)) >>> >>> # adding the combined column names you requested >>> colnames(means) <- apply(matrix(names(df), nrow=2), 2, paste, >>> collapse=", ") >>> >> >>Note that zoo's rollapply also works on plain matrices and vectors. >> >>-- >>Statistics & Software Consulting >>GKX Group, GKX Associates Inc. >>tel: 1-877-GKX-GROUP >>email: ggrothendieck at gmail.com >> >>______________________________________________ >>[hidden email]?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 code. > > ________________________________ > > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/Moving-column-averaging-tp4130179p4143909.html > To unsubscribe from Moving column averaging, click here. > NAML > -- View this message in context: http://r.789695.n4.nabble.com/Moving-column-averaging-tp4130179p4154770.html Sent from the R help mailing list archive at Nabble.com. From avinashbarnwal123 at gmail.com Sat Dec 3 22:08:12 2011 From: avinashbarnwal123 at gmail.com (avinash barnwal) Date: Sun, 4 Dec 2011 02:38:12 +0530 Subject: [R] Shading the plot Message-ID: Hi all, I have been trying to shade the specific part of the plot Part to be shaded 1. Any color whenever a2>a3 2. Any other color( Not same as 1) whenever a2 From michael.weylandt at gmail.com Sat Dec 3 22:16:07 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sat, 3 Dec 2011 16:16:07 -0500 Subject: [R] Shading the plot In-Reply-To: References: Message-ID: ? polygon example(polygon) Michael On Sat, Dec 3, 2011 at 4:08 PM, avinash barnwal wrote: > Hi all, > > I have been trying to shade the specific part of the plot > > Part to be shaded > > 1. Any color whenever a2>a3 > > 2. Any other color( Not same as 1) whenever a2 > Suggest me some code for this task > > PLOT CODE for reference > > ###################################################################################################### > a2<-c("81.96392786","81.96392786","82.16432866","82.56513026","82.76553106","79.96593186","78.16633267", > "75.56713427","74.76753507","72.96793587","70.96793587","45.96793587","83.96793587","84.36873747", > "84.56913828","84.56913828","84.56913828","84.56913828","84.36873747","84.36873747") > a3<-c("81.96392786","81.96392786","81.96392786","70.96392786","68.16432866","66.16432866", > "62.16432866","58.56513026","56.56513026","54.56513026","48.56513026","49.76553106","52.76553106", > "54.76553106","57.96593186","59.36673347","83.36673347","83.36673347","83.36673347", > "83.56713427") > plot(a2,type='l',col='red',ylab='',xlab=" ",axes=FALSE) > lines(a3,col='blue',ylab='',xlab=" ") > ###################################################################################################### > > Thank you in the advance > -- > Avinash Barnwal > Final year undergraduate student > Statistics and informatics > Department of Mathematics > IIT Kharagpur > > ______________________________________________ > R-help at 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 code. > From robertf at uoregon.edu Sat Dec 3 23:11:39 2011 From: robertf at uoregon.edu (inferno846) Date: Sat, 3 Dec 2011 14:11:39 -0800 (PST) Subject: [R] Data Analysis for Gas Prices Message-ID: <1322950299124-4155078.post@n4.nabble.com> Hi there, I'm looking to analyze a set of data on local gas prices for a single day. I'm wondering what kind of questions I should be looking to ask and how to find and answer to them with R. Examples would be: Do prices differ between brands? Does location affect (NE, NW, SE, SW) price? Does the number of nearby (within .25 miles) competitors affect price? Do gas stations near shopping centers or highways have different prices? Also, could anyone help me figure out how to import a data table to R? When I try to create a .txt file from a word document and read it in R, the format of the first column always messes up. Any/all help is appreciated. -- View this message in context: http://r.789695.n4.nabble.com/Data-Analysis-for-Gas-Prices-tp4155078p4155078.html Sent from the R help mailing list archive at Nabble.com. From avinashbarnwal123 at gmail.com Sat Dec 3 23:28:50 2011 From: avinashbarnwal123 at gmail.com (avinash barnwal) Date: Sun, 4 Dec 2011 03:58:50 +0530 Subject: [R] Shading the plot In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From astareh at hotmail.com Sat Dec 3 23:27:19 2011 From: astareh at hotmail.com (set) Date: Sat, 3 Dec 2011 14:27:19 -0800 (PST) Subject: [R] pivot table help Message-ID: <1322951239541-4155144.post@n4.nabble.com> Hello R-users, I've got a huge table with about 20.00 rows and 50 columns. The table now has headers as Members1, Members2 etc. My data are 8 different individuals. And I've got a column with clusters. So each individual belongs to different clusters and can occurs multiple times within a cluster (that's the reason that there can be more than 8 members). I want a presence/ absence table for each individual within each cluster. So I want to go from: Cluster Member1 Member2 etc. 1 ind1 ind2 2 ind3 ind1 3 ind2 ind1 to cluster ind1 ind2 ind3 1 1 1 0 2 1 0 1 3 1 1 0 Has anybody any idea how I can do this? I already tried alot of things with pivottables (using cast()) But I think I'm missing out on something. thank you -- View this message in context: http://r.789695.n4.nabble.com/pivot-table-help-tp4155144p4155144.html Sent from the R help mailing list archive at Nabble.com. From bps0002 at auburn.edu Sat Dec 3 23:44:24 2011 From: bps0002 at auburn.edu (B77S) Date: Sat, 3 Dec 2011 14:44:24 -0800 (PST) Subject: [R] Data Analysis for Gas Prices In-Reply-To: <1322950299124-4155078.post@n4.nabble.com> References: <1322950299124-4155078.post@n4.nabble.com> Message-ID: <1322952264226-4155185.post@n4.nabble.com> use a < ? > to get help on a function; example: ?read.table If you do this you will see an option called "header"... use header=T if your top row contains column names. Learn how to read these help pages. Also, read thru a few beginner R manuals and see this website: http://www.statmethods.net/interface/io.html As for the rest of your questions..... Perhaps this is your sign to begin reading a intro-stats book, or inquire on a different forum. see: http://stats.stackexchange.com/questions good luck inferno846 wrote > > Hi there, > > I'm looking to analyze a set of data on local gas prices for a single day. > I'm wondering what kind of questions I should be looking to ask and how to > find and answer to them with R. Examples would be: > > Do prices differ between brands? > Does location affect (NE, NW, SE, SW) price? > Does the number of nearby (within .25 miles) competitors affect price? > Do gas stations near shopping centers or highways have different prices? > > Also, could anyone help me figure out how to import a data table to R? > When I try to create a .txt file from a word document and read it in R, > the format of the first column always messes up. Any/all help is > appreciated. > -- View this message in context: http://r.789695.n4.nabble.com/Data-Analysis-for-Gas-Prices-tp4155078p4155185.html Sent from the R help mailing list archive at Nabble.com. From rmh at temple.edu Sat Dec 3 23:53:59 2011 From: rmh at temple.edu (Richard M. Heiberger) Date: Sat, 3 Dec 2011 17:53:59 -0500 Subject: [R] pivot table help In-Reply-To: <1322951239541-4155144.post@n4.nabble.com> References: <1322951239541-4155144.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Sun Dec 4 01:02:19 2011 From: jholtman at gmail.com (jim holtman) Date: Sat, 3 Dec 2011 19:02:19 -0500 Subject: [R] pivot table help In-Reply-To: References: <1322951239541-4155144.post@n4.nabble.com> Message-ID: try this: > x <- read.table(text = "Cluster Member1 Member2 + 1 ind1 ind2 + 2 ind3 ind1 + 3 ind2 ind1", as.is = TRUE, header = TRUE) > require(reshape2) > x.m <- melt(x, id = "Cluster") > x.m Cluster variable value 1 1 Member1 ind1 2 2 Member1 ind3 3 3 Member1 ind2 4 1 Member2 ind2 5 2 Member2 ind1 6 3 Member2 ind1 > table(x.m$Cluster, x.m$value) ind1 ind2 ind3 1 1 1 0 2 1 0 1 3 1 1 0 > On Sat, Dec 3, 2011 at 5:53 PM, Richard M. Heiberger wrote: > Pivot tables are an Excel concept, not an R concept. > > That means you must give an example of your starting pivot table as an R > object (use dump() so we can pick it up from the email and execute it > immediately). > and an example of the R object you want as the result. > Use a trivial but complete example. > > An example of dump > > tmp <- matrix(1:6,2,3) > tmp > dump("tmp","") > Be sure to read the posting guide before sending your revised request. > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > Rich > On Sat, Dec 3, 2011 at 5:27 PM, set wrote: > >> Hello R-users, >> >> I've got a huge table with about 20.00 rows and 50 columns. The table now >> has headers as Members1, Members2 etc. My data are 8 different individuals. >> And I've got a column with clusters. So each individual belongs to >> different >> clusters and can occurs multiple times within a cluster (that's the reason >> that there can be more than 8 members). I want a presence/ absence table >> for >> each individual within each cluster. >> So I want to go from: >> Cluster ? Member1 ? ?Member2 ?etc. >> 1 ? ? ? ? ? ?ind1 ? ? ? ? ? ind2 >> 2 ? ? ? ? ? ?ind3 ? ? ? ? ? ind1 >> 3 ? ? ? ? ? ?ind2 ? ? ? ? ? ind1 >> >> to >> >> cluster ? ?ind1 ? ? ? ? ?ind2 ? ? ?ind3 >> 1 ? ? ? ? ? ?1 ? ? ? ? ? ? ? 1 ? ? ? ? ?0 >> 2 ? ? ? ? ? ?1 ? ? ? ? ? ? ? ?0 ? ? ? ? 1 >> 3 ? ? ? ? ? ?1 ? ? ? ? ? ? ? 1 ? ? ? ? ?0 >> >> Has anybody any idea how I can do this? I already tried alot of things with >> pivottables (using cast()) But I think I'm missing out on something. >> thank you >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/pivot-table-help-tp4155144p4155144.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From jholtman at gmail.com Sun Dec 4 01:05:18 2011 From: jholtman at gmail.com (jim holtman) Date: Sat, 3 Dec 2011 19:05:18 -0500 Subject: [R] pivot table help In-Reply-To: References: <1322951239541-4155144.post@n4.nabble.com> Message-ID: Forgot, you can also do this: > dcast(x.m, Cluster ~ value, fun = length) Cluster ind1 ind2 ind3 1 1 1 1 0 2 2 1 0 1 3 3 1 1 0 > On Sat, Dec 3, 2011 at 7:02 PM, jim holtman wrote: > try this: > >> x <- read.table(text = "Cluster ? Member1 ? ?Member2 > + 1 ? ? ? ? ? ?ind1 ? ? ? ? ? ind2 > + 2 ? ? ? ? ? ?ind3 ? ? ? ? ? ind1 > + 3 ? ? ? ? ? ?ind2 ? ? ? ? ? ind1", as.is = TRUE, header = TRUE) >> require(reshape2) >> x.m <- melt(x, id = "Cluster") >> x.m > ?Cluster variable value > 1 ? ? ? 1 ?Member1 ?ind1 > 2 ? ? ? 2 ?Member1 ?ind3 > 3 ? ? ? 3 ?Member1 ?ind2 > 4 ? ? ? 1 ?Member2 ?ind2 > 5 ? ? ? 2 ?Member2 ?ind1 > 6 ? ? ? 3 ?Member2 ?ind1 >> table(x.m$Cluster, x.m$value) > > ? ?ind1 ind2 ind3 > ?1 ? ?1 ? ?1 ? ?0 > ?2 ? ?1 ? ?0 ? ?1 > ?3 ? ?1 ? ?1 ? ?0 >> > > > On Sat, Dec 3, 2011 at 5:53 PM, Richard M. Heiberger wrote: >> Pivot tables are an Excel concept, not an R concept. >> >> That means you must give an example of your starting pivot table as an R >> object (use dump() so we can pick it up from the email and execute it >> immediately). >> and an example of the R object you want as the result. >> Use a trivial but complete example. >> >> An example of dump >> >> tmp <- matrix(1:6,2,3) >> tmp >> dump("tmp","") >> Be sure to read the posting guide before sending your revised request. >> >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> Rich >> On Sat, Dec 3, 2011 at 5:27 PM, set wrote: >> >>> Hello R-users, >>> >>> I've got a huge table with about 20.00 rows and 50 columns. The table now >>> has headers as Members1, Members2 etc. My data are 8 different individuals. >>> And I've got a column with clusters. So each individual belongs to >>> different >>> clusters and can occurs multiple times within a cluster (that's the reason >>> that there can be more than 8 members). I want a presence/ absence table >>> for >>> each individual within each cluster. >>> So I want to go from: >>> Cluster ? Member1 ? ?Member2 ?etc. >>> 1 ? ? ? ? ? ?ind1 ? ? ? ? ? ind2 >>> 2 ? ? ? ? ? ?ind3 ? ? ? ? ? ind1 >>> 3 ? ? ? ? ? ?ind2 ? ? ? ? ? ind1 >>> >>> to >>> >>> cluster ? ?ind1 ? ? ? ? ?ind2 ? ? ?ind3 >>> 1 ? ? ? ? ? ?1 ? ? ? ? ? ? ? 1 ? ? ? ? ?0 >>> 2 ? ? ? ? ? ?1 ? ? ? ? ? ? ? ?0 ? ? ? ? 1 >>> 3 ? ? ? ? ? ?1 ? ? ? ? ? ? ? 1 ? ? ? ? ?0 >>> >>> Has anybody any idea how I can do this? I already tried alot of things with >>> pivottables (using cast()) But I think I'm missing out on something. >>> thank you >>> >>> -- >>> View this message in context: >>> http://r.789695.n4.nabble.com/pivot-table-help-tp4155144p4155144.html >>> Sent from the R help mailing list archive at Nabble.com. >>> >>> ______________________________________________ >>> R-help at 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 code. >>> >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From dschruth at u.washington.edu Sun Dec 4 01:39:35 2011 From: dschruth at u.washington.edu (D. Schruth) Date: Sat, 3 Dec 2011 16:39:35 -0800 (PST) Subject: [R] help in removal of fixed pattern In-Reply-To: <1322896010158-4152524.post@n4.nabble.com> References: <1322896010158-4152524.post@n4.nabble.com> Message-ID: A great function for extracting pattern matches is 'm()' library(caroline) vect <- m('([xX][0-9])',df$Input) toupper(vect) #in case you really want all upper case x's It does the hard work of using 'sub' to remove the non-matching parts (sub, grep, regexpr, etc aren't very good for this sort of thing) It also can return a data.frame if you have multiple patterns you wish to match in each string vector element. -Dave On Fri, 2 Dec 2011, arunkumar1111 wrote: > Hi > > I have column name as given below > > If the variable is in log(X1 + 1) pattern it should be removed and i need > only X1 > > Input > log(x1 + 1) > x2 > log(X3 +1) > > Expected Output X1 X2 X3 > > Please help me > > > -- > View this message in context: http://r.789695.n4.nabble.com/help-in-removal-of-fixed-pattern-tp4152524p4152524.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. > From dwinsemius at comcast.net Sun Dec 4 03:26:17 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sat, 3 Dec 2011 21:26:17 -0500 Subject: [R] Shading the plot In-Reply-To: References: Message-ID: On Dec 3, 2011, at 5:28 PM, avinash barnwal wrote: > Hi Weylandt, > > > I tried it but i was not successful. > > Here is the full code > > Any help would be great. > ######################################################################## > time<-c("02-Jan-05","09-Jan-05","16-Jan-05","23-Jan-05","30- > Jan-05","06-Feb-05","13-Feb-05","20-Feb-05","27-Feb-05","06- > Mar-05","13-Mar-05", > "20-Mar-05","27-Mar-05","03-Apr-05","10-Apr-05","17-Apr-05","24- > Apr-05","01-May-05","08-May-05","15-May-05") > time<-as.Date(time,"%d-%b-%y") > a2<- > c > ("81.96392786 > ","81.96392786 > ","82.16432866 > ","82.56513026","82.76553106","79.96593186","78.16633267", > "75.56713427 > ","74.76753507 > ","72.96793587 > ","70.96793587","45.96793587","83.96793587","84.36873747", > "84.56913828 > ","84.56913828 > ","84.56913828","84.56913828","84.36873747","84.36873747") > a3<- > c > ("81.96392786 > ","81.96392786 > ","81.96392786","70.96392786","68.16432866","66.16432866", > "62.16432866 > ","58.56513026 > ","56.56513026 > ","54.56513026","48.56513026","49.76553106","52.76553106", > "54.76553106 > ","57.96593186 > ","59.36673347","83.36673347","83.36673347","83.36673347", > "83.56713427") > j<-0 > for(i in 1:length(a3)) > { > if(a2[i]>a3[i]) > { > j<-j+1 > x[j]<-a2[i] > y[j]<-a3[i] > temp_time[j]<-time[i] > } > } > plot(time,a2,type='l',col='red',ylab='',xlab=" ",axes=FALSE) > lines(time,a3,col='blue',ylab='',xlab=" ") > polygon(c(temp_time,rev(temp_time)),c(x,y),col="grey") > ######################################################################### What are the rules that govern requesting outside help in homework at your institution? Your current code does not recognize that there is line crossing. Nor do you describe what you mean by shading. If you wanted a rectangle within the lpot area it would drive one strategy and if you wanted only the area between the curves to be shaded it would drive a different strategy. AND you never define "x" or "y". -- David. > On Sun, Dec 4, 2011 at 2:46 AM, R. Michael Weylandt < > michael.weylandt at gmail.com> wrote: > >> ? polygon >> example(polygon) >> >> Michael >> >> On Sat, Dec 3, 2011 at 4:08 PM, avinash barnwal >> wrote: >>> Hi all, >>> >>> I have been trying to shade the specific part of the plot >>> >>> Part to be shaded >>> >>> 1. Any color whenever a2>a3 >>> >>> 2. Any other color( Not same as 1) whenever a2>> >>> Suggest me some code for this task >>> >>> PLOT CODE for reference >>> >>> >> ###################################################################################################### >>> >> a2<- >> c >> ("81.96392786 >> ","81.96392786 >> ","82.16432866 >> ","82.56513026","82.76553106","79.96593186","78.16633267", >>> >> "75.56713427 >> ","74.76753507 >> ","72.96793587 >> ","70.96793587","45.96793587","83.96793587","84.36873747", >>> >> "84.56913828 >> ","84.56913828 >> ","84.56913828","84.56913828","84.36873747","84.36873747") >>> >> a3<- >> c >> ("81.96392786 >> ","81.96392786 >> ","81.96392786","70.96392786","68.16432866","66.16432866", >>> >> "62.16432866 >> ","58.56513026 >> ","56.56513026 >> ","54.56513026","48.56513026","49.76553106","52.76553106", >>> >> "54.76553106 >> ","57.96593186 >> ","59.36673347","83.36673347","83.36673347","83.36673347", >>> "83.56713427") >>> plot(a2,type='l',col='red',ylab='',xlab=" ",axes=FALSE) >>> lines(a3,col='blue',ylab='',xlab=" ") >>> >> ###################################################################################################### >>> >>> Thank you in the advance >>> -- >>> Avinash Barnwal >>> Final year undergraduate student >>> Statistics and informatics >>> Department of Mathematics >>> IIT Kharagpur >>> >>> ______________________________________________ >>> R-help at 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 code. >>> >> > > > > -- > Avinash Barnwal > Final year undergraduate student > Statistics and informatics > Department of Mathematics > IIT Kharagpur > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From n.j.apps22 at gmail.com Sat Dec 3 23:42:52 2011 From: n.j.apps22 at gmail.com (napps22) Date: Sat, 3 Dec 2011 14:42:52 -0800 (PST) Subject: [R] density function always evaluating to zero Message-ID: <1322952172335-4155181.post@n4.nabble.com> Dear R users, I'm trying to carry out monte carlo integration of a posterior density function which is the product of a normal and a gamma distribution. The problem I have is that the density function always returns 0. How can I solve this problem? Here is my code #generate data x1 <- runif(100, min = -10, max = 10) y <- 2 * x1^2 + rnorm(100) # # # # # # # # Model 0 # # # # # # # z <- x1^2 M <- sum(z^2) MI <- 1/M zy <- crossprod(z,y) alpha.ols <- MI * zy resid_m0 <- y - z * alpha.ols s2_m0 <- sum(resid_m0^2)/v # use gibbs sampler to sample from posterior densities n <- length(y) k <- 1 v <- n - k # set up gibbs sampler nrDraws <- 10000 h_sample_m0 <- rgamma(nrDraws, v/2, v*s2_m0/2) alpha_sample <- matrix(0, nrow = nrDraws, ncol = 1) for(i in 1:nrDraws) { alpha_sample[i] <- rnorm(1,alpha.ols,(1/h_sample_m0[i]) * MI) } # define posterior density for model 0 f <- function(alpha,h) { e <- y - alpha * x1^2 const <- (2*pi)^(-n/2) / ( gamma(v/2) * (v*s2_m1/2)^(-v/2) ) kernel <- h^((v-1)/2) * exp((-(h/2) * sum(e^2)) - (v*s2_m0)*h) x <- const * kernel return(x) } # calculate approximation of p(y|m_0) m0 <-f(alpha_sample,h_sample_m0) post_m0 <- sum(m0) / nrDraws -- View this message in context: http://r.789695.n4.nabble.com/density-function-always-evaluating-to-zero-tp4155181p4155181.html Sent from the R help mailing list archive at Nabble.com. From dlduncan2 at alaska.edu Sun Dec 4 01:44:06 2011 From: dlduncan2 at alaska.edu (Danielle Duncan) Date: Sat, 3 Dec 2011 15:44:06 -0900 Subject: [R] Logistic Regression with genetic component Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From johnson.cheryl625 at gmail.com Sun Dec 4 01:46:42 2011 From: johnson.cheryl625 at gmail.com (Cheryl Johnson) Date: Sat, 3 Dec 2011 19:46:42 -0500 Subject: [R] rnorm command Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From zack.abrahamson at gmail.com Sun Dec 4 03:08:09 2011 From: zack.abrahamson at gmail.com (z2.0) Date: Sat, 3 Dec 2011 18:08:09 -0800 (PST) Subject: [R] Prediction from censReg? Message-ID: <1322964489802-4155855.post@n4.nabble.com> Hi - First post, so excuse any errors in protocol: Wanted to ask if there's an easy way to use 'predict' with objects of class 'censReg', 'maxLik', 'maxim' or 'list'. Have a left-censored dataset, attempting to use a Tobit model and am working with the censReg package. I like how easy it is to move from glm models to predictions with 'predict' and wanted to ask if there was a way to do so with objects output from 'censReg'. Thanks, Zack -- View this message in context: http://r.789695.n4.nabble.com/Prediction-from-censReg-tp4155855p4155855.html Sent from the R help mailing list archive at Nabble.com. From svezakal at gmail.com Sun Dec 4 04:23:35 2011 From: svezakal at gmail.com (grttt nbbfg) Date: Sun, 4 Dec 2011 04:23:35 +0100 Subject: [R] upper bound in the integrate function depends on a parameter Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From avinashbarnwal123 at gmail.com Sun Dec 4 05:37:03 2011 From: avinashbarnwal123 at gmail.com (avinash barnwal) Date: Sun, 4 Dec 2011 10:07:03 +0530 Subject: [R] Shading the plot In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Sun Dec 4 05:50:15 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sat, 3 Dec 2011 23:50:15 -0500 Subject: [R] density function always evaluating to zero In-Reply-To: <1322952172335-4155181.post@n4.nabble.com> References: <1322952172335-4155181.post@n4.nabble.com> Message-ID: On Dec 3, 2011, at 5:42 PM, napps22 wrote: > Dear R users, > > I'm trying to carry out monte carlo integration of a posterior density > function which is the product of a normal and a gamma distribution. > The > problem I have is that the density function always returns 0. How > can I > solve this problem? Your code throws errors due to several missing objects due in part to a missing "v", but moving that higher in the code does not cure everything. A missing 's2_m1' is also listed as a source of error. You might want to try in a clean session and redo your debugging so that you know what variables are in your workspace and their values. The usual debugging method is to sprinkle print() statements in your code to monitor where things might not be proceeding as planned. -- David. > > Here is my code > > #generate data > > x1 <- runif(100, min = -10, max = 10) > y <- 2 * x1^2 + rnorm(100) > > # # # # # # # # Model 0 # # # # # # # > > z <- x1^2 > M <- sum(z^2) > MI <- 1/M > zy <- crossprod(z,y) > alpha.ols <- MI * zy > resid_m0 <- y - z * alpha.ols > s2_m0 <- sum(resid_m0^2)/v > > # use gibbs sampler to sample from posterior densities > > n <- length(y) > k <- 1 > v <- n - k > > # set up gibbs sampler > > nrDraws <- 10000 > h_sample_m0 <- rgamma(nrDraws, v/2, v*s2_m0/2) > alpha_sample <- matrix(0, nrow = nrDraws, ncol = 1) > > for(i in 1:nrDraws) { > > alpha_sample[i] <- rnorm(1,alpha.ols,(1/h_sample_m0[i]) * MI) > > } > > # define posterior density for model 0 > > f <- function(alpha,h) { > > e <- y - alpha * x1^2 > const <- (2*pi)^(-n/2) / ( gamma(v/2) * (v*s2_m1/2)^(-v/2) ) > kernel <- h^((v-1)/2) * exp((-(h/2) * sum(e^2)) - (v*s2_m0)*h) > x <- const * kernel > return(x) > } > > # calculate approximation of p(y|m_0) > > m0 <-f(alpha_sample,h_sample_m0) > post_m0 <- sum(m0) / nrDraws > > > -- > View this message in context: http://r.789695.n4.nabble.com/density-function-always-evaluating-to-zero-tp4155181p4155181.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Sun Dec 4 06:06:17 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sun, 4 Dec 2011 00:06:17 -0500 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: On Dec 3, 2011, at 10:23 PM, grttt nbbfg wrote: > Sorry for my English, is not my first language.. > > I have some trouble in terms of using integrate function in R. > fx is a function of m and x where m is supposed to be a unknown > parameter. R is not an algebraic solver (and R-help is not a homework list.). > >> fx=function(m,x){ > + x*2/(3*m)*(1-x/(3*m)) > + } > > The problem is in upper bound, it depends on parameter m. > >> integrate(fx,lower=0,upper=3*m)$value > > Is it possible to use the integrate function when bounds depend on a > parameter? If it is known, yes. You could also do some investigation: curve(x*2/(3*5)*(1-x/(3*5)), 0, 15) > > How to define m to solve this integral? The result should be m. As I said, no homework answers here. -- David Winsemius, MD West Hartford, CT From jdnewmil at dcn.davis.ca.us Sun Dec 4 06:11:43 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Sat, 03 Dec 2011 21:11:43 -0800 Subject: [R] rnorm command In-Reply-To: References: Message-ID: <23878a64-7f5d-469c-8a95-15cf6a0d0e87@email.android.com> No. If you want a more informative answer, try following the recommendations in the posting guide mentioned below. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Cheryl Johnson wrote: >Hello, > >I use the command rnorm, and I feed these results into a lmer command. >Since I am using the rnorm command I expect to get different results >for >each iteration, yet for each iteration I am getting the same answer. If >someone understands why I am getting the same answer every time with a >random number generator, I would appreciate help in understanding why >this >is happening. Is the lmer command causing the answer to be the same >each >time? > >Thanks > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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 code. From p_connolly at slingshot.co.nz Sun Dec 4 05:16:25 2011 From: p_connolly at slingshot.co.nz (Patrick Connolly) Date: Sun, 4 Dec 2011 17:16:25 +1300 Subject: [R] Assign name to object for each iteration in a loop. In-Reply-To: <1322763198075-4129752.post@n4.nabble.com> References: <1322763198075-4129752.post@n4.nabble.com> Message-ID: <20111204041624.GD28933@slingshot.co.nz> On Thu, 01-Dec-2011 at 10:13AM -0800, lglew wrote: |> Hi R-users, |> |> I'm trying to produce decompositions of a multiple time-series, grouped by a |> factor (called "area"). I'm modifying the code in the STLperArea function of |> package ndvits, as this function only plots produces stl plots, it does not |> return the underlying data. |> |> I want to extract the trend component of each decomposition |> ("x$time.series[,trend]), assign a name based on the factor "area". |> |> My input data look like this: |> Area is a factor, with three (but could be many more) levels. |> area |> 1 |> 2 |> 3 |> |> Ystart=2000 |> |> TS is a timeseries: |> |> X2000049 X2000065 X2000081 X2000097 X2000113 |> 1 0.2080 0.2165 0.2149 0.2314 0.2028 |> 2 0.1578 0.1671 0.1577 0.1593 0.1672 |> 3 0.1897 0.1948 0.2290 0.2292 0.2067 |> |> Here's the function: |> |> STLpA<-function(TS, area, Ystart, period=23, nSG="5,5", DSG=0) |> { |> require (RTisean) |> for(i in 1:unique(area)){ |> vi.metric=TS[area==i] |> filt.vi<-sav_gol(vi.metric,n=nSG,D=DSG) |> vi.sg<-ts(filt.vi[,1], start=Ystart,frequency=period) |> stld.tmp<-stl(vi.sg, s.window="periodic", robust=TRUE, na.action=na.approx) |> stld.trend<-stld.temp$time.series[,trend] |> } |> assign(paste("stld", i , sep= "."), stld.trend) |> vi.trend<-ls(pattern= "^stld..$") |> return(vi.trend) |> } |> |> When I call this function with signal=STLpA(TS,area,Ystart=2000,period=23, |> nSG= "5,5", DSG="0")) |> |> I get this error: |> |> Error in cat(list(...), file, sep, fill, labels, append) : |> argument 1 (type 'list') cannot be handled by 'cat' |> In addition: Warning message: |> In 1:unique(area) : |> numerical expression has 3 elements: only the first used |> |> I'm guessing this is because I'm assigning names to each temporary stl.trend |> file incorrectly. Can anyone |> improve on my rather poor efforts here? I would suggest putting your individual trends into a list and returning that at the end of your function rather than trying to assing individual objects. IMHO it's easier to do and more useful. Something along these lines: > trends <- list() > for(i in 1:unique(area)){ ... + trends[[i]] <- .... } Then you'll have an element in the list trends that you do with what you will. It creates less clutter also. HTH -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. From mentor_ at gmx.net Sun Dec 4 12:49:00 2011 From: mentor_ at gmx.net (syrvn) Date: Sun, 4 Dec 2011 03:49:00 -0800 (PST) Subject: [R] xyplot squeezed together Message-ID: <1322999340150-4156661.post@n4.nabble.com> Hi, I created the following example of a xyplot. The plot actually looks ok apart from that the x-axis is pretty squeezed/clinched. I tried aspect="fill" already but I want to have all 3 sub plots next to each other. I tried loads of different scaling varieties but with no significant result... library(lattice) N <- 6 d <- data.frame(factor(rep(c("A1","A2","A3"),each=N), levels=c("A1","A2","A3")), factor(rep(c("B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9"), each=N/3), levels=c("B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9")), rep(c(0,1), each=N/3/2)) colnames(d) <- c("ID", "class", "group") value <- matrix(c(400,300, 320,380, 410,500, 800,670, 810,900, 560,750, 1100,1200, 1200,1300, 1300,1200)) d <- cbind(d, value) xyplot(value ~ group | ID, d, groups = class, type = c("g", "b"), auto.key = list(lines = TRUE, columns = 3), xlab = "blocked=0, released=1", ylab = "value", aspect = 'xy', scales=list(x=list(at=-1:2, labels=c("",0,1,"")))) Anyone any ideas how to enlarge the x-axis? Cheers -- View this message in context: http://r.789695.n4.nabble.com/xyplot-squeezed-together-tp4156661p4156661.html Sent from the R help mailing list archive at Nabble.com. From jwd at surwest.net Sun Dec 4 09:53:58 2011 From: jwd at surwest.net (John) Date: Sun, 4 Dec 2011 00:53:58 -0800 Subject: [R] Data Analysis for Gas Prices In-Reply-To: <1322950299124-4155078.post@n4.nabble.com> References: <1322950299124-4155078.post@n4.nabble.com> Message-ID: <20111204005358.7f1fa7a6@draco> On Sat, 3 Dec 2011 14:11:39 -0800 (PST) inferno846 wrote: ... > > Also, could anyone help me figure out how to import a data table to > R? When I try to create a .txt file from a word document and read it > in R, the format of the first column always messes up. Any/all help > is appreciated. > For reading in data, avoid using Word, a program that is overkill for almost all purposes. Either use Notepad, or grab a simple text editor off the internet - preferably capable of block selection. Since you do not say just how the "first column messes up," it is rather problematic trying suggest a solution the problem. The first line of the table and a couple data lines, the form of command you use to read in the data and the field separator in your table are all useful pieces of information. There are however a great many books about R out there and nearly all of them address at least briefly how to import data. Portland has one of the best bookstores on the planet. As a last resort you might try the command ??read.table from the R prompt. JD From astareh at hotmail.com Sun Dec 4 10:08:14 2011 From: astareh at hotmail.com (set) Date: Sun, 4 Dec 2011 01:08:14 -0800 (PST) Subject: [R] pivot table help In-Reply-To: References: <1322951239541-4155144.post@n4.nabble.com> Message-ID: <1322989694104-4156393.post@n4.nabble.com> Thank you very much! works perfectly! -- View this message in context: http://r.789695.n4.nabble.com/pivot-table-help-tp4155144p4156393.html Sent from the R help mailing list archive at Nabble.com. From astareh at hotmail.com Sun Dec 4 10:21:49 2011 From: astareh at hotmail.com (set) Date: Sun, 4 Dec 2011 01:21:49 -0800 (PST) Subject: [R] frequency table? Message-ID: <1322990509062-4156422.post@n4.nabble.com> Hello R-users, I've got a file with individuals as colums and the clusters where they occur in as rows. And I wanted a table which tells me how many times each individual occurs with another. I don't really know how such a table is called...it is not a frequency table....My eventual goal is to make Venn-diagrams from the occurence of my individuals. So I've this: cluster ind1 ind2 ind3 etc. 1 0 1 2 2 3 0 1 3 1 1 1 And I want to go to this: ind1 ind2 ind3 ind1 0 4 2 ind2 4 0 4 ind3 2 4 1 is there a way to do this? Thank you for your help -- View this message in context: http://r.789695.n4.nabble.com/frequency-table-tp4156422p4156422.html Sent from the R help mailing list archive at Nabble.com. From n.j.apps22 at gmail.com Sun Dec 4 13:47:45 2011 From: n.j.apps22 at gmail.com (napps22) Date: Sun, 4 Dec 2011 04:47:45 -0800 (PST) Subject: [R] density function always evaluating to zero In-Reply-To: <1322952172335-4155181.post@n4.nabble.com> References: <1322952172335-4155181.post@n4.nabble.com> Message-ID: <1323002865006-4156746.post@n4.nabble.com> Sorry that was my poor copying and pasting. Here's the correct R code. The problem does seem to be with the function I define as f. # Model selection example in a bayesian framework # two competiting non-nested models # M0: y_t = alpha * x1^2 + e_t # M1: y_t = beta * x1^4 + e_t # where e_t ~ iidN(0,1) #generate data x1 <- runif(100, min = -10, max = 10) y <- 2 * x1^2 + rnorm(100) n <- length(y) k <- 1 v <- n - k # want the posterior probabilities of the two models # postprob_mj = p(y|model j true) * priorprob_mj / p(y) # need to calculate the integral of p(y|alpha,h)p(alpha,h) # and the integral of p(y|beta,h)p(beta,h) # recall we chose p(alpha,h) = p(beta,h) = 1/h # need to sample from the posterior to get an approximation of the integral # # # # # # # # Model 0 # # # # # # # z <- x1^2 M <- sum(z^2) MI <- 1/M zy <- crossprod(z,y) alpha.ols <- MI * zy resid_m0 <- y - z * alpha.ols s2_m0 <- sum(resid_m0^2)/v # set up gibbs sampler nrDraws <- 10000 h_sample_m0 <- rgamma(nrDraws, v/2, v*s2_m0/2) alpha_sample <- matrix(0, nrow = nrDraws, ncol = 1) for(i in 1:nrDraws) { alpha_sample[i] <- rnorm(1,alpha.ols,(1/h_sample_m0[i]) * MI) } # define posterior density for m0 f <- function(alpha,h) { e <- y - alpha * x1^2 const <- (2*pi)^(-n/2) / ( gamma(v/2) * (v*s2_m0/2)^(-v/2) ) kernel <- h^((v-1)/2) * exp((-(h/2) * sum(e^2)) - (v*s2_m0)*h) x <- const * kernel return(x) } # calculate approximation of p(y|m_0) m0 <-f(alpha_sample,h_sample_m0) post_m0 <- sum(m0) / nrDraws -- View this message in context: http://r.789695.n4.nabble.com/density-function-always-evaluating-to-zero-tp4155181p4156746.html Sent from the R help mailing list archive at Nabble.com. From Mintewab.Bezabih at economics.gu.se Sun Dec 4 14:08:52 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Sun, 4 Dec 2011 14:08:52 +0100 Subject: [R] problems using the thin plate spline method In-Reply-To: References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se>, Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> Dear R users and Jeff, Sorry for not being quite explicit in my earlier message. My main problem is while my data seem to be read into R well (I manage to graph them and all), I cannot get the following line to work. tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") and I get the following error message Error in as.matrix(x) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': Error: object 'x1' not found thanks for help minti ________________________________________ Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] Skickat: den 3 december 2011 17:45 Till: Mintewab Bezabih; r-help at r-project.org ?mne: Re: [R] problems using the thin plate spline method I can tell that you are puzzled and confused. Unfortunately, I am not psychic, so I cannot tell what you did, and therefore cannot tell where you went astray. The solution is for you to read the posting guide mentioned at the bottom of every R-help message. Spend a little time to create a small bit of data like yours if your actual data is large (subset and dput are useful for this). Remember to include the output of sessionInfo, and so on. Many times you are likely to find the answer yourself by going through these steps, but they are essential for communication. Good luck. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Mintewab Bezabih wrote: >Dear R users, > >I am a beginner in R trying to apply the thin plate spline method to my >climate data. I used the example in R to do so, and the lines seem to >run fine ( I am not getting errors) but I am not getting any output in >the form of graph or anything. I got a warning message saying that >'surface extends beyond box'. > >Any help is much appreciated. >thanks >minti >______________________________________________ >R-help at 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 code. From sarah.goslee at gmail.com Sun Dec 4 15:21:49 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sun, 4 Dec 2011 09:21:49 -0500 Subject: [R] problems using the thin plate spline method In-Reply-To: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> Message-ID: Hello, On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih wrote: > Dear R users and Jeff, > > Sorry for not being quite explicit in my earlier message. And you are still not explicit. We have no idea what you've done. > My main problem is while my data seem to be read into R well (I manage to graph them and all), I cannot get the following line to work. > > tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") > > and I get the following error message > > Error in as.matrix(x) : > ?error in evaluating the argument 'x' in selecting a method for function 'as.matrix': Error: object 'x1' not found I'd have to guess that there's no object x1. What does ls() tell you? str(x1)? What do your data look like? You were already given instructions on how to include sample data to construct a reproducible example. You said that graphing your data worked; how did you do so? The posting guide and the advice you were already given were both offered for a reason. The querent needs to do the work of formulating an understandable and answerable question. Sarah > thanks for help > minti > ________________________________________ > Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] > Skickat: den 3 december 2011 17:45 > Till: Mintewab Bezabih; r-help at r-project.org > ?mne: Re: [R] problems using the thin plate spline method > > I can tell that you are puzzled and confused. Unfortunately, I am not psychic, so I cannot tell what you did, and therefore cannot tell where you went astray. > > The solution is for you to read the posting guide mentioned at the bottom of every R-help message. Spend a little time to create a small bit of data like yours if your actual data is large (subset and dput are useful for this). Remember to include the output of sessionInfo, and so on. Many times you are likely to find the answer yourself by going through these steps, but they are essential for communication. > > Good luck. > Sent from my phone. Please excuse my brevity. > > Mintewab Bezabih wrote: > >>Dear R users, >> >>I am a beginner in R trying to apply the thin plate spline method to my >>climate data. I used the example in R to do so, and the lines seem to >>run fine ( I am not getting errors) but I am not getting any output in >>the form of graph or anything. I got a warning message saying that >>'surface extends beyond box'. >> >>Any help is much appreciated. >>thanks >>minti -- Sarah Goslee http://www.functionaldiversity.org From sarah.goslee at gmail.com Sun Dec 4 15:27:06 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sun, 4 Dec 2011 09:27:06 -0500 Subject: [R] density function always evaluating to zero In-Reply-To: <1323002865006-4156746.post@n4.nabble.com> References: <1322952172335-4155181.post@n4.nabble.com> <1323002865006-4156746.post@n4.nabble.com> Message-ID: I didn't try out your extensive code, but here's one potentially serious problem: You only pass two arguments to f(), alpha and h, but within f you nonetheless use x1 and y and several other things. This is bad practice, and dangerous: you should pass all the necessary arguments to f(), not rely on the environment to contain them. After you fix that, working through your function step by step at the command line and looking at the results of each line of code can be very educational. Sarah On Sun, Dec 4, 2011 at 7:47 AM, napps22 wrote: > Sorry that was my poor copying and pasting. Here's the correct R code. The > problem does seem to be with the function I define as f. > > # Model selection example in a bayesian framework > # two competiting non-nested models > # M0: y_t = alpha * x1^2 + e_t > # M1: y_t = beta * x1^4 + e_t > # where e_t ~ iidN(0,1) > > #generate data > > x1 <- runif(100, min = -10, max = 10) > y <- 2 * x1^2 + rnorm(100) > n <- length(y) > k <- 1 > v <- n - k > > # want the posterior probabilities of the two models > # postprob_mj = p(y|model j true) * priorprob_mj / p(y) > # need to calculate the integral of p(y|alpha,h)p(alpha,h) > # and the integral of p(y|beta,h)p(beta,h) > # recall we chose p(alpha,h) = p(beta,h) = 1/h > # need to sample from the posterior to get an approximation of the integral > > # # # # # # # # Model 0 # # # # # # # > > z <- x1^2 > M <- sum(z^2) > MI <- 1/M > zy <- crossprod(z,y) > alpha.ols <- MI * zy > resid_m0 <- y - z * alpha.ols > s2_m0 <- sum(resid_m0^2)/v > > # set up gibbs sampler > > nrDraws <- 10000 > h_sample_m0 <- rgamma(nrDraws, v/2, v*s2_m0/2) > alpha_sample <- matrix(0, nrow = nrDraws, ncol = 1) > > for(i in 1:nrDraws) { > > ? ? ? ?alpha_sample[i] <- rnorm(1,alpha.ols,(1/h_sample_m0[i]) * MI) > > ? ? ? ?} > > # define posterior density for m0 > > f <- function(alpha,h) { > > ? ? ? ?e <- y - alpha * x1^2 > ? ? ? ?const <- (2*pi)^(-n/2) / ( gamma(v/2) * (v*s2_m0/2)^(-v/2) ) > ? ? ? ?kernel <- h^((v-1)/2) * exp((-(h/2) * sum(e^2)) - (v*s2_m0)*h) > ? ? ? ?x <- const * kernel > ? ? ? ?return(x) > ? ? ? ?} > > # calculate approximation of p(y|m_0) > > m0 <-f(alpha_sample,h_sample_m0) > post_m0 <- sum(m0) / nrDraws > > > -- Sarah Goslee http://www.functionaldiversity.org From sarah.goslee at gmail.com Sun Dec 4 15:36:45 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sun, 4 Dec 2011 09:36:45 -0500 Subject: [R] xyplot squeezed together In-Reply-To: <1322999340150-4156661.post@n4.nabble.com> References: <1322999340150-4156661.post@n4.nabble.com> Message-ID: You specified the aspect ratio, so your plots must have that ratio of width to height. It looks like you are trying to control layout by specifying aspect ratio? That, as you've discovered, is an ineffective way to do it. Instead, you should specify layout directly, using for your example layout=c(3,1,1) and deleting the aspect='xy' argument. Rereading the help for xyplot() more carefully would also be a good idea. Sarah On Sun, Dec 4, 2011 at 6:49 AM, syrvn wrote: > Hi, > > > I created the following example of a xyplot. The plot actually looks ok > apart from that the > > x-axis is pretty squeezed/clinched. I tried aspect="fill" already but I want > to have all 3 sub plots > > next to each other. I tried loads of different scaling varieties but with no > significant result... > > > > library(lattice) > > N <- 6 > > d <- data.frame(factor(rep(c("A1","A2","A3"),each=N), > levels=c("A1","A2","A3")), > > ? ? ? ? ? ? ? ? ? ? ? factor(rep(c("B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9"), > each=N/3), > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?levels=c("B1", "B2", "B3", "B4", "B5", "B6", "B7", > "B8", "B9")), > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?rep(c(0,1), each=N/3/2)) > > colnames(d) <- c("ID", "class", "group") > > value <- matrix(c(400,300, 320,380, 410,500, 800,670, 810,900, 560,750, > 1100,1200, 1200,1300, 1300,1200)) > > d <- cbind(d, value) > > xyplot(value ~ group | ID, d, groups = class, type = c("g", "b"), > > ? ? ? ? ?auto.key = list(lines = TRUE, columns = 3), xlab = "blocked=0, > released=1", > > ? ? ? ? ?ylab = "value", aspect = 'xy', scales=list(x=list(at=-1:2, > labels=c("",0,1,"")))) > > > > Anyone any ideas how to enlarge the x-axis? > > Cheers > > -- Sarah Goslee http://www.functionaldiversity.org From djandrija at gmail.com Sun Dec 4 15:40:21 2011 From: djandrija at gmail.com (andrija djurovic) Date: Sun, 4 Dec 2011 15:40:21 +0100 Subject: [R] RODBC connect to Excel (64-bit Windows 7) Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tal.galili at gmail.com Sun Dec 4 15:57:51 2011 From: tal.galili at gmail.com (Tal Galili) Date: Sun, 4 Dec 2011 16:57:51 +0200 Subject: [R] LaTeX output for summary.lm object - while displaying the information outside the table Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Sun Dec 4 16:17:53 2011 From: bps0002 at auburn.edu (B77S) Date: Sun, 4 Dec 2011 07:17:53 -0800 (PST) Subject: [R] Programming Statistical Functions In-Reply-To: <1323008850451-4157012.post@n4.nabble.com> References: <1280490786119-2307880.post@n4.nabble.com> <1323008850451-4157012.post@n4.nabble.com> Message-ID: <1323011873678-4157101.post@n4.nabble.com> As Stephen pointed out, this is easy to do. The word file the OP posted has all the necessary formulae. Now you just need to learn how to convert those formulae into R functions.... Stephen gave you an example of how to create a function for CV. Now run with it. perhaps something like this is what you need: http://cran.r-project.org/doc/contrib/Short-refcard.pdf It is time for you to do some reading on your own. Good luck. gvjones wrote > > Hello, > > Did you find anything helpful for calculating the statistical functions in > your list. I would like to also calculate these and have been looking for > some code to do so. > > Thanks > -- View this message in context: http://r.789695.n4.nabble.com/Programming-Statistical-Functions-tp2307880p4157101.html Sent from the R help mailing list archive at Nabble.com. From costas.vorlow at gmail.com Sun Dec 4 16:18:55 2011 From: costas.vorlow at gmail.com (Costas Vorlow) Date: Sun, 4 Dec 2011 17:18:55 +0200 Subject: [R] Vectorization instead of loops problem Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From GodinA at Dal.Ca Sun Dec 4 14:53:26 2011 From: GodinA at Dal.Ca (Aurelie Cosandey Godin) Date: Sun, 4 Dec 2011 09:53:26 -0400 Subject: [R] Polishing my geom_bar for publication References: <3467C1A6-020E-4E84-A456-C9BF8B964E8A@Dal.Ca> Message-ID: <8B1382E7-E7AA-4E0D-A6F7-7FFC623C819C@Dal.Ca> Dear list, I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with! I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2) removing the y-axis (species name) on the right figure to avoid duplication, and (3) fix the width, such that both figures have the same apparence regardless of the legend. Thank you very much in advance! The code is as follow: (a<-ggplot(Final2, aes(x=spp, y=CPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=CPUE-cpue.se, ymax=CPUE+cpue.se), size=.3, width=.2, position=position_dodge(.9)) + xlab("Species") + scale_x_discrete(breaks=c("100","102","107","88","90","91","92","93","94","96","98","99"), labels=c("WINTER","SPINYTAIL","BIGELOW'S","SKATES (NS)","THORNY","SMOOTH","ABYSSAL","LITTLE","DEEPWATER","JENSEN'S","WHITE","SOFT")) + ylab("Abundance (fish/tow)") + coord_flip() + theme_bw() + opts(axis.title.x = theme_text(size = 10)) + opts(panel.grid.minor = theme_blank()) + opts(legend.position='none') ) (b<-ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE+wpue.se), size=.3, width=.2, position=position_dodge(.9)) + xlab(NULL)+ scale_x_discrete(breaks=c("100","102","107","88","90","91","92","93","94","96","98","99"), labels=c("WINTER","SPINYTAIL","BIGELOW'S","SKATES (NS)","THORNY","SMOOTH","ABYSSAL","LITTLE","DEEPWATER","JENSEN'S","WHITE","SOFT"))+ ylab("Biomass (Weight (kg)/tow)") + scale_fill_hue(name="Survey season", # Legend label, use darker colors breaks=c("summer", "winter"), labels=c("Spring", "Fall")) + coord_flip() + theme_bw() + opts(axis.title.x = theme_text(size = 10)) + opts(panel.grid.minor = theme_blank())) pdf("polishing-layout2.pdf", width = 10, height = 6) grid.newpage() pushViewport(viewport(layout = grid.layout(1, 2))) vplayout <- function(x, y) viewport(layout.pos.row = x, layout.pos.col = y) print(a, vp = vplayout(1, 1)) print(b, vp = vplayout(1, 2)) dev.off() Aurelie Cosandey-Godin Ph.D. student, Department of Biology Industrial Graduate Fellow, WWF-Canada Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2 Phone: 1-902-494-2478 | cell: 1-902-412-3404 |Fax: 1-902-494-3736 Email: godina at dal.ca | Skype: aureliegodinco | Web: wormlab.biology.dal.ca ---------------------------------------------------------------------------------------------------------------------------------------------------- Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org From snes1982 at hotmail.com Sun Dec 4 14:18:21 2011 From: snes1982 at hotmail.com (nserdar) Date: Sun, 4 Dec 2011 05:18:21 -0800 (PST) Subject: [R] Linear quadratic Gaussian control with Kalman filter Message-ID: <1323004701350-4156813.post@n4.nabble.com> I need to generate Linear quadratic Gaussian control with Kalman filter in R programming. I only get matlab code. I think that R portfolio optimisation code ( quad..) is not adequate for this topic. Linear quadratic Gaussian control with Kalman filter http://en.wikipedia.org/wiki/Linear_quadratic_Gaussian_control Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Linear-quadratic-Gaussian-control-with-Kalman-filter-tp4156813p4156813.html Sent from the R help mailing list archive at Nabble.com. From ngokangmin at gmail.com Sun Dec 4 14:38:29 2011 From: ngokangmin at gmail.com (Kang Min) Date: Sun, 4 Dec 2011 05:38:29 -0800 (PST) Subject: [R] Extract last 3 characters from numeric vector Message-ID: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> Hi all, I have a numeric vector with 1 decimal place, and I'd like to extract the last 3 characters, including the decimal point. The vector ranges from 0 to 20. x <- round(runif(100)*20, digits=1) Some of numbers have 3 characters, and some have 4. I've read up on the substr() function but that extracts characters based on exact positions. How can I extract just the last 3 characters no matter the length of the number? e.g. from 16.7 I want 6.7, from 3.5 I want 3.5 as it is. Thanks, Kang Min From Miriam_Katharina at gmx.de Sun Dec 4 15:02:18 2011 From: Miriam_Katharina at gmx.de (Miriam ) Date: Sun, 04 Dec 2011 15:02:18 +0100 Subject: [R] problem merging data with different shapes Message-ID: <20111204140218.183110@gmx.net> I have been trying to merge datasets, one of which has a long format (Adata) and one has a (different) long format (Bdata): Adata Bdata subject order bpm subject order trial agegroup gender 1 1 70.2 1 1 3 2 1 1 1 69.5 1 2 1 2 1 1 1 68.8 1 3 2 2 1 1 2 69.1 2 1 2 1 2 1 2 70 2 2 3 1 2 1 2 70.5 2 3 1 1 2 1 3 70.2 ... 1 3 1 3 2 1 2 1 ... ... In the end I would like to have a dataset that contains A unchanged with the additional information from B added. subject order bpm trial agegroup gender 1 1 70.2 3 2 1 1 1 69.5 3 2 1 1 1 68.8 3 2 1 ... I have tried: newdataframe <- merge(Adata,Bdata, by= c("subject", "order"), sort = FALSE) For some reason, the trial column is not matched to the subject and order information, despite them being identified as key-variables for the merge. (The same is true for other variables, the actual dataset has more variables and trials, but this is essentially the problem.) So it results in something like: subject order bpm trial agegroup gender 1 1 70.2 3 2 1 1 1 69.5 2 2 1 1 1 68.8 1 2 1 What could be my mistake? Thank you VERY much. Miriam -- -- From gjones at sou.edu Sun Dec 4 15:27:30 2011 From: gjones at sou.edu (gvjones) Date: Sun, 4 Dec 2011 06:27:30 -0800 (PST) Subject: [R] Programming Statistical Functions In-Reply-To: <1280490786119-2307880.post@n4.nabble.com> References: <1280490786119-2307880.post@n4.nabble.com> Message-ID: <1323008850451-4157012.post@n4.nabble.com> Hello, Did you find anything helpful for calculating the statistical functions in your list. I would like to also calculate these and have been looking for some code to do so. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Programming-Statistical-Functions-tp2307880p4157012.html Sent from the R help mailing list archive at Nabble.com. From svezakal at gmail.com Sun Dec 4 15:52:13 2011 From: svezakal at gmail.com (e eeyore) Date: Sun, 4 Dec 2011 15:52:13 +0100 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Sun Dec 4 16:30:02 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Sun, 04 Dec 2011 16:30:02 +0100 Subject: [R] Vectorization instead of loops problem In-Reply-To: References: Message-ID: <4EDB91FA.1030200@statistik.tu-dortmund.de> On 04.12.2011 16:18, Costas Vorlow wrote: > Hello, > > I am having problems vectorizing the following (i/o using a for/next/while > loop): > > I have 2 sequences such as: > > x, y > 1, 30 > 2, -40 > 0, 50 > 0, 25 > 1, -5 > 2, -10 > 1, 5 > 0, 40 > > etc etc > > The first sequence (x) takes integer numbers only: 0, 1, 2 > The sequence y can be anything... > > I want to be able to retrieve (in a list if possible) the 3 last values of > the y sequence before a value of 1 is encountered on the x sequence, i.e: > > On line 5 in the above dataset, x is 1 so I need to capture values: 25, 50 > and -40 of the y sequence. > > So the outcome (if a list) should look something like: > > [1],[25,50,-40] > [2],[-10,-5,25] # as member #7 of x sequence is 1... > > etc. etc. > > Can I do the above avoiding for/next or while loops? > I am not sure I can explain it better. Any help/pointer extremely welcome. > > Best regards, > Costas > > One way is (assuming your data is in a data.frame called dat): wx <- which(dat$x==1) result <- lapply(wx[wx > 3], function(x) dat$y[x - (1:3)]) (where lapply is a loop, implicitly). Uwe Ligges From costas.vorlow at gmail.com Sun Dec 4 16:32:50 2011 From: costas.vorlow at gmail.com (Costas Vorlow) Date: Sun, 4 Dec 2011 17:32:50 +0200 Subject: [R] Vectorization instead of loops problem In-Reply-To: <4EDB91FA.1030200@statistik.tu-dortmund.de> References: <4EDB91FA.1030200@statistik.tu-dortmund.de> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Sun Dec 4 16:36:16 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Sun, 4 Dec 2011 10:36:16 -0500 Subject: [R] Extract last 3 characters from numeric vector In-Reply-To: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> References: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> Message-ID: You can use nchar() to get the length of the string, and use that in substring: mynum <- as.character(15.6) > substring(mynum, nchar(mynum)-2, nchar(mynum)) [1] "5.6" On Sun, Dec 4, 2011 at 8:38 AM, Kang Min wrote: > Hi all, > > I have a numeric vector with 1 decimal place, and I'd like to extract > the last 3 characters, including the decimal point. The vector ranges > from 0 to 20. > > x <- round(runif(100)*20, digits=1) > > Some of numbers have 3 characters, and some have 4. I've read up on > the substr() function but that extracts characters based on exact > positions. How can I extract just the last 3 characters no matter the > length of the number? e.g. from 16.7 I want 6.7, from 3.5 I want 3.5 > as it is. > > Thanks, > Kang Min > -- Sarah Goslee http://www.functionaldiversity.org From kindlychung at gmail.com Sun Dec 4 16:36:00 2011 From: kindlychung at gmail.com (Kaiyin Zhong) Date: Sun, 4 Dec 2011 23:36:00 +0800 Subject: [R] Complex multiple t tests in a data frame with several id factors Message-ID: I have assayed the concentrations of various metal elements in different anatomic regions of two strains of mice. Now, for each element, in each region, I want to do a t test to find whether there is any difference between the two strains. Here is what I did (using simulated data as an example): # create the data frame > elemconc = data.frame(expand.grid(id=1:3, geno=c('exp', 'wt'), region=c('brain', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(36, 10)) > elemconc id geno region elem conc 1 1 exp brain fe 8.497498 2 2 exp brain fe 9.280944 3 3 exp brain fe 9.726271 4 1 wt brain fe 11.556397 5 2 wt brain fe 10.992550 6 3 wt brain fe 9.711200 7 1 exp spine fe 11.168603 8 2 exp spine fe 9.331127 9 3 exp spine fe 11.048226 10 1 wt spine fe 8.480867 11 2 wt spine fe 8.887062 12 3 wt spine fe 8.329797 13 1 exp brain cu 10.242652 14 2 exp brain cu 9.865984 15 3 exp brain cu 9.163728 16 1 wt brain cu 11.099385 17 2 wt brain cu 9.364261 18 3 wt brain cu 9.718322 19 1 exp spine cu 10.720157 20 2 exp spine cu 11.505430 21 3 exp spine cu 9.499359 22 1 wt spine cu 9.855950 23 2 wt spine cu 10.120489 24 3 wt spine cu 9.526252 25 1 exp brain zn 9.736196 26 2 exp brain zn 11.938710 27 3 exp brain zn 9.668625 28 1 wt brain zn 9.961574 29 2 wt brain zn 10.461621 30 3 wt brain zn 9.873667 31 1 exp spine zn 9.708067 32 2 exp spine zn 10.109309 33 3 exp spine zn 10.973387 34 1 wt spine zn 8.406536 35 2 wt spine zn 7.797746 36 3 wt spine zn 11.127984 # use tapply to aggregate > tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) x) region elem brain spine fe Numeric,6 Numeric,6 cu Numeric,6 Numeric,6 zn Numeric,6 Numeric,6 # check whether the order of data has been preserved after aggregation > x['fe', 'brain'] [[1]] [1] 8.497498 9.280944 9.726271 11.556397 10.992550 9.711200 # create an external factor for strain grouping > tmpgeno = rep(c('exp', 'wt'), each=3) > tmpgeno [1] "exp" "exp" "exp" "wt" "wt" "wt" # do the t test using the grouping factor > x = tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) t.test(x~tmpgeno) ) > x region elem brain spine fe List,9 List,9 cu List,9 List,9 zn List,9 List,9 I believe I have made no mistakes so far, but I wonder is there a better way of doing this? -- Kaiyin Zhong ------------------------------------------------------------------------------------------------------------------ Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038 From ggrothendieck at gmail.com Sun Dec 4 16:41:14 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Sun, 4 Dec 2011 10:41:14 -0500 Subject: [R] Vectorization instead of loops problem In-Reply-To: References: Message-ID: On Sun, Dec 4, 2011 at 10:18 AM, Costas Vorlow wrote: > Hello, > > I am having problems vectorizing the following (i/o using a for/next/while > loop): > > I have 2 sequences such as: > > x, y > 1, 30 > 2, -40 > 0, 50 > 0, 25 > 1, -5 > 2, -10 > 1, 5 > 0, 40 > > etc etc > > The first sequence (x) takes integer numbers only: 0, 1, 2 > The sequence y can be anything... > > I want to be able to retrieve (in a list if possible) the 3 last values of > the y sequence before a value of 1 is encountered on the x sequence, i.e: > > On line 5 in the above dataset, x is 1 so I need to capture values: 25, 50 > and -40 of the y sequence. > > So the outcome (if a list) should look something like: > > [1],[25,50,-40] > [2],[-10,-5,25] # as member #7 of x sequence is 1... > > etc. etc. > > Can I do the above avoiding for/next or while loops? > I am not sure I can explain it better. Any help/pointer extremely welcome. Try this. embed(z, 4) places values 1,2,3,4 of vector z in the first row, values 2,3,4,5 in the second row and so on so we want the rows of embed(y, 4) for which embed(x, 4) is 1, i.e we want rows of embed(y, 4) for which embed(x, 4)[,1]==1, except the first column can be suppressed (-1). > embed(y, 4)[embed(x, 4)[, 1] == 1, -1] [,1] [,2] [,3] [1,] 25 50 -40 [2,] -10 -5 25 -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From ligges at statistik.tu-dortmund.de Sun Dec 4 16:42:48 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Sun, 04 Dec 2011 16:42:48 +0100 Subject: [R] Extract last 3 characters from numeric vector In-Reply-To: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> References: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> Message-ID: <4EDB94F8.1040100@statistik.tu-dortmund.de> On 04.12.2011 14:38, Kang Min wrote: > Hi all, > > I have a numeric vector with 1 decimal place, and I'd like to extract > the last 3 characters, including the decimal point. The vector ranges > from 0 to 20. > > x<- round(runif(100)*20, digits=1) formatC(round(x%%10, 1), format="f", digits=1) Uwe Ligges > Some of numbers have 3 characters, and some have 4. I've read up on > the substr() function but that extracts characters based on exact > positions. How can I extract just the last 3 characters no matter the > length of the number? e.g. from 16.7 I want 6.7, from 3.5 I want 3.5 > as it is. > > Thanks, > Kang Min > > ______________________________________________ > R-help at 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 code. From gunter.berton at gene.com Sun Dec 4 16:45:57 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Sun, 4 Dec 2011 07:45:57 -0800 Subject: [R] Vectorization instead of loops problem In-Reply-To: References: Message-ID: Costas: (and thanks for giving us your name) which(x == 1) gives you the indices where x is 1 (up to floating point equality -- you did not specify whether your x values are integers or calculated as floating point, and that certainly makes a difference). You can then use simple indexing to get the y values. No loops needed. However, let's explore why your question may have been too poorly formed to get the answer you seek: 1. What if the index of the first 1 is 3 or less? -- Do you want to ignore the (less than 3) preceding values or just choose as many as you can? 2. What if, as in your example, several 1's occur in x. Do you want the 3 preceding values for all of them or just the first? 3. If the answer to 2 is "all of them," what if several 1's are less than 3 indices apart -- do you want to include the overlapping sets of 3 y's -- or what? My point is that "etc. etc." is simply inadequate as a coherent or useful problem description in your post. You _must_ be explicit, complete, and concise. This can be hard. Indeed, it may require considerable thought and effort. I have found -- and others have often noted here -- that going through such an exercise itself often reveals a solution. But be that as it may, the Posting Guide is actually an excellent, comprehensive discussion of how to ask good questions in forums like this. Read it. Follow it. ... and to be fair, your post below is, imho, probably above average as posts go, allowing me to focus on specific points that I thought required clarification. Quite a few posts here of late have been so muddled and incoherent that I had no clue what the OP wanted. And it's not English as a second language. I am a language ignoramus and speak only English, so I am happy to tolerate poor grammar and vocabulary from someone for whom English is only one of several languages in which they can communicate. The problem is poor thinking, not poor English. Best, Bert On Sun, Dec 4, 2011 at 7:18 AM, Costas Vorlow wrote: > Hello, > > I am having problems vectorizing the following (i/o using a for/next/while > loop): > > I have 2 sequences such as: > > x, y > 1, 30 > 2, -40 > 0, 50 > 0, 25 > 1, -5 > 2, -10 > 1, 5 > 0, 40 > > etc etc > > The first sequence (x) takes integer numbers only: 0, 1, 2 > The sequence y can be anything... > > I want to be able to retrieve (in a list if possible) the 3 last values of > the y sequence before a value of 1 is encountered on the x sequence, i.e: > > On line 5 in the above dataset, x is 1 so I need to capture values: 25, 50 > and -40 of the y sequence. > > So the outcome (if a list) should look something like: > > [1],[25,50,-40] > [2],[-10,-5,25] # as member #7 of x sequence is 1... > > etc. etc. > > Can I do the above avoiding for/next or while loops? > I am not sure I can explain it better. Any help/pointer extremely welcome. > > Best regards, > Costas > > > -- > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > |c|o|s|t|a|s|@|v|o|r|l|o|w|.|o|r|g| > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From dwinsemius at comcast.net Sun Dec 4 16:47:48 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sun, 4 Dec 2011 10:47:48 -0500 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bbolker at gmail.com Sun Dec 4 16:50:41 2011 From: bbolker at gmail.com (Ben Bolker) Date: Sun, 4 Dec 2011 15:50:41 +0000 Subject: [R] Logistic Regression with genetic component References: Message-ID: Danielle Duncan alaska.edu> writes: > Greetings, I have a question that I'd like to get input on. I have a > classic toxicology study where I artificially fertilized and exposed > embryos to a chemical and counted defects. In addition, I kept track of > male-female pairs that I used to artificially fertilize and generate > embryos with. I need to use logistic regression to model the response, but > also check that the genetics of the pairings did or did not have an effect > on the response. My data looks a bit like this: > > response matrix chemical concentration Genetic Matrix > Present Absent Male Female > 2 152 0.13 a 1 > 6 121 1 a 2 > 21 92 2 b 3 > 24 89 5 b 4 > 0 141 10 c 5 > 5 95 15 c 6 > > R code: > > DA<-cbind(Present, Absent) > glm<-(DA ~ chemical concentration) > > If I do glm<-(DA ~ chemical concentration + Male + Female, I get every > possible combination, but I only want specific pairs. So, I am thinking > about doing: > > MF<-cbind(Male, Female) > glm<-(DA ~ chemical concentration + MF) You're on the right track. paste() is probably what you want, although you can also use interaction() to get the interactions and then droplevels() to get rid of the unobserved crosses. d <- read.table(textConnection(" Present Absent conc Male Female 2 152 0.13 a 1 6 121 1 a 2 21 92 2 b 3 24 89 5 b 4 0 141 10 c 5 5 95 15 c 6"), header=TRUE) Either of these should give you what you want: d <- droplevels(transform(d,cross=interaction(Male,Female))) levels(d$cross) d <- transform(d,cross=paste(Male,Female,sep=".")) levels(d$cross) You should be a little careful -- if each cross is exposed only to a single concentration, and if you treat cross as a fixed effect, you will overparameterize your model. If you treat it as a random effect, e.g. using glmer in the lme4 package: glmer(cbind(Present,Absent)~conc+(1|cross),data=d) you will effectively be fitting a model for overdispersion (see the example in ?cbpp). From gunter.berton at gene.com Sun Dec 4 17:01:43 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Sun, 4 Dec 2011 08:01:43 -0800 Subject: [R] Complex multiple t tests in a data frame with several id factors In-Reply-To: References: Message-ID: The concentrations of the different metals within an animal are correlated, so that doing as you suggest will almost certainly result in nonsense P values. So I suggest you seek local statistical help or, failing that, post on a statistical forum like stats.stackexchange.com . There are various multivariate packages -- check e.g. the ChemPhys and Multivariate task views -- that may be pertinent, but your post suggests that you probably need some help to use them. Ergo my suggestion above. Cheers, Bert On Sun, Dec 4, 2011 at 7:36 AM, Kaiyin Zhong wrote: > I have assayed the concentrations of various metal elements in > different anatomic regions of two strains of mice. Now, for each > element, in each region, I want to do a t test to find whether there > is any difference between the two strains. > > Here is what I did (using simulated data as an example): > > # create the data frame >> elemconc = data.frame(expand.grid(id=1:3, geno=c('exp', 'wt'), region=c('brain', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(36, 10)) >> elemconc > ? id geno region elem ? ? ?conc > 1 ? 1 ?exp ?brain ? fe ?8.497498 > 2 ? 2 ?exp ?brain ? fe ?9.280944 > 3 ? 3 ?exp ?brain ? fe ?9.726271 > 4 ? 1 ? wt ?brain ? fe 11.556397 > 5 ? 2 ? wt ?brain ? fe 10.992550 > 6 ? 3 ? wt ?brain ? fe ?9.711200 > 7 ? 1 ?exp ?spine ? fe 11.168603 > 8 ? 2 ?exp ?spine ? fe ?9.331127 > 9 ? 3 ?exp ?spine ? fe 11.048226 > 10 ?1 ? wt ?spine ? fe ?8.480867 > 11 ?2 ? wt ?spine ? fe ?8.887062 > 12 ?3 ? wt ?spine ? fe ?8.329797 > 13 ?1 ?exp ?brain ? cu 10.242652 > 14 ?2 ?exp ?brain ? cu ?9.865984 > 15 ?3 ?exp ?brain ? cu ?9.163728 > 16 ?1 ? wt ?brain ? cu 11.099385 > 17 ?2 ? wt ?brain ? cu ?9.364261 > 18 ?3 ? wt ?brain ? cu ?9.718322 > 19 ?1 ?exp ?spine ? cu 10.720157 > 20 ?2 ?exp ?spine ? cu 11.505430 > 21 ?3 ?exp ?spine ? cu ?9.499359 > 22 ?1 ? wt ?spine ? cu ?9.855950 > 23 ?2 ? wt ?spine ? cu 10.120489 > 24 ?3 ? wt ?spine ? cu ?9.526252 > 25 ?1 ?exp ?brain ? zn ?9.736196 > 26 ?2 ?exp ?brain ? zn 11.938710 > 27 ?3 ?exp ?brain ? zn ?9.668625 > 28 ?1 ? wt ?brain ? zn ?9.961574 > 29 ?2 ? wt ?brain ? zn 10.461621 > 30 ?3 ? wt ?brain ? zn ?9.873667 > 31 ?1 ?exp ?spine ? zn ?9.708067 > 32 ?2 ?exp ?spine ? zn 10.109309 > 33 ?3 ?exp ?spine ? zn 10.973387 > 34 ?1 ? wt ?spine ? zn ?8.406536 > 35 ?2 ? wt ?spine ? zn ?7.797746 > 36 ?3 ? wt ?spine ? zn 11.127984 > > # use tapply to aggregate >> tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) x) > ? ?region > elem brain ? ? spine > ?fe Numeric,6 Numeric,6 > ?cu Numeric,6 Numeric,6 > ?zn Numeric,6 Numeric,6 > > # check whether the order of data has been preserved after aggregation >> x['fe', 'brain'] > [[1]] > [1] ?8.497498 ?9.280944 ?9.726271 11.556397 10.992550 ?9.711200 > > # create an external factor for strain grouping >> tmpgeno = rep(c('exp', 'wt'), each=3) >> tmpgeno > [1] "exp" "exp" "exp" "wt" ?"wt" ?"wt" > > # do the t test using the grouping factor >> x = tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) t.test(x~tmpgeno) ) >> x > ? ?region > elem brain ?spine > ?fe List,9 List,9 > ?cu List,9 List,9 > ?zn List,9 List,9 > > I believe I have made no mistakes so far, but I wonder is there a > better way of doing this? > > > -- > Kaiyin Zhong > ------------------------------------------------------------------------------------------------------------------ > Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038 > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From svezakal at gmail.com Sun Dec 4 17:04:07 2011 From: svezakal at gmail.com (e eeyore) Date: Sun, 4 Dec 2011 17:04:07 +0100 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kindlychung at gmail.com Sun Dec 4 17:06:41 2011 From: kindlychung at gmail.com (Kaiyin Zhong) Date: Mon, 5 Dec 2011 00:06:41 +0800 Subject: [R] Complex multiple t tests in a data frame with several id factors In-Reply-To: References: Message-ID: Okay, thank you. On Mon, Dec 5, 2011 at 12:01 AM, Bert Gunter wrote: > The concentrations of the different metals within an animal are > correlated, so that doing as you suggest will almost certainly result > in nonsense P values. So I suggest you seek local statistical help or, > failing that, post on a statistical forum like stats.stackexchange.com > ?. > > There are ?various multivariate packages -- check e.g. the ChemPhys > and Multivariate task views -- that may be pertinent, but your post > suggests that you probably need some help to use them. Ergo my > suggestion above. > > Cheers, > Bert > > On Sun, Dec 4, 2011 at 7:36 AM, Kaiyin Zhong wrote: >> I have assayed the concentrations of various metal elements in >> different anatomic regions of two strains of mice. Now, for each >> element, in each region, I want to do a t test to find whether there >> is any difference between the two strains. >> >> Here is what I did (using simulated data as an example): >> >> # create the data frame >>> elemconc = data.frame(expand.grid(id=1:3, geno=c('exp', 'wt'), region=c('brain', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(36, 10)) >>> elemconc >> ? id geno region elem ? ? ?conc >> 1 ? 1 ?exp ?brain ? fe ?8.497498 >> 2 ? 2 ?exp ?brain ? fe ?9.280944 >> 3 ? 3 ?exp ?brain ? fe ?9.726271 >> 4 ? 1 ? wt ?brain ? fe 11.556397 >> 5 ? 2 ? wt ?brain ? fe 10.992550 >> 6 ? 3 ? wt ?brain ? fe ?9.711200 >> 7 ? 1 ?exp ?spine ? fe 11.168603 >> 8 ? 2 ?exp ?spine ? fe ?9.331127 >> 9 ? 3 ?exp ?spine ? fe 11.048226 >> 10 ?1 ? wt ?spine ? fe ?8.480867 >> 11 ?2 ? wt ?spine ? fe ?8.887062 >> 12 ?3 ? wt ?spine ? fe ?8.329797 >> 13 ?1 ?exp ?brain ? cu 10.242652 >> 14 ?2 ?exp ?brain ? cu ?9.865984 >> 15 ?3 ?exp ?brain ? cu ?9.163728 >> 16 ?1 ? wt ?brain ? cu 11.099385 >> 17 ?2 ? wt ?brain ? cu ?9.364261 >> 18 ?3 ? wt ?brain ? cu ?9.718322 >> 19 ?1 ?exp ?spine ? cu 10.720157 >> 20 ?2 ?exp ?spine ? cu 11.505430 >> 21 ?3 ?exp ?spine ? cu ?9.499359 >> 22 ?1 ? wt ?spine ? cu ?9.855950 >> 23 ?2 ? wt ?spine ? cu 10.120489 >> 24 ?3 ? wt ?spine ? cu ?9.526252 >> 25 ?1 ?exp ?brain ? zn ?9.736196 >> 26 ?2 ?exp ?brain ? zn 11.938710 >> 27 ?3 ?exp ?brain ? zn ?9.668625 >> 28 ?1 ? wt ?brain ? zn ?9.961574 >> 29 ?2 ? wt ?brain ? zn 10.461621 >> 30 ?3 ? wt ?brain ? zn ?9.873667 >> 31 ?1 ?exp ?spine ? zn ?9.708067 >> 32 ?2 ?exp ?spine ? zn 10.109309 >> 33 ?3 ?exp ?spine ? zn 10.973387 >> 34 ?1 ? wt ?spine ? zn ?8.406536 >> 35 ?2 ? wt ?spine ? zn ?7.797746 >> 36 ?3 ? wt ?spine ? zn 11.127984 >> >> # use tapply to aggregate >>> tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) x) >> ? ?region >> elem brain ? ? spine >> ?fe Numeric,6 Numeric,6 >> ?cu Numeric,6 Numeric,6 >> ?zn Numeric,6 Numeric,6 >> >> # check whether the order of data has been preserved after aggregation >>> x['fe', 'brain'] >> [[1]] >> [1] ?8.497498 ?9.280944 ?9.726271 11.556397 10.992550 ?9.711200 >> >> # create an external factor for strain grouping >>> tmpgeno = rep(c('exp', 'wt'), each=3) >>> tmpgeno >> [1] "exp" "exp" "exp" "wt" ?"wt" ?"wt" >> >> # do the t test using the grouping factor >>> x = tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) t.test(x~tmpgeno) ) >>> x >> ? ?region >> elem brain ?spine >> ?fe List,9 List,9 >> ?cu List,9 List,9 >> ?zn List,9 List,9 >> >> I believe I have made no mistakes so far, but I wonder is there a >> better way of doing this? >> >> >> -- >> Kaiyin Zhong >> ------------------------------------------------------------------------------------------------------------------ >> Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038 >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm -- Kaiyin Zhong ------------------------------------------------------------------------------------------------------------------ Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038 From dwinsemius at comcast.net Sun Dec 4 17:07:04 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sun, 4 Dec 2011 11:07:04 -0500 Subject: [R] Programming Statistical Functions In-Reply-To: <1323008850451-4157012.post@n4.nabble.com> References: <1280490786119-2307880.post@n4.nabble.com> <1323008850451-4157012.post@n4.nabble.com> Message-ID: <4087A7AF-278C-45EE-9FDB-6613A711711B@comcast.net> On Dec 4, 2011, at 9:27 AM, gvjones wrote: > Hello, > > Did you find anything helpful for calculating the statistical > functions in > your list. I would like to also calculate these and have been > looking for > some code to do so. > A search at the site linked by the R function RSiteSearch() produces two (or more) candidate packages. Rather than naming them, I think it good exercise to do the looking and judging by yourself: http://search.r-project.org/cgi-bin/namazu.cgi?query=meteorology&max=100&result=normal&sort=score&idxname=functions&idxname=Rhelp08&idxname=Rhelp10&idxname=Rhelp02 -- David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Sun Dec 4 17:15:36 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Sun, 4 Dec 2011 11:15:36 -0500 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From shyamabc2002 at yahoo.com Sun Dec 4 17:22:03 2011 From: shyamabc2002 at yahoo.com (shyam basnet) Date: Sun, 4 Dec 2011 08:22:03 -0800 (PST) Subject: [R] prediction in "conmode" class of Nonparametric binary models Message-ID: <1323015723.35294.YahooMailNeo@web161705.mail.bf1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From svezakal at gmail.com Sun Dec 4 17:23:26 2011 From: svezakal at gmail.com (e eeyore) Date: Sun, 4 Dec 2011 17:23:26 +0100 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From janko.thyson.rstuff at googlemail.com Sun Dec 4 17:32:25 2011 From: janko.thyson.rstuff at googlemail.com (Janko Thyson) Date: Sun, 04 Dec 2011 17:32:25 +0100 Subject: [R] How to write (complex) coercion methods or "what's the reason to limit 'setAs()' the way it is limited"? Message-ID: <4EDBA099.6040306@googlemail.com> Dear list, I'd like to write coercion methods for some of my Reference Classes. However, using 'setAs()' is not a real option as its argument 'def' only allows for functions depending on one single argument. In some cases, that is simply too much of a limitation for me. And I don't really see why it needs to be this way, so I guess this question is also some sort of a feature request to make 'setAs' a bit more flexible (in case anyone from the Core Team is listening ;-)) A reproducible example can be found here: http://stackoverflow.com/questions/8346654/how-to-write-coercion-methods Thanks a lot for any replies! Janko From jorgeivanvelez at gmail.com Sun Dec 4 17:46:32 2011 From: jorgeivanvelez at gmail.com (Jorge I Velez) Date: Sun, 4 Dec 2011 11:46:32 -0500 Subject: [R] upper bound in the integrate function depends on a parameter In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Sun Dec 4 18:23:36 2011 From: bps0002 at auburn.edu (B77S) Date: Sun, 4 Dec 2011 09:23:36 -0800 (PST) Subject: [R] problem merging data with different shapes In-Reply-To: <20111204140218.183110@gmx.net> References: <20111204140218.183110@gmx.net> Message-ID: <1323019416195-4157442.post@n4.nabble.com> Please use dput() to post your example data sets. dput(Adata) dput(Bdata) **then copy and paste the results of each so that we can "play" around with it easily. Miriam -2 wrote > > I have been trying to merge datasets, one of which has a long format > (Adata) and one has a (different) long format (Bdata): > > Adata Bdata > subject order bpm subject order trial agegroup gender > 1 1 70.2 1 1 3 2 1 > 1 1 69.5 1 2 1 2 1 > 1 1 68.8 1 3 2 2 1 > 1 2 69.1 2 1 2 1 2 > 1 2 70 2 2 3 1 2 > 1 2 70.5 2 3 1 1 2 > 1 3 70.2 ... > 1 3 > 1 3 > 2 1 > 2 1 > ... ... > > In the end I would like to have a dataset that contains A unchanged with > the additional information from B added. > > subject order bpm trial agegroup gender > 1 1 70.2 3 2 1 > 1 1 69.5 3 2 1 > 1 1 68.8 3 2 1 > ... > I have tried: > newdataframe <- merge(Adata,Bdata, by= c("subject", "order"), sort = > FALSE) > > For some reason, the trial column is not matched to the subject and order > information, despite them being identified as key-variables for the merge. > (The same is true for other variables, the actual dataset has more > variables and trials, but this is essentially the problem.) > So it results in something like: > subject order bpm trial agegroup gender > 1 1 70.2 3 2 1 > 1 1 69.5 2 2 1 > 1 1 68.8 1 2 1 > > What could be my mistake? > > Thank you VERY much. > Miriam > > > -- > > > > > -- > > ______________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/problem-merging-data-with-different-shapes-tp4157137p4157442.html Sent from the R help mailing list archive at Nabble.com. From GodinA at Dal.Ca Sun Dec 4 18:37:54 2011 From: GodinA at Dal.Ca (Aurelie Cosandey Godin) Date: Sun, 4 Dec 2011 13:37:54 -0400 Subject: [R] Polishing my geom_bar for publication In-Reply-To: References: <4E7779FE.7080203@gmail.com> <4E787B7B.2010900@gmail.com> <3467C1A6-020E-4E84-A456-C9BF8B964E8A@Dal.Ca> Message-ID: <05E468B5-55D6-4A71-99A3-2603DBF31893@Dal.Ca> Sorry Dennis, Didn't realized I went off the list! I found a solution for one of my problem: removing x-axis label! with this code: ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE+wpue.se), size=.3,width=.2,position=position_dodge(.9)) + scale_x_discrete("", breaks=c("102","90","91","94","96"), labels= rep("", 5)) + ylab("Biomass (Weight (kg)/tow)") + scale_fill_grey(name="Survey season", breaks=c("summer", "winter"), labels=c("Spring", "Fall"))+ coord_flip() + theme_bw() + opts(axis.title.x = theme_text(size = 10), panel.grid.minor = theme_blank()) However, I am still trying to figure out how to fix the width of my two plots on my final pdf. I would appreciate any help on this! Thank you. On 2011-12-04, at 12:59 PM, Aurelie Cosandey Godin wrote: > Thank you Denis, > > I changed my code as you suggested, however the "xlab" didn't work & I tried something else (see below my new code), but I still get my labels for my x-axis (coord_flip) in my b figure ("spp" 96, 94, 91, etc...). See figure below. > To answer your question, I would like that both of my figure a & b have the same width on the final pdf. Right now they aren't because of the legend. >> >> and (3) fix the width, such that both figures >>> have the same appearance regardless of the legend. >> >> I'm afraid I don't understand clearly what you mean my 'same >> appearance'. Could you provide a reproducible example, which includes >> (possibly fake) data as well as code? > > > > Here's my new code: > > (a<- ggplot(Final2, aes(x=spp, y=CPUE, fill=season)) + > geom_bar(position=position_dodge()) + > geom_errorbar(aes(ymin=CPUE-cpue.se, ymax=CPUE+cpue.se), > size=.3, width=.2, > position=position_dodge(.9)) + scale_x_discrete("Species", > breaks=c("102","90","91","94","96"), > labels=c("SPINYTAIL","THORNY","SMOOTH","DEEPWATER","JENSEN'S")) + ylab("Abundance (fish/tow)") + coord_flip() + > scale_fill_grey() + theme_bw() + opts(axis.title.x = > theme_text(size = 10), panel.grid.minor = theme_blank(), > legend.position='none') ) > > ##I added scale_x_discrete(NULL, breaks=c("102","90","91","94","96"), labels= rep(NULL, 5)) thinking that this would be able to remove my x-axis label (coord_flip) but it didn't... any other ideas of how I can achieve this? > > (b<- ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE+wpue.se), size=.3,width=.2,position=position_dodge(.9)) + scale_x_discrete(NULL, breaks=c("102","90","91","94","96"), labels= rep(NULL, 5)) + ylab("Biomass (Weight (kg)/tow)") + scale_fill_grey(name="Survey season", breaks=c("summer", "winter"), labels=c("Spring", "Fall"))+ coord_flip() + theme_bw() + opts(axis.title.x = theme_text(size = 10), panel.grid.minor = theme_blank()) ) > > pdf("polishing-layout3.pdf", width = 10, height = 6) > grid.newpage() > pushViewport(viewport(layout = grid.layout(1, 2))) > vplayout <- function(x, y) > viewport(layout.pos.row = x, layout.pos.col = y) > print(a, vp = vplayout(1, 1)) > print(b, vp = vplayout(1, 2)) > dev.off() > > > > Thank you very much! > Aurelie > > On 2011-12-04, at 11:33 AM, Dennis Murphy wrote: > >> Hi: >> >> On Sun, Dec 4, 2011 at 5:21 AM, Aurelie Cosandey Godin wrote: >>> Dear list, >>> >>> I am new with ggplot2 and I have spend quiet some time putting together the >>> following code to create the attached plot. However there's still a few >>> things that I'm having trouble with! >>> I would be grateful if someone can tell me how to fix (1) the colour of my >>> bars into grey scales >> >> One way is to provide greyscale values to scale_fill_discrete; e.g., >> values = c("grey50","grey20") >> >>> (2) removing the y-axis (species name) on the right >>> figure to avoid duplication, >> >> In the second figure, insert either >> ylab("") >> or if you have a labs() statement that defines several titles at once, >> labs(..., y = "", ...) >> >> and (3) fix the width, such that both figures >>> have the same appearance regardless of the legend. >> >> I'm afraid I don't understand clearly what you mean my 'same >> appearance'. Could you provide a reproducible example, which includes >> (possibly fake) data as well as code? >> >> Dennis >>> >>> Thank you very much in advance! >>> >>> -- >>> You received this message because you are subscribed to the ggplot2 mailing >>> list. >>> Please provide a reproducible example: http://gist.github.com/270442 >>> >>> To post: email ggplot2 at googlegroups.com >>> To unsubscribe: email ggplot2+unsubscribe at googlegroups.com >>> More options: http://groups.google.com/group/ggplot2 >>> >>> >>> The code is as follow: >>> >>> >>> (a<-ggplot(Final2, aes(x=spp, y=CPUE, fill=season)) + >>> geom_bar(position=position_dodge()) + >>> geom_errorbar(aes(ymin=CPUE-cpue.se, ymax=CPUE+cpue.se), >>> size=.3, >>> width=.2, >>> position=position_dodge(.9)) + >>> xlab("Species") + >>> scale_x_discrete(breaks=c("100","102","107","88","90","91","92","93","94","96","98","99"), >>> labels=c("WINTER","SPINYTAIL","BIGELOW'S","SKATES >>> (NS)","THORNY","SMOOTH","ABYSSAL","LITTLE","DEEPWATER","JENSEN'S","WHITE","SOFT")) >>> + >>> ylab("Abundance (fish/tow)") + coord_flip() + >>> theme_bw() + opts(axis.title.x = theme_text(size = 10)) + >>> opts(panel.grid.minor = theme_blank()) + opts(legend.position='none') ) >>> >>> (b<-ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + >>> geom_bar(position=position_dodge()) + >>> geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE+wpue.se), >>> size=.3, >>> width=.2, >>> position=position_dodge(.9)) + xlab(NULL)+ >>> scale_x_discrete(breaks=c("100","102","107","88","90","91","92","93","94","96","98","99"), >>> labels=c("WINTER","SPINYTAIL","BIGELOW'S","SKATES >>> (NS)","THORNY","SMOOTH","ABYSSAL","LITTLE","DEEPWATER","JENSEN'S","WHITE","SOFT"))+ >>> ylab("Biomass (Weight (kg)/tow)") + scale_fill_hue(name="Survey season", >>> # Legend label, use darker colors >>> breaks=c("summer", "winter"), >>> labels=c("Spring", "Fall")) + coord_flip() + >>> theme_bw() + opts(axis.title.x = theme_text(size = 10)) + >>> opts(panel.grid.minor = theme_blank())) >>> >>> pdf("polishing-layout2.pdf", width = 10, height = 6) >>> grid.newpage() >>> pushViewport(viewport(layout = grid.layout(1, 2))) >>> vplayout <- function(x, y) >>> viewport(layout.pos.row = x, layout.pos.col = y) >>> print(a, vp = vplayout(1, 1)) >>> print(b, vp = vplayout(1, 2)) >>> dev.off() >>> >>> >>> Aurelie Cosandey-Godin >>> Ph.D. student, Department of Biology >>> Industrial Graduate Fellow, WWF-Canada >>> >>> Dalhousie University | Biology Dept. | 1459 Oxford Street | >>> Halifax, NS | >>> Canada >>> B3H 4R2 >>> >>> Phone: 1-902-494-2478 | >>> cell: 1-902-412-3404 | >>> Fax: 1-902-494-3736 >>> Email: godina at dal.ca | Skype: aureliegodinco | >>> Web: wormlab.biology.dal.ca >>> ---------------------------------------------------------------------------------------------------------------------------------------------------- >>> Want to learn more about sharks in Atlantic Canada? Visit >>> ShARCC! www.atlanticsharks.org >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the ggplot2 mailing list. >> Please provide a reproducible example: http://gist.github.com/270442 >> >> To post: email ggplot2 at googlegroups.com >> To unsubscribe: email ggplot2+unsubscribe at googlegroups.com >> More options: http://groups.google.com/group/ggplot2 >> > From bps0002 at auburn.edu Sun Dec 4 18:55:13 2011 From: bps0002 at auburn.edu (B77S) Date: Sun, 4 Dec 2011 09:55:13 -0800 (PST) Subject: [R] Export cols to single csv files In-Reply-To: <1323020175364-4157484.post@n4.nabble.com> References: <1323020175364-4157484.post@n4.nabble.com> Message-ID: <1323021313888-4157537.post@n4.nabble.com> just use indexing. without doing it all for you... df <- structure(list(AA = c(0.3, 0.1, 0.6), BB = c(0.9, 0.4, 0.2), CC = c(1, 0.8, 0.6), DD = c(0.7, 0.5, 0.5)), .Names = c("AA", "BB", "CC", "DD"), class = "data.frame", row.names = c(NA, -3L )) write.csv(df[,1], paste(colnames(df[1]), "csv", sep=".")) Chega wrote > > Hi > > I am trying to "batch export" the columns of a numeric matrix to separate > csv files by naming them according to the column names. > > So my matrix in R looks like this: > AA BB CC DD etc. > 1: 0.3 0.9 1.0 0.7 ... > 2: 0.1 0.4 0.8 0.5 ... > 3: 0.6 0.2 0.6 0.5 ... > etc. > > Now I am looking for a way to get these files (file names in quotes): > > "AA.csv" "BB.csv" "CC.csv" etc. > 1: 0.3 1: 0.9 1: 1.0 > 2: 0.1 2: 0.4 2: 0.8 > 3: 0.6 3: 0.2 3: 0.6 > etc. etc. etc. > > As I understand this may be done using write.csv and a loop with the > column names, but I have no idea how to export single columns. > > Thanks i.a. for help! > Chega > -- View this message in context: http://r.789695.n4.nabble.com/Export-cols-to-single-csv-files-tp4157484p4157537.html Sent from the R help mailing list archive at Nabble.com. From costas.vorlow at gmail.com Sun Dec 4 19:29:25 2011 From: costas.vorlow at gmail.com (Costas Vorlow) Date: Sun, 4 Dec 2011 20:29:25 +0200 Subject: [R] Vectorization instead of loops problem In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From vamshi999 at gmail.com Sun Dec 4 19:00:40 2011 From: vamshi999 at gmail.com (vamshi999) Date: Sun, 4 Dec 2011 10:00:40 -0800 (PST) Subject: [R] equating approximate values Message-ID: <1323021640135-4157551.post@n4.nabble.com> Hello List, I am having trouble finding the command for my problem. I have two arrays x and y. now i would like to compare the values of x and y and then get the index of x which is exactly or approximately equal(+/- some value ) to the values in y. x <- runif(100,min=0,max=5) y <- runif(10,min=0,max=5) the threshold value(+/-) value can vary. for this example lets take it to be .5 I know the regular method of doing this by writing different if and for loops. But i have very big dataframe the computation time is very high for this method. can anyone please tell me if there any functions to do this. thank you for your help. -- View this message in context: http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4157551.html Sent from the R help mailing list archive at Nabble.com. From astareh at hotmail.com Sun Dec 4 19:11:05 2011 From: astareh at hotmail.com (set) Date: Sun, 4 Dec 2011 10:11:05 -0800 (PST) Subject: [R] similarity matrix Message-ID: <1323022265536-4157576.post@n4.nabble.com> Hello R-users, I've got a file with individuals as colums and the clusters where they occur in as rows. And I wanted a similarity matrix which tells me how many times each individual occurs with another. My eventual goal is to make Venn-diagrams from the occurence of my individuals. So I've this: cluster ind1 ind2 ind3 etc. 1 0 1 2 2 3 0 1 3 1 1 1 And I want to go to this: ind1 ind2 ind3 ind1 0 4 2 ind2 4 0 4 ind3 2 4 1 is there a way to do this? Thank you for your help -- View this message in context: http://r.789695.n4.nabble.com/similarity-matrix-tp4157576p4157576.html Sent from the R help mailing list archive at Nabble.com. From michael.weylandt at gmail.com Sun Dec 4 19:41:37 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Sun, 4 Dec 2011 13:41:37 -0500 Subject: [R] RODBC connect to Excel (64-bit Windows 7) In-Reply-To: References: Message-ID: <661B37ED-93B1-4434-ADE8-19FC1DE99D05@gmail.com> Do you need to use RODBC specifically? I've been using XLConnect quite a lot recently and have been quite pleased with it. Michael On Dec 4, 2011, at 9:40 AM, andrija djurovic wrote: > Hi to all. > I have a problem to connect to an Excel database using RODBC. > Namely, I am using 64-bit R 2.14.0, under Windows 7 and I tried following: > library(RODBC) >> channel <- odbcConnectExcel("results.xlsx") > Error in odbcConnectExcel("results.xlsx") : > odbcConnectExcel is only usable with 32-bit Windows # ok this is > clear why it doesn't work >> channel <- odbcConnectExcel2007("results.xlsx") # this was > one of proposals from old R help posts, but it doesn't work for me > Warning messages: > 1: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : > [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver > Manager] Data source name not found and no default driver specified > 2: In odbcDriverConnect(con, tabQuote = c("[", "]"), ...) : > ODBC connection failed > > After that as it suggested in R data import/export manual I > installed AccessDatabaseEngine.exe. Also I used ODBC in > c:\Windows\SysWOW64\odbcad32 to create data source called result. I check > if it is created: >> odbcDataSources() > dBASE Files > "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)" > MS Access Database > "Microsoft Access Driver (*.mdb, *.accdb)" > Excel file > "Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)" > * results* > "Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)" > > and tried again but it doesn't work: > >> channel <- odbcDriverConnect() > Warning messages: > 1: In odbcDriverConnect() : > [RODBC] ERROR: state IM014, code 0, message [Microsoft][ODBC Driver > Manager] The specified DSN contains an architecture mismatch between the > Driver and Application > 2: In odbcDriverConnect() : ODBC connection failed > > > Could someone guide me what should I try next to fix a problem? Is this > some problem with Drivers or not? > > Thanks in advance > > Andrija > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From djandrija at gmail.com Sun Dec 4 20:04:43 2011 From: djandrija at gmail.com (andrija djurovic) Date: Sun, 4 Dec 2011 20:04:43 +0100 Subject: [R] RODBC connect to Excel (64-bit Windows 7) In-Reply-To: <661B37ED-93B1-4434-ADE8-19FC1DE99D05@gmail.com> References: <661B37ED-93B1-4434-ADE8-19FC1DE99D05@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From djandrija at gmail.com Sun Dec 4 20:24:24 2011 From: djandrija at gmail.com (andrija djurovic) Date: Sun, 4 Dec 2011 20:24:24 +0100 Subject: [R] equating approximate values In-Reply-To: <1323021640135-4157551.post@n4.nabble.com> References: <1323021640135-4157551.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Sun Dec 4 20:39:22 2011 From: bps0002 at auburn.edu (B77S) Date: Sun, 4 Dec 2011 11:39:22 -0800 (PST) Subject: [R] similarity matrix In-Reply-To: <1323022265536-4157576.post@n4.nabble.com> References: <1323022265536-4157576.post@n4.nabble.com> Message-ID: <1323027562692-4157840.post@n4.nabble.com> I apologize to the list and you if I am mis-understanding something, but... As an example: ind2 occurs with ind1 only in cluster#3, so why does it get a value of 4 in your "similarity" matrix? Also, if this isn't a recognized similarity algorithm, perhaps you should at the very least put quotes around "similarity". Again, sorry if I am confused here. set wrote > > Hello R-users, > > I've got a file with individuals as colums and the clusters where they > occur in as rows. And I wanted a similarity matrix which tells me how many > times each individual occurs with another. My eventual goal is to make > Venn-diagrams from the occurence of my individuals. > > So I've this: > > cluster ind1 ind2 ind3 etc. > 1 0 1 2 > 2 3 0 1 > 3 1 1 1 > > And I want to go to this: > ind1 ind2 ind3 > ind1 0 4 2 > ind2 4 0 4 > ind3 2 4 1 > > is there a way to do this? > Thank you for your help > -- View this message in context: http://r.789695.n4.nabble.com/similarity-matrix-tp4157576p4157840.html Sent from the R help mailing list archive at Nabble.com. From gunter.berton at gene.com Sun Dec 4 21:07:48 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Sun, 4 Dec 2011 12:07:48 -0800 Subject: [R] Vectorization instead of loops problem In-Reply-To: References: Message-ID: Inline below On Sun, Dec 4, 2011 at 10:29 AM, Costas Vorlow wrote: > Dear Bert, > > You are right (obviously). > > Apologies for any inconvenience caused. ?I thought my problem was simplistic > with a very obvious answer which eluded me. > > As per your justified questions : > > 2: Answer is "all", > > hence: > > 3. would be include overlapping set (I guess) but this does not matter for > the time being. I didn't give it too much thought?admittedly... If I got 1 & > 2 right I could have modified the code for point 3 (if answer in 2 != > "all'), so I did not consider it when I was?formulating?my query. However, I > can see now why this is confusing. > > Anyways, thanks again for the pointers. > > BTW, is there a good & quick read/guide on vectorization in R that one could > recommend? That would minimize my queries at least in the list. :-) Vectorization is a central paradigm in R, so practically all books on the S language discuss this. The "R language definition" manual that ships with R is pretty comprehensive, but V&R's MASS or S Programming Books, Patrick Burns's website tutorials (he has several well suited for beginners), John Chambers's "Programming with R " , etc. are just a few among many. It is impossible for me to be more specific than that. -- Bert > > Apologies again and best regards, > Costas > > On 4 December 2011 17:45, Bert Gunter wrote: >> >> Costas: (and thanks for giving us your name) >> >> which(x == 1) >> >> gives you the indices where x is 1 (up to floating point equality -- >> you did not specify whether your x values are integers or calculated >> as floating point, and that certainly makes a difference). You can >> then use simple indexing to get the y values. No loops needed. >> >> However, let's explore why your question may have been too poorly >> formed to get the answer you seek: >> >> 1. What if the index of the first 1 is 3 or less? -- Do you want to >> ignore the (less than 3) preceding values or just choose as many as >> you can? >> >> 2. What if, as in your example, several 1's occur in x. Do you want >> the 3 preceding values for all of them or just the first? >> >> 3. If the answer to 2 is "all of them," what if several 1's are less >> than 3 indices apart -- do you want to include the overlapping sets of >> 3 y's -- or what? >> >> My point is that "etc. etc." is simply inadequate as a coherent or >> useful problem description in your post. You _must_ be explicit, >> complete, and concise. This can be hard. Indeed, it may require >> considerable thought and effort. I have found -- and others have often >> noted here -- that going through such an exercise itself often reveals >> a solution. But be that as it may, the Posting Guide is actually an >> excellent, comprehensive discussion of how to ask good questions in >> forums like this. Read it. Follow it. >> >> ... and to be fair, your post below is, imho, probably above average >> as posts go, allowing me to focus on specific points that I thought >> required clarification. Quite a few posts here of late have been so >> muddled and incoherent that I had no clue what the OP wanted. And it's >> not English as a second language. I am a language ignoramus and speak >> only English, so I am happy to tolerate poor grammar and vocabulary >> from someone for whom English is only one of several languages in >> which they can communicate. The problem is poor thinking, not poor >> English. >> >> Best, >> Bert >> >> On Sun, Dec 4, 2011 at 7:18 AM, Costas Vorlow >> wrote: >> > Hello, >> > >> > I am having problems vectorizing the following (i/o using a >> > for/next/while >> > loop): >> > >> > I have 2 sequences such as: >> > >> > x, y >> > 1, 30 >> > 2, -40 >> > 0, 50 >> > 0, 25 >> > 1, -5 >> > 2, -10 >> > 1, 5 >> > 0, 40 >> > >> > etc etc >> > >> > The first sequence (x) takes integer numbers only: 0, 1, 2 >> > The sequence y can be anything... >> > >> > I want to be able to retrieve (in a list if possible) the 3 last values >> > of >> > the y sequence before a value of 1 is encountered on the x sequence, >> > i.e: >> > >> > On line 5 in the above dataset, x is 1 so I need to capture values: 25, >> > 50 >> > and -40 of the y sequence. >> > >> > So the outcome (if a list) should look something like: >> > >> > [1],[25,50,-40] >> > [2],[-10,-5,25] # as member #7 of x sequence is 1... >> > >> > etc. etc. >> > >> > Can I do the above avoiding for/next or while loops? >> > I am not sure I can explain it better. Any help/pointer extremely >> > welcome. >> > >> > Best regards, >> > Costas >> > >> > >> > -- >> > >> > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >> > |c|o|s|t|a|s|@|v|o|r|l|o|w|.|o|r|g| >> > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ >> > >> > ? ? ? ?[[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. >> >> >> >> -- >> >> Bert Gunter >> Genentech Nonclinical Biostatistics >> >> Internal Contact Info: >> Phone: 467-7374 >> Website: >> >> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm > > > > > -- > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > |c|o|s|t|a|s|@|v|o|r|l|o|w|.|o|r|g| > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From aurelien.philippot at gmail.com Sun Dec 4 21:32:28 2011 From: aurelien.philippot at gmail.com (=?ISO-8859-1?Q?Aur=E9lien_PHILIPPOT?=) Date: Sun, 4 Dec 2011 12:32:28 -0800 Subject: [R] Group several variables and apply a function to the group Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mazatlanmexico at yahoo.com Sun Dec 4 21:51:22 2011 From: mazatlanmexico at yahoo.com (Felipe Carrillo) Date: Sun, 4 Dec 2011 12:51:22 -0800 (PST) Subject: [R] Group several variables and apply a function to the group In-Reply-To: References: Message-ID: <1323031882.21881.YahooMailNeo@web125506.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From aurelien.philippot at gmail.com Sun Dec 4 21:55:41 2011 From: aurelien.philippot at gmail.com (=?ISO-8859-1?Q?Aur=E9lien_PHILIPPOT?=) Date: Sun, 4 Dec 2011 12:55:41 -0800 Subject: [R] Group several variables and apply a function to the group In-Reply-To: <1323031882.21881.YahooMailNeo@web125506.mail.ne1.yahoo.com> References: <1323031882.21881.YahooMailNeo@web125506.mail.ne1.yahoo.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Peter.Brecknock at bp.com Sun Dec 4 21:56:31 2011 From: Peter.Brecknock at bp.com (Pete Brecknock) Date: Sun, 4 Dec 2011 12:56:31 -0800 (PST) Subject: [R] Group several variables and apply a function to the group In-Reply-To: References: Message-ID: <1323032191189-4158090.post@n4.nabble.com> Aur?lien PHILIPPOT wrote > > Dear R-experts, > I am struggling with the following problem, and I am looking for advice > from more experienced R-users: I have a data frame with 2 identifying > variables (comn and mi), and an output variable (x). comn is a variable > for > a company and mi is a variable for a month. > > comn<-c("abc", "abc", "abc", "abc", "abc", "abc", "xyz", "xyz","xyz", > "xyz") > mi<- c("1", "1","1", "2", "2", "2", "1", "1", "3", "3") > x<- c("-0.0031", "0.0009", "-0.007", "0.1929","0.0087", "0.099","-0.089", > "0.005", "-0.0078", "0.67" ) > df<- data.frame(comn=comn, mi=mi, x=x) > > > For each company, within a particular month, I would like to compute the > standard deviation of x: for example, for abc, I would like to compute the > sd of x for month1 (when mi=1) and for month2 (when mi=2). > > In other languages (Stata for instance), I would create a grouping > variable > (group comnn and mi) and then, apply the sd function for each group. > > However, I don't find an elegant way to do the same in R: > > I was thinking about the following: I could subset my data frame by mi and > create one file per month, and then make a loop and in each file, use a > "by" operator for each comn. I am sure it would work, but I feel that it > would be like killing an ant with a tank. > > I was wondering if anyone knew a more straightforward way to implement > that > kind of operation? > > Thanks a lot, > > Best, > Aurelien > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@ 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 code. > One way would be to use the aggregate function. # Your Data ... # Note: I have removed the quotes off the output variable x comn<-c("abc", "abc", "abc", "abc", "abc", "abc", "xyz", "xyz","xyz", "xyz") mi<- c("1", "1","1", "2", "2", "2", "1", "1", "3", "3") x<- c(-0.0031, 0.0009, -0.007, 0.1929,0.0087, 0.099,-0.089, 0.005, -0.0078, 0.67) df<- data.frame(comn=comn, mi=mi, x=x) # Aggregate Function aggregate(df$x, by=list(df$comn,df$mi),FUN=sd) HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/Group-several-variables-and-apply-a-function-to-the-group-tp4158017p4158090.html Sent from the R help mailing list archive at Nabble.com. From jrkrideau at yahoo.ca Sun Dec 4 22:07:04 2011 From: jrkrideau at yahoo.ca (John Kane) Date: Sun, 4 Dec 2011 13:07:04 -0800 (PST) Subject: [R] Group several variables and apply a function to the group In-Reply-To: Message-ID: <1323032824.66527.YahooMailClassic@web38408.mail.mud.yahoo.com> ?aggregate should do it aggregate(df$x,list(df$comn, df$mi), sd) There are other ways of course Using the reshape2 package library(reshape2) x1 <- melt(df, id=c("comn", "mi")) dcast(x1, comn + mi ~ variable, sd) --- On Sun, 12/4/11, Aur?lien PHILIPPOT wrote: > From: Aur?lien PHILIPPOT > Subject: [R] Group several variables and apply a function to the group > To: R-help at r-project.org > Received: Sunday, December 4, 2011, 3:32 PM > Dear R-experts, > I am struggling with the following problem, and I am > looking for advice > from more experienced R-users: I have a data frame with 2 > identifying > variables (comn and mi), and an output variable (x). comn > is a variable for > a company and mi is a variable for a month. > > comn<-c("abc", "abc", "abc", "abc", "abc", "abc", "xyz", > "xyz","xyz", "xyz") > mi<- c("1", "1","1", "2", "2", "2", "1", "1", "3", "3") > x<- c("-0.0031", "0.0009", "-0.007", "0.1929","0.0087", > "0.099","-0.089", > "0.005", "-0.0078", "0.67" ) > df<- data.frame(comn=comn, mi=mi, x=x) > > > For each company, within a particular month, I would like > to compute the > standard deviation of x: for example, for abc, I would like > to compute the > sd of x for month1 (when mi=1) and for month2 (when mi=2). > > In other languages (Stata for instance), I would create a > grouping variable > (group comnn and mi) and then, apply the sd function for > each group. > > However, I don't find an elegant way to do the same in R: > > I was thinking about the following: I could subset my data > frame by mi and > create one file per month, and then make a loop and in each > file, use a > "by" operator for each comn. I am sure it would work, but I > feel that it > would be like killing an ant with a tank. > > I was wondering if anyone knew a more straightforward way > to implement that > kind of operation? > > Thanks a lot, > > Best, > Aurelien > > ??? [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. > From erinm.hodgess at gmail.com Sun Dec 4 22:07:50 2011 From: erinm.hodgess at gmail.com (Erin Hodgess) Date: Sun, 4 Dec 2011 15:07:50 -0600 Subject: [R] trouble with installXLSXsupport() Message-ID: Dear R People: I'm using gdata and read.xls for a couple of projects. When I load gdata, it says to run installXLSXsupport() When I do that, I get a "not responding" error. I tried it with verbose=TRUE, but nothing appears. Has anyone else run into this, please? This is on Windows 7, 64 bit, compiled from source. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com From erinm.hodgess at gmail.com Sun Dec 4 22:19:53 2011 From: erinm.hodgess at gmail.com (Erin Hodgess) Date: Sun, 4 Dec 2011 15:19:53 -0600 Subject: [R] a weird question about gdata::: Message-ID: Dear R People: If I put in: > findPerl Error: object 'findPerl' not found But if I use: > gdata:::findPerl function (perl, verbose = "FALSE") { errorMsg <- "perl executable not found. Use perl= argument to specify the correct path." if (missing(perl)) { perl = "perl" } perl = Sys.which(perl) if (perl == "" || perl == "perl") stop(errorMsg) if (.Platform$OS == "windows") { if (length(grep("rtools", tolower(perl))) > 0) { perl.ftype <- shell("ftype perl", intern = TRUE) if (length(grep("^perl=", perl.ftype)) > 0) { perl <- sub("^perl=\"([^\"]*)\".*", "\\1", perl.ftype) } } } if (verbose) cat("Using perl at", perl, "\n") perl } > Why does one work but not the other, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com From i.visser at uva.nl Sun Dec 4 22:34:22 2011 From: i.visser at uva.nl (Ingmar Visser) Date: Sun, 4 Dec 2011 22:34:22 +0100 Subject: [R] Estimation of AR(1) Model with Markov Switching In-Reply-To: <1322758680372-4129417.post@n4.nabble.com> References: <1322758680372-4129417.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gunter.berton at gene.com Sun Dec 4 22:57:24 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Sun, 4 Dec 2011 13:57:24 -0800 Subject: [R] a weird question about gdata::: In-Reply-To: References: Message-ID: ??namespace ?getAnywhere ?"::" See also: http://www.stat.uiowa.edu/~luke/R/namespaces/morenames.pdf Bottom line: namespaces provide a mechanism to "hide" certain variables within a package. Special measures as documented above are required to view them -- Bert On Sun, Dec 4, 2011 at 1:19 PM, Erin Hodgess wrote: > Dear R People: > > If I put in: > >> findPerl > Error: object 'findPerl' not found > > > But if I use: > >> gdata:::findPerl > function (perl, verbose = "FALSE") > { > ? ?errorMsg <- "perl executable not found. Use perl= argument to > specify the correct path." > ? ?if (missing(perl)) { > ? ? ? ?perl = "perl" > ? ?} > ? ?perl = Sys.which(perl) > ? ?if (perl == "" || perl == "perl") > ? ? ? ?stop(errorMsg) > ? ?if (.Platform$OS == "windows") { > ? ? ? ?if (length(grep("rtools", tolower(perl))) > 0) { > ? ? ? ? ? ?perl.ftype <- shell("ftype perl", intern = TRUE) > ? ? ? ? ? ?if (length(grep("^perl=", perl.ftype)) > 0) { > ? ? ? ? ? ? ? ?perl <- sub("^perl=\"([^\"]*)\".*", "\\1", perl.ftype) > ? ? ? ? ? ?} > ? ? ? ?} > ? ?} > ? ?if (verbose) > ? ? ? ?cat("Using perl at", perl, "\n") > ? ?perl > } > >> > > Why does one work but not the other, please? > > Thanks, > Erin > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From gunter.berton at gene.com Sun Dec 4 23:06:21 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Sun, 4 Dec 2011 14:06:21 -0800 Subject: [R] Group several variables and apply a function to the group In-Reply-To: <1323032824.66527.YahooMailClassic@web38408.mail.mud.yahoo.com> References: <1323032824.66527.YahooMailClassic@web38408.mail.mud.yahoo.com> Message-ID: ... with() is useful here: e.g. in base R, simply tapply() or ave() with with() with(df,ave(x, comn,mi, FUN = sd)) -- Bert On Sun, Dec 4, 2011 at 1:07 PM, John Kane wrote: > ?aggregate should do it > > aggregate(df$x,list(df$comn, df$mi), sd) > > There are other ways of course > > Using the reshape2 package > > library(reshape2) > x1 <- melt(df, id=c("comn", "mi")) > dcast(x1, comn + mi ~ variable, sd) > > > > > --- On Sun, 12/4/11, Aur?lien PHILIPPOT wrote: > >> From: Aur?lien PHILIPPOT >> Subject: [R] Group several variables and apply a function to the group >> To: R-help at r-project.org >> Received: Sunday, December 4, 2011, 3:32 PM >> Dear R-experts, >> I am struggling with the following problem, and I am >> looking for advice >> from more experienced R-users: I have a data frame with 2 >> identifying >> variables (comn and mi), and an output variable (x). comn >> is a variable for >> a company and mi is a variable for a month. >> >> comn<-c("abc", "abc", "abc", "abc", "abc", "abc", "xyz", >> "xyz","xyz", "xyz") >> mi<- c("1", "1","1", "2", "2", "2", "1", "1", "3", "3") >> x<- c("-0.0031", "0.0009", "-0.007", "0.1929","0.0087", >> "0.099","-0.089", >> "0.005", "-0.0078", "0.67" ) >> df<- data.frame(comn=comn, mi=mi, x=x) >> >> >> For each company, within a particular month, I would like >> to compute the >> standard deviation of x: for example, for abc, I would like >> to compute the >> sd of x for month1 (when mi=1) and for month2 (when mi=2). >> >> In other languages (Stata for instance), I would create a >> grouping variable >> (group comnn and mi) and then, apply the sd function for >> each group. >> >> However, I don't find an elegant way to do the same in R: >> >> I was thinking about the following: I could subset my data >> frame by mi and >> create one file per month, and then make a loop and in each >> file, use a >> "by" operator for each comn. I am sure it would work, but I >> feel that it >> would be like killing an ant with a tank. >> >> I was wondering if anyone knew a more straightforward way >> to implement that >> kind of operation? >> >> Thanks a lot, >> >> Best, >> Aurelien >> >> ??? [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. >> > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From matthew-c.johnson at ubs.com Sun Dec 4 23:25:51 2011 From: matthew-c.johnson at ubs.com (mattjo) Date: Sun, 4 Dec 2011 14:25:51 -0800 (PST) Subject: [R] RODBC sqlSave / append problem (windows XP, R 2.13.2) Message-ID: <0B3D04B9A3E43D49807BE67A26D55CF81936D75C@NSYDC101PEX1.ubsw.net> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Mon Dec 5 00:25:32 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sun, 4 Dec 2011 18:25:32 -0500 Subject: [R] equating approximate values In-Reply-To: References: <1323021640135-4157551.post@n4.nabble.com> Message-ID: Not sure what to make of the fact that your x, y are of different lengths: if you mean to check all possible pairings, this is probably what you need: which(outer(x, y, "-") < threshold, arr.ind = TRUE) Michael On Sun, Dec 4, 2011 at 2:24 PM, andrija djurovic wrote: > Hi. Maybe this can help you (you can try additionally to incorporate > threshold): > >> set.seed(1) >> x<-rnorm(10,10,1) >> values <- sample(1:10,10) ?#values that we are looking for >> mat <- matrix(c(x,values),ncol=2) >> >> closest<-function(x,values) ? ?#function is an example from The R book > (Crawley) > + { > + x[which(abs(x-values)==min(abs(x-values)))] > + } >> >> apply(mat[,2,drop=FALSE],1,function(y) closest(mat[,1],y)) > ?[1] 10.183643 ?9.164371 ?9.164371 ?9.164371 ?9.164371 ?9.164371 ?9.164371 > ?9.164371 > ?[9] ?9.164371 ?9.164371 > > > On Sun, Dec 4, 2011 at 7:00 PM, vamshi999 wrote: > >> Hello List, >> >> I am having trouble finding the command for my problem. >> >> I have two arrays x and y. now i would like to compare the values of x and >> y >> and then get the index of x which is exactly or approximately equal(+/- >> some >> value ) to the values in y. >> ?x <- runif(100,min=0,max=5) >> ?y <- runif(10,min=0,max=5) >> >> >> the threshold value(+/-) value can vary. for this example lets take it to >> be >> .5 >> >> I know the regular method of doing this by writing different if and for >> loops. But i have very big dataframe the computation time is very high for >> this method. can anyone please tell me if there any functions to do this. >> >> thank you for your help. >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4157551.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 00:27:56 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Sun, 4 Dec 2011 18:27:56 -0500 Subject: [R] equating approximate values In-Reply-To: References: <1323021640135-4157551.post@n4.nabble.com> Message-ID: My apologies: you need an abs() call as well: which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) Michael On Sun, Dec 4, 2011 at 6:25 PM, R. Michael Weylandt wrote: > Not sure what to make of the fact that your x, y are of different > lengths: if you mean to check all possible pairings, this is probably > what you need: > > which(outer(x, y, "-") < threshold, arr.ind = TRUE) > > Michael > > On Sun, Dec 4, 2011 at 2:24 PM, andrija djurovic wrote: >> Hi. Maybe this can help you (you can try additionally to incorporate >> threshold): >> >>> set.seed(1) >>> x<-rnorm(10,10,1) >>> values <- sample(1:10,10) ?#values that we are looking for >>> mat <- matrix(c(x,values),ncol=2) >>> >>> closest<-function(x,values) ? ?#function is an example from The R book >> (Crawley) >> + { >> + x[which(abs(x-values)==min(abs(x-values)))] >> + } >>> >>> apply(mat[,2,drop=FALSE],1,function(y) closest(mat[,1],y)) >> ?[1] 10.183643 ?9.164371 ?9.164371 ?9.164371 ?9.164371 ?9.164371 ?9.164371 >> ?9.164371 >> ?[9] ?9.164371 ?9.164371 >> >> >> On Sun, Dec 4, 2011 at 7:00 PM, vamshi999 wrote: >> >>> Hello List, >>> >>> I am having trouble finding the command for my problem. >>> >>> I have two arrays x and y. now i would like to compare the values of x and >>> y >>> and then get the index of x which is exactly or approximately equal(+/- >>> some >>> value ) to the values in y. >>> ?x <- runif(100,min=0,max=5) >>> ?y <- runif(10,min=0,max=5) >>> >>> >>> the threshold value(+/-) value can vary. for this example lets take it to >>> be >>> .5 >>> >>> I know the regular method of doing this by writing different if and for >>> loops. But i have very big dataframe the computation time is very high for >>> this method. can anyone please tell me if there any functions to do this. >>> >>> thank you for your help. >>> >>> -- >>> View this message in context: >>> http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4157551.html >>> Sent from the R help mailing list archive at Nabble.com. >>> >>> ______________________________________________ >>> R-help at 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 code. >>> >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. From rolf.turner at xtra.co.nz Mon Dec 5 00:57:29 2011 From: rolf.turner at xtra.co.nz (Rolf Turner) Date: Mon, 5 Dec 2011 12:57:29 +1300 Subject: [R] a weird question about gdata::: In-Reply-To: References: Message-ID: <4EDC08E9.1040703@xtra.co.nz> See end of message. On 05/12/11 10:19, Erin Hodgess wrote: > Dear R People: > > If I put in: > >> findPerl > Error: object 'findPerl' not found > > > But if I use: > >> gdata:::findPerl > function (perl, verbose = "FALSE") > { > errorMsg<- "perl executable not found. Use perl= argument to > specify the correct path." > if (missing(perl)) { > perl = "perl" > } > perl = Sys.which(perl) > if (perl == "" || perl == "perl") > stop(errorMsg) > if (.Platform$OS == "windows") { > if (length(grep("rtools", tolower(perl)))> 0) { > perl.ftype<- shell("ftype perl", intern = TRUE) > if (length(grep("^perl=", perl.ftype))> 0) { > perl<- sub("^perl=\"([^\"]*)\".*", "\\1", perl.ftype) > } > } > } > if (verbose) > cat("Using perl at", perl, "\n") > perl > } > > Why does one work but not the other, please? Because "findPerl" is ``not exported'' from the gdata namespace. Uhhh, what does that mean? I have a vague idea, but I'm not sufficiently confident/competent to elaborate. You'll just have to read up on namespaces. I'm *sure* namespaces are really a Good Thing, but they sure do add to the mysteries of R usage. Has Pat Burns written anything by way of explaining namespace to bunnies like me? cheers, Rolf From ggrothendieck at gmail.com Mon Dec 5 01:04:55 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Sun, 4 Dec 2011 19:04:55 -0500 Subject: [R] a weird question about gdata::: In-Reply-To: <4EDC08E9.1040703@xtra.co.nz> References: <4EDC08E9.1040703@xtra.co.nz> Message-ID: On Sun, Dec 4, 2011 at 6:57 PM, Rolf Turner wrote: > > See end of message. > > > On 05/12/11 10:19, Erin Hodgess wrote: >> >> Dear R People: >> >> If I put in: >> >>> findPerl >> >> Error: object 'findPerl' not found >> >> >> But if I use: >> >>> gdata:::findPerl >> >> function (perl, verbose = "FALSE") >> { >> ? ? errorMsg<- "perl executable not found. Use perl= argument to >> specify the correct path." >> ? ? if (missing(perl)) { >> ? ? ? ? perl = "perl" >> ? ? } >> ? ? perl = Sys.which(perl) >> ? ? if (perl == "" || perl == "perl") >> ? ? ? ? stop(errorMsg) >> ? ? if (.Platform$OS == "windows") { >> ? ? ? ? if (length(grep("rtools", tolower(perl)))> ?0) { >> ? ? ? ? ? ? perl.ftype<- shell("ftype perl", intern = TRUE) >> ? ? ? ? ? ? if (length(grep("^perl=", perl.ftype))> ?0) { >> ? ? ? ? ? ? ? ? perl<- sub("^perl=\"([^\"]*)\".*", "\\1", perl.ftype) >> ? ? ? ? ? ? } >> ? ? ? ? } >> ? ? } >> ? ? if (verbose) >> ? ? ? ? cat("Using perl at", perl, "\n") >> ? ? perl >> } >> >> Why does one work but not the other, please? > > > Because "findPerl" is ``not exported'' from the gdata namespace. > > Uhhh, what does that mean? ?I have a vague idea, but I'm not sufficiently > confident/competent to elaborate. ?You'll just have to read up on > namespaces. > I'm *sure* namespaces are really a Good Thing, but they sure do add to the > mysteries of R usage. > The idea is to divide objects into those that are there for the user to access (exported objects) and those that are internal objects that only the package itself uses (everything else). findPerl is there only so that read.xls and other routines that depend on perl scripts can use it internally to find perl. It was not intended that users access it so its better hidden from view. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From jdnewmil at dcn.davis.ca.us Mon Dec 5 02:07:37 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Sun, 4 Dec 2011 20:07:37 -0500 Subject: [R] a weird question about gdata::: In-Reply-To: References: <4EDC08E9.1040703@xtra.co.nz> Message-ID: <8d015bdf-9f89-4752-ba32-14c8c3a14733@email.android.com> I prefer to think of namespaces as preventing clashes with similarly-named functions in the main workspace or in other packages that might serve a different need. Given that purpose, I don't think I would have confined that particular function behind the namespace, because any other use of that name is likely to duplicate the functionality of that particular function, and any improvements to it probably ought to be incorporated into that particular function just as much as any other implementation would deserve improvement. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Gabor Grothendieck wrote: >On Sun, Dec 4, 2011 at 6:57 PM, Rolf Turner >wrote: >> >> See end of message. >> >> >> On 05/12/11 10:19, Erin Hodgess wrote: >>> >>> Dear R People: >>> >>> If I put in: >>> >>>> findPerl >>> >>> Error: object 'findPerl' not found >>> >>> >>> But if I use: >>> >>>> gdata:::findPerl >>> >>> function (perl, verbose = "FALSE") >>> { >>> ? ? errorMsg<- "perl executable not found. Use perl= argument to >>> specify the correct path." >>> ? ? if (missing(perl)) { >>> ? ? ? ? perl = "perl" >>> ? ? } >>> ? ? perl = Sys.which(perl) >>> ? ? if (perl == "" || perl == "perl") >>> ? ? ? ? stop(errorMsg) >>> ? ? if (.Platform$OS == "windows") { >>> ? ? ? ? if (length(grep("rtools", tolower(perl)))> ?0) { >>> ? ? ? ? ? ? perl.ftype<- shell("ftype perl", intern = TRUE) >>> ? ? ? ? ? ? if (length(grep("^perl=", perl.ftype))> ?0) { >>> ? ? ? ? ? ? ? ? perl<- sub("^perl=\"([^\"]*)\".*", "\\1", >perl.ftype) >>> ? ? ? ? ? ? } >>> ? ? ? ? } >>> ? ? } >>> ? ? if (verbose) >>> ? ? ? ? cat("Using perl at", perl, "\n") >>> ? ? perl >>> } >>> >>> Why does one work but not the other, please? >> >> >> Because "findPerl" is ``not exported'' from the gdata namespace. >> >> Uhhh, what does that mean? ?I have a vague idea, but I'm not >sufficiently >> confident/competent to elaborate. ?You'll just have to read up on >> namespaces. >> I'm *sure* namespaces are really a Good Thing, but they sure do add >to the >> mysteries of R usage. >> > >The idea is to divide objects into those that are there for the user >to access (exported objects) and those that are internal objects that >only the package itself uses (everything else). findPerl is there >only so that read.xls and other routines that depend on perl scripts >can use it internally to find perl. It was not intended that users >access it so its better hidden from view. > >-- >Statistics & Software Consulting >GKX Group, GKX Associates Inc. >tel: 1-877-GKX-GROUP >email: ggrothendieck at gmail.com > >______________________________________________ >R-help at 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 code. From chapkovski at gmail.com Mon Dec 5 02:12:54 2011 From: chapkovski at gmail.com (Philipp Chapkovski) Date: Mon, 5 Dec 2011 02:12:54 +0100 Subject: [R] convert table to a string in matrix Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bbolker at gmail.com Mon Dec 5 02:43:10 2011 From: bbolker at gmail.com (Ben Bolker) Date: Mon, 5 Dec 2011 01:43:10 +0000 Subject: [R] upper bound in the integrate function depends on a parameter References: Message-ID: Jorge I Velez gmail.com> writes: > And remember: > > #install.packages('fortunes') > require(fortunes) > fortune('Yoda') > > Evelyn Hall: I would like to know how (if) I can extract some of the > information > from the summary of my nlme. > Simon Blomberg: This is R. There is no if. Only how. > -- Evelyn Hall and Simon 'Yoda' Blomberg > R-help (April 2005) Yes, although if you really wanted to compute (symbolic) indefinite integrals, it would be awfully hard. R is Turing-complete so of course you could do it ... but ... Ben Bolker From comtech.usa at gmail.com Mon Dec 5 03:31:11 2011 From: comtech.usa at gmail.com (Michael) Date: Sun, 4 Dec 2011 20:31:11 -0600 Subject: [R] Save debugging session info and resume from the middle? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From vamshi999 at gmail.com Mon Dec 5 01:04:22 2011 From: vamshi999 at gmail.com (vamshi999) Date: Sun, 4 Dec 2011 16:04:22 -0800 (PST) Subject: [R] equating approximate values In-Reply-To: References: <1323021640135-4157551.post@n4.nabble.com> Message-ID: <1323043462928-4158691.post@n4.nabble.com> this is exactly what i wanted. How to i select only the minimum value from this?. thank you My apologies: you need an abs() call as well: which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) Michael -- View this message in context: http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4158691.html Sent from the R help mailing list archive at Nabble.com. From zack.abrahamson at gmail.com Mon Dec 5 02:04:16 2011 From: zack.abrahamson at gmail.com (z2.0) Date: Sun, 4 Dec 2011 17:04:16 -0800 (PST) Subject: [R] Prediction from censReg? In-Reply-To: <1322964489802-4155855.post@n4.nabble.com> References: <1322964489802-4155855.post@n4.nabble.com> Message-ID: <1323047056448-4158844.post@n4.nabble.com> Just posting again here... -- View this message in context: http://r.789695.n4.nabble.com/Prediction-from-censReg-tp4155855p4158844.html Sent from the R help mailing list archive at Nabble.com. From couch.world at gmail.com Mon Dec 5 02:14:31 2011 From: couch.world at gmail.com (=)) Date: Mon, 5 Dec 2011 03:14:31 +0200 Subject: [R] Rggobi pdf output In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From couch.world at gmail.com Mon Dec 5 02:21:19 2011 From: couch.world at gmail.com (=)) Date: Mon, 5 Dec 2011 03:21:19 +0200 Subject: [R] [rggobi] ggplot like pdf output Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wchips at y7mail.com Mon Dec 5 02:57:19 2011 From: wchips at y7mail.com (wchips) Date: Sun, 4 Dec 2011 17:57:19 -0800 (PST) Subject: [R] Persp3d freezes when run from within Python Message-ID: <1323050239287-4158940.post@n4.nabble.com> G'day everyone, I've been trying to get an interactive OpenGL plot to work from within Python 2.6 using Rpy2 and the persp3d function. The problem is that the plot seems to freeze upon activation. All interactivity is lost even though it works fine when run from within the R console (version 2.11.1). Is this a known issue? Any ideas as to what might be causing this, or possibly how to fix it? cheers, wchips -- View this message in context: http://r.789695.n4.nabble.com/Persp3d-freezes-when-run-from-within-Python-tp4158940p4158940.html Sent from the R help mailing list archive at Nabble.com. From ggrothendieck at gmail.com Mon Dec 5 04:52:37 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Sun, 4 Dec 2011 22:52:37 -0500 Subject: [R] a weird question about gdata::: In-Reply-To: <8d015bdf-9f89-4752-ba32-14c8c3a14733@email.android.com> References: <4EDC08E9.1040703@xtra.co.nz> <8d015bdf-9f89-4752-ba32-14c8c3a14733@email.android.com> Message-ID: On Sun, Dec 4, 2011 at 8:07 PM, Jeff Newmiller wrote: > I prefer to think of namespaces as preventing clashes with similarly-named functions in the main workspace or in other packages that might serve a different need. > > Given that purpose, I don't think I would have confined that particular function behind the namespace, because any other use of that name is likely to duplicate the functionality of that particular function, and any improvements to it probably ought to be incorporated into that particular function just as much as any other implementation would deserve improvement. The idea of hiding the the internals is that they can then be changed with reasonable likelihood that it won't affect users. Only those who attempted to circumvent the barriers put in place would be affected. For example, suppose that read.xls and the related Excel routines were to be changed so that internally they use C instead of perl. In that case findPerl would not serve any purpose in the package and the current design would allow it to be dropped. On the other hand, if the purpose of the package were specifically to interface to perl then it would make sense to export it. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From ngokangmin at gmail.com Mon Dec 5 04:02:44 2011 From: ngokangmin at gmail.com (Kang Min) Date: Sun, 4 Dec 2011 19:02:44 -0800 (PST) Subject: [R] Extract last 3 characters from numeric vector In-Reply-To: <4EDB94F8.1040100@statistik.tu-dortmund.de> References: <2b0fce6a-ec23-4034-b80f-91e4a8440389@z1g2000yqa.googlegroups.com> <4EDB94F8.1040100@statistik.tu-dortmund.de> Message-ID: Thanks Sarah, but I discovered that numbers like 3.0 only have 1 character, so I had a range of character lengths from 1 to 4 (e.g. 17.0 has 2 characters, 3.4 has 3 and 12.4 has 4). Uwe's method worked well. Thanks again. Kang Min On Dec 4, 11:42?pm, Uwe Ligges wrote: > On 04.12.2011 14:38, Kang Min wrote: > > > Hi all, > > > I have a numeric vector with 1 decimal place, and I'd like to extract > > the last 3 characters, including the decimal point. The vector ranges > > from 0 to 20. > > > x<- round(runif(100)*20, digits=1) > > formatC(round(x%%10, 1), format="f", digits=1) > > Uwe Ligges > > > Some of numbers have 3 characters, and some have 4. I've read up on > > the substr() function but that extracts characters based on exact > > positions. How can I extract just the last 3 characters no matter the > > length of the number? e.g. from 16.7 I want 6.7, from 3.5 I want 3.5 > > as it is. > > > Thanks, > > Kang Min > > > ______________________________________________ > > R-h... at r-project.org mailing list > >https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. From un_tonio at yahoo.com Mon Dec 5 08:11:51 2011 From: un_tonio at yahoo.com (Tonio) Date: Sun, 4 Dec 2011 23:11:51 -0800 (PST) Subject: [R] Toggle cASE Message-ID: <1323069111.20601.YahooMailNeo@web130111.mail.mud.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tonja.krueger at web.de Mon Dec 5 08:46:34 2011 From: tonja.krueger at web.de (Tonja Krueger) Date: Mon, 5 Dec 2011 08:46:34 +0100 (CET) Subject: [R] local minima/ maxima Message-ID: <585155369.13769757.1323071194731.JavaMail.fmail@3capp-webde-bs38.dlan.cinetic.de> From astareh at hotmail.com Mon Dec 5 08:47:13 2011 From: astareh at hotmail.com (set) Date: Sun, 4 Dec 2011 23:47:13 -0800 (PST) Subject: [R] similarity matrix In-Reply-To: <1323027562692-4157840.post@n4.nabble.com> References: <1323022265536-4157576.post@n4.nabble.com> <1323027562692-4157840.post@n4.nabble.com> Message-ID: <1323071233237-4159547.post@n4.nabble.com> I'm sorry, I made a mistake in my example. you're right. I don't really know how a similarity alogrithm works....but I'm willing to try that...are there any good examples available? Thank you -- View this message in context: http://r.789695.n4.nabble.com/similarity-matrix-tp4157576p4159547.html Sent from the R help mailing list archive at Nabble.com. From narendarcse007 at gmail.com Mon Dec 5 07:46:23 2011 From: narendarcse007 at gmail.com (narendarreddy kalam) Date: Sun, 4 Dec 2011 22:46:23 -0800 (PST) Subject: [R] about error while using anova function Message-ID: <1323067583199-4159463.post@n4.nabble.com> fit1<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) fit2<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.5,data=wbc) fit3<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) fit4<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) fit5<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) *output of tau=0.15*fit1 Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.15, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.191528450 0.005276347 0.021414032 0.016034803 0.007510343 0.005276347 inp6 inp7 inp8 inp9 0.058708544 0.005224906 0.006804871 -0.003931540 Degrees of freedom: 673 total; 663 residual *output of tau=0.3*fit2 Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.3, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 -1.111111e-01 5.776765e-19 4.635734e-18 1.874715e-18 2.099872e-18 inp5 inp6 inp7 inp8 inp9 -4.942052e-19 1.111111e-01 2.205289e-18 4.138435e-18 9.300642e-19 Degrees of freedom: 673 total; 663 residual *output of tau=0.5*fit3 Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.5, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 -1.400000e-01 5.810236e-17 4.000000e-02 1.087160e-16 4.297771e-18 inp5 inp6 inp7 inp8 inp9 8.045868e-17 8.000000e-02 6.841101e-17 2.000000e-02 7.560947e-17 Degrees of freedom: 673 total; 663 residual *output of tau=0.65* Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.65, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.193593706 0.005012804 0.044208182 0.008994346 0.006214294 0.007622629 inp6 inp7 inp8 inp9 0.064595895 0.006214294 0.028904532 0.001775512 Degrees of freedom: 673 total; 663 residual *output of tau=0.9:* fit5 Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.9, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.249006688 0.040430238 0.010854846 0.031021326 0.013558943 0.024867111 inp6 inp7 inp8 inp9 0.050441784 0.024867111 0.027018345 0.001079872 Degrees of freedom: 673 total; 663 residual < b> so fit1 fit2,fit3,fit4,fit5 are the 5 quantiles of the wbc dataset.but why i am encoutering the following error while using anova* *anova(fit1,fit2,fit3,fit4,fit5); Error in solve.default(D %*% W %*% t(D), D %*% coef) : system is computationally singular: reciprocal condition number = 5.58091e-19 In addition: Warning messages: 1: In summary.rq(x, se = "nid", covariance = TRUE) : 93 non-positive fis 2: In summary.rq(x, se = "nid", covariance = TRUE) : 138 non-positive fis 3: In summary.rq(x, se = "nid", covariance = TRUE) : 206 non-positive fis 4: In summary.rq(x, se = "nid", covariance = TRUE) : 53 non-positive fis 5: In summary.rq(x, se = "nid", covariance = TRUE) : 30 non-positive fis* -- View this message in context: http://r.789695.n4.nabble.com/about-error-while-using-anova-function-tp4159463p4159463.html Sent from the R help mailing list archive at Nabble.com. From narendarcse007 at gmail.com Mon Dec 5 08:18:03 2011 From: narendarcse007 at gmail.com (narendarreddy kalam) Date: Sun, 4 Dec 2011 23:18:03 -0800 (PST) Subject: [R] about interpretation of anova results... Message-ID: <1323069483773-4159510.post@n4.nabble.com> quantreg package is used. *fit1 results are* Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.15, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.191528450 0.005276347 0.021414032 0.016034803 0.007510343 0.005276347 inp6 inp7 inp8 inp9 0.058708544 0.005224906 0.006804871 -0.003931540 Degrees of freedom: 673 total; 663 residual *fit2 results are* Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.3, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 -1.111111e-01 5.776765e-19 4.635734e-18 1.874715e-18 2.099872e-18 inp5 inp6 inp7 inp8 inp9 -4.942052e-19 1.111111e-01 2.205289e-18 4.138435e-18 9.300642e-19 Degrees of freedom: 673 total; 663 residual anova(fit1,fit2); Quantile Regression Analysis of Deviance Table Model: op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9 Joint Test of Equality of Slopes: tau in { 0.15 0.3 } Df Resid Df F value Pr(>F) 1 9 1337 0.5256 0.8568 Warning messages: 1: In summary.rq(x, se = "nid", covariance = TRUE) : 93 non-positive fis 2: In summary.rq(x, se = "nid", covariance = TRUE) : 138 non-positive fis how to interpret the above results?? what is the use of anova function?? will it give the best among fit1 && fit2.. -- View this message in context: http://r.789695.n4.nabble.com/about-interpretation-of-anova-results-tp4159510p4159510.html Sent from the R help mailing list archive at Nabble.com. From jim at bitwrit.com.au Mon Dec 5 09:23:13 2011 From: jim at bitwrit.com.au (Jim Lemon) Date: Mon, 05 Dec 2011 19:23:13 +1100 Subject: [R] frequency table? In-Reply-To: <1322990509062-4156422.post@n4.nabble.com> References: <1322990509062-4156422.post@n4.nabble.com> Message-ID: <4EDC7F71.5030507@bitwrit.com.au> On 12/04/2011 08:21 PM, set wrote: > Hello R-users, > > I've got a file with individuals as colums and the clusters where they occur > in as rows. And I wanted a table which tells me how many times each > individual occurs with another. I don't really know how such a table is > called...it is not a frequency table....My eventual goal is to make > Venn-diagrams from the occurence of my individuals. > > So I've this: > > cluster ind1 ind2 ind3 etc. > 1 0 1 2 > 2 3 0 1 > 3 1 1 1 > > And I want to go to this: > ind1 ind2 ind3 > ind1 0 4 2 > ind2 4 0 4 > ind3 2 4 1 > > is there a way to do this? Hi set, Your example is a bit hard to figure out. In particular, individual 1 seems to be in cluster 2 three times, and individual 3 in cluster 1 twice. I could understand it if the top table looked like this: cluster ind1 ind2 ind3 ... 1 0 1 1 ... 2 1 0 1 ... 3 1 1 1 ... That tells me that individual 1 is in cluster 2 and 3 but not in cluster 1, and so on. If you look at the first example in the intersectDiagram function in the plotrix package, you will see something similar, except that individuals are rows and common attributes (belonging to sets) are columns. You can get an intersection diagram from that showing how many individuals are in each combination of sets. This is similar to a Venn diagram, except that the population of each intersection is represented by the width of a rectangle and a text representation of that population. Thinking about it, maybe you are trying to represent both types of individuals (that is, there exists more than one of individual type 1 and so on) and attributes (belonging to clusters). In this case you are trying to get the intersections of two independent groups of sets. So, I created a dataset in which individuals can have personal characteristics (sex, age) and scholastic characteristics (which subjects they study). funnystuff<-data.frame(math=sample(c(0,1),100,TRUE), biology=sample(c(0,1),100,TRUE), english=sample(c(0,1),100,TRUE), sex=sample(c(0,1),100,TRUE), over18=sample(c(0,1),100,TRUE)) library(plotrix) intersectDiagram(funnystuff,main="Studies by sex and age",sep="\n") This gives me an interesting diagram from which I can get various intersections of these two groups of attributes. Is this what you are seeking? Jim From karajamu at hotmail.com Mon Dec 5 09:52:28 2011 From: karajamu at hotmail.com (karajamu) Date: Mon, 5 Dec 2011 09:52:28 +0100 Subject: [R] Spatstat - problem with which.marks and as.pp In-Reply-To: References: , Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Rob.Calver at informa.com Mon Dec 5 10:19:01 2011 From: Rob.Calver at informa.com (Calver, Rob) Date: Mon, 5 Dec 2011 09:19:01 -0000 Subject: [R] ANNOUNCEMENT: Call for Proposals for The R Series from Chapman & Hall/CRC Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From S.Ellison at LGCGroup.com Mon Dec 5 10:18:44 2011 From: S.Ellison at LGCGroup.com (S Ellison) Date: Mon, 5 Dec 2011 09:18:44 +0000 Subject: [R] [rggobi] ggplot like pdf output In-Reply-To: References: Message-ID: ________________________________________ > neither the *DescribeDisplay* package, nor *ggplot* are available in 2.13.2. ggplot's package name is ggplot2. It certainly _was_ available for 2.13.2. S******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} From bia.cdc at gmail.com Mon Dec 5 11:00:06 2011 From: bia.cdc at gmail.com (bcdc) Date: Mon, 5 Dec 2011 02:00:06 -0800 (PST) Subject: [R] iterative variable names Message-ID: <1323079206895-4159888.post@n4.nabble.com> Hi, I'm trying to assign iterative names to variable, but all my attempts have failed. I have a loop, and for every iteration, I need to create a variable, and I'd like to name them iteratively, such as: for(i in 1:10) { x_i <- c(values) } I need it to return ten variables: x_1, x_2, ..., x_10 How can I do it? Thank you very much! Beatriz -- View this message in context: http://r.789695.n4.nabble.com/iterative-variable-names-tp4159888p4159888.html Sent from the R help mailing list archive at Nabble.com. From ligges at statistik.tu-dortmund.de Mon Dec 5 11:18:39 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Mon, 05 Dec 2011 11:18:39 +0100 Subject: [R] iterative variable names In-Reply-To: <1323079206895-4159888.post@n4.nabble.com> References: <1323079206895-4159888.post@n4.nabble.com> Message-ID: <4EDC9A7F.8000208@statistik.tu-dortmund.de> On 05.12.2011 11:00, bcdc wrote: > Hi, > > I'm trying to assign iterative names to variable, but all my attempts have > failed. I have a loop, and for every iteration, I need to create a variable, > and I'd like to name them iteratively, such as: > > for(i in 1:10) > { > x_i<- c(values) > } You actually want to create a list of objects that you return in the end. Uwe Ligges > I need it to return ten variables: x_1, x_2, ..., x_10 > > How can I do it? > > Thank you very much! > Beatriz > > -- > View this message in context: http://r.789695.n4.nabble.com/iterative-variable-names-tp4159888p4159888.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From jholtman at gmail.com Mon Dec 5 11:23:25 2011 From: jholtman at gmail.com (Jim Holtman) Date: Mon, 5 Dec 2011 05:23:25 -0500 Subject: [R] iterative variable names In-Reply-To: <1323079206895-4159888.post@n4.nabble.com> References: <1323079206895-4159888.post@n4.nabble.com> Message-ID: <511429D6-561A-4EA6-95A1-44A936973BEE@gmail.com> ?assign for (i in 1:10) assign(paste('x_', i, sep = ''), i) but before you do this, consider using a 'list'; check the archives since this is asked a lot. Sent from my iPad On Dec 5, 2011, at 5:00, bcdc wrote: > Hi, > > I'm trying to assign iterative names to variable, but all my attempts have > failed. I have a loop, and for every iteration, I need to create a variable, > and I'd like to name them iteratively, such as: > > for(i in 1:10) > { > x_i <- c(values) > } > > I need it to return ten variables: x_1, x_2, ..., x_10 > > How can I do it? > > Thank you very much! > Beatriz > > -- > View this message in context: http://r.789695.n4.nabble.com/iterative-variable-names-tp4159888p4159888.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From Mintewab.Bezabih at economics.gu.se Mon Dec 5 11:28:26 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Mon, 5 Dec 2011 11:28:26 +0100 Subject: [R] problems using the thin plate spline method In-Reply-To: References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se>, Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> Dear Sarah and R users, Sorry again for not being explicit enough. Here is my full problem dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") dat names(dat) <- c("x1", "x2", "y") library(fields) plot (dat) #load the fields package (containing Tps) and fit a thin plate spline tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") What I meant when I said the graph works is when I do plot(dat) it does plot of all my three variables. If I do plot(x1,y), though, I get the 'object x1 not found' error message. Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled"). I get the same error message. I tried your suggestion of checking str(x1) and I get the same error message (object x1 not found). I also typed ls() and I get "dat" after that command. I followed the r tutorial guide to read my data and I am following the r tutorial to guide me to apply the thin plate spline method. Regards, Mintewab ________________________________________ Fr?n: Sarah Goslee [sarah.goslee at gmail.com] Skickat: den 4 december 2011 15:21 Till: Mintewab Bezabih Kopia: r-help at r-project.org ?mne: Re: [R] problems using the thin plate spline method Hello, On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih wrote: > Dear R users and Jeff, > > Sorry for not being quite explicit in my earlier message. And you are still not explicit. We have no idea what you've done. > My main problem is while my data seem to be read into R well (I manage to graph them and all), I cannot get the following line to work. > > tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") > > and I get the following error message > > Error in as.matrix(x) : > error in evaluating the argument 'x' in selecting a method for function 'as.matrix': Error: object 'x1' not found I'd have to guess that there's no object x1. What does ls() tell you? str(x1)? What do your data look like? You were already given instructions on how to include sample data to construct a reproducible example. You said that graphing your data worked; how did you do so? The posting guide and the advice you were already given were both offered for a reason. The querent needs to do the work of formulating an understandable and answerable question. Sarah > thanks for help > minti > ________________________________________ > Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] > Skickat: den 3 december 2011 17:45 > Till: Mintewab Bezabih; r-help at r-project.org > ?mne: Re: [R] problems using the thin plate spline method > > I can tell that you are puzzled and confused. Unfortunately, I am not psychic, so I cannot tell what you did, and therefore cannot tell where you went astray. > > The solution is for you to read the posting guide mentioned at the bottom of every R-help message. Spend a little time to create a small bit of data like yours if your actual data is large (subset and dput are useful for this). Remember to include the output of sessionInfo, and so on. Many times you are likely to find the answer yourself by going through these steps, but they are essential for communication. > > Good luck. > Sent from my phone. Please excuse my brevity. > > Mintewab Bezabih wrote: > >>Dear R users, >> >>I am a beginner in R trying to apply the thin plate spline method to my >>climate data. I used the example in R to do so, and the lines seem to >>run fine ( I am not getting errors) but I am not getting any output in >>the form of graph or anything. I got a warning message saying that >>'surface extends beyond box'. >> >>Any help is much appreciated. >>thanks >>minti -- Sarah Goslee http://www.functionaldiversity.org From petr.pikal at precheza.cz Mon Dec 5 11:44:27 2011 From: petr.pikal at precheza.cz (Petr PIKAL) Date: Mon, 5 Dec 2011 11:44:27 +0100 Subject: [R] Data alignment In-Reply-To: <1322915587713-4153112.post@n4.nabble.com> References: <1322912606118-4153024.post@n4.nabble.com> <1322915587713-4153112.post@n4.nabble.com> Message-ID: > > Re: [R] Data alignment > > Thanks for your suggestions. I will try them. > > The "-" in my original post was actually only there to serve as a separator > so that it is easier for you to see the data structure but apparently it > rather confused you... sorry :) That is why dput is to be used. Try this by yourself > dput(y) structure(c(2L, 1L, 1L, NA, 2L, 1L, NA, NA, 2L, NA, NA, NA, NA, 1L, NA, NA, NA, 2L, NA, 1L, NA, 2L, NA, 3L, NA), .Dim = c(5L, 5L), .Dimnames = list(NULL, c("", "BMW", "Mercedes", "VW", "Skoda" ))) x<-structure(c(2L, 1L, 1L, NA, 2L, 1L, NA, NA, 2L, NA, NA, NA, NA, 1L, NA, NA, NA, 2L, NA, 1L, NA, 2L, NA, 3L, NA), .Dim = c(5L, 5L), .Dimnames = list(NULL, c("", "BMW", "Mercedes", "VW", "Skoda" ))) > all.equal(x,y) [1] TRUE > Regards Petr > > -- > View this message in context: http://r.789695.n4.nabble.com/Data- > alignment-tp4153024p4153112.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From petr.pikal at precheza.cz Mon Dec 5 11:55:22 2011 From: petr.pikal at precheza.cz (Petr PIKAL) Date: Mon, 5 Dec 2011 11:55:22 +0100 Subject: [R] problem merging data with different shapes In-Reply-To: <20111204140218.183110@gmx.net> References: <20111204140218.183110@gmx.net> Message-ID: Hi > > > I have been trying to merge datasets, one of which has a long format > (Adata) and one has a (different) long format (Bdata): > > Adata Bdata > subject order bpm subject order trial agegroup gender > 1 1 70.2 1 1 3 2 1 > 1 1 69.5 1 2 1 2 1 > 1 1 68.8 1 3 2 2 1 > 1 2 69.1 2 1 2 1 2 > 1 2 70 2 2 3 1 2 > 1 2 70.5 2 3 1 1 2 > 1 3 70.2 ... > 1 3 > 1 3 > 2 1 > 2 1 > ... ... > > In the end I would like to have a dataset that contains A unchanged with > the additional information from B added. > > subject order bpm trial agegroup gender > 1 1 70.2 3 2 1 > 1 1 69.5 3 2 1 > 1 1 68.8 3 2 1 > ... > I have tried: > newdataframe <- merge(Adata,Bdata, by= c("subject", "order"), sort = FALSE) Hm it seems that it should work. Try newdataframe <- merge(Adata,Bdata, by= c("subject", "order"), all=TRUE) Regards Petr > > For some reason, the trial column is not matched to the subject and order > information, despite them being identified as key-variables for the merge. > (The same is true for other variables, the actual dataset has more > variables and trials, but this is essentially the problem.) > So it results in something like: > subject order bpm trial agegroup gender > 1 1 70.2 3 2 1 > 1 1 69.5 2 2 1 > 1 1 68.8 1 2 1 > > What could be my mistake? > > Thank you VERY much. > Miriam > > > -- > > > > > -- > > ______________________________________________ > R-help at 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 code. From chapkovski at gmail.com Mon Dec 5 11:57:38 2011 From: chapkovski at gmail.com (Philipp Chapkovski) Date: Mon, 5 Dec 2011 11:57:38 +0100 Subject: [R] Problem with parsing HTML table Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jdnewmil at dcn.davis.ca.us Mon Dec 5 12:39:29 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Mon, 05 Dec 2011 06:39:29 -0500 Subject: [R] problems using the thin plate spline method In-Reply-To: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se>, <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> Message-ID: <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> Try plot( dat$x1, dat$y ) or plot( x1, y, data=dat ) Note that your example is still not reproducible because you have not supplied the data or a shortened version of your data for us to work with. Also, your problem is not with thin plates but with plot, and reading the help for that function by typing ?plot at the R command line would have provided you with more examples and usage info on how to get around this problem. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Mintewab Bezabih wrote: >Dear Sarah and R users, > >Sorry again for not being explicit enough. Here is my full problem > > >dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") >dat >names(dat) <- c("x1", "x2", "y") >library(fields) >plot (dat) > >#load the fields package (containing Tps) and fit a thin plate spline >tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") > >What I meant when I said the graph works is when I do plot(dat) it does >plot of all my three variables. If I do plot(x1,y), though, I get the >'object x1 not found' error message. > >Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, >scale.type="unscaled"). I get the same error message. > >I tried your suggestion of checking str(x1) and I get the same error >message (object x1 not found). >I also typed ls() and I get "dat" after that command. > >I followed the r tutorial guide to read my data and I am following the >r tutorial to guide me to apply the thin plate spline method. > >Regards, > >Mintewab >________________________________________ >Fr?n: Sarah Goslee [sarah.goslee at gmail.com] >Skickat: den 4 december 2011 15:21 >Till: Mintewab Bezabih >Kopia: r-help at r-project.org >?mne: Re: [R] problems using the thin plate spline method > >Hello, > >On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih > wrote: >> Dear R users and Jeff, >> >> Sorry for not being quite explicit in my earlier message. > >And you are still not explicit. We have no idea what you've done. > >> My main problem is while my data seem to be read into R well (I >manage to graph them and all), I cannot get the following line to work. >> >> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >> >> and I get the following error message >> >> Error in as.matrix(x) : >> error in evaluating the argument 'x' in selecting a method for >function 'as.matrix': Error: object 'x1' not found > >I'd have to guess that there's no object x1. What does ls() tell you? >str(x1)? > >What do your data look like? You were already given instructions on how >to >include sample data to construct a reproducible example. You said that >graphing your data worked; how did you do so? > >The posting guide and the advice you were already given were both >offered for a reason. The querent needs to do the work of formulating >an understandable and answerable question. > >Sarah > >> thanks for help >> minti >> ________________________________________ >> Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] >> Skickat: den 3 december 2011 17:45 >> Till: Mintewab Bezabih; r-help at r-project.org >> ?mne: Re: [R] problems using the thin plate spline method >> >> I can tell that you are puzzled and confused. Unfortunately, I am not >psychic, so I cannot tell what you did, and therefore cannot tell where >you went astray. >> >> The solution is for you to read the posting guide mentioned at the >bottom of every R-help message. Spend a little time to create a small >bit of data like yours if your actual data is large (subset and dput >are useful for this). Remember to include the output of sessionInfo, >and so on. Many times you are likely to find the answer yourself by >going through these steps, but they are essential for communication. >> >> Good luck. >> Sent from my phone. Please excuse my brevity. >> >> Mintewab Bezabih wrote: >> >>>Dear R users, >>> >>>I am a beginner in R trying to apply the thin plate spline method to >my >>>climate data. I used the example in R to do so, and the lines seem to >>>run fine ( I am not getting errors) but I am not getting any output >in >>>the form of graph or anything. I got a warning message saying that >>>'surface extends beyond box'. >>> >>>Any help is much appreciated. >>>thanks >>>minti > > >-- >Sarah Goslee >http://www.functionaldiversity.org > >______________________________________________ >R-help at 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 code. From void1999 at gmail.com Mon Dec 5 12:42:12 2011 From: void1999 at gmail.com (zz dd) Date: Mon, 5 Dec 2011 12:42:12 +0100 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From nvanzuydam at gmail.com Mon Dec 5 12:32:10 2011 From: nvanzuydam at gmail.com (natalie.vanzuydam) Date: Mon, 5 Dec 2011 03:32:10 -0800 (PST) Subject: [R] Subsetting a data frame Message-ID: <1323084730989-4160127.post@n4.nabble.com> Hi R users, I really need help with subsetting data frames: I have a large database of medical records and I want to be able to match patterns from a list of search terms . I've used this simplified data frame in a previous example: db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1, 2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 = c(1.1, 28, 9, 1.2)), .Names = c("ind", "test1", "test2", "test3"), class = "data.frame", row.names = c(NA, -4L)) terms_include <- c("1","2","3") terms_exclude <- c("1.1","1.2","1.3") So in this example I want to include all the terms from terms include as long as they don't occur with terms exclude in the same row of the data frame. Previously I was given this function which works very well if you want to match exactly: f <- function(x) !any(x %in% terms_exclude) && any(x %in% terms_include) db[apply(db[, -1], 1, f), ] ind test1 test2 test3 2 ind2 2 27 28.0 4 ind4 3 2 1.2 I would like to know if there is a way to write a similar function that looks for matches that start with the query string: as in grepl("^pattern",x) I started writing a function but am not sure how to get it to return the dataframe or matrix: for (i in 1:length(terms_include)){ db_new <- apply(db,2, grepl,pattern=i) } Applying this function gives me: db_new <- structure(c(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), .Dim = c(4L, 4L), .Dimnames = list(NULL, c("ind", "test1", "test2", "test3" ))) So the above is searching the pattern anywhere in the dataframe instead of just at the beginning of the string. How would I incorporate look for terms to include but don't return the row of the data frame if it also includes one of the terms to exclude while using partial matching? I hope that this makes sense. Many thanks, Natalie ----- Natalie Van Zuydam PhD Student University of Dundee nvanzuydam at dundee.ac.uk -- View this message in context: http://r.789695.n4.nabble.com/Subsetting-a-data-frame-tp4160127p4160127.html Sent from the R help mailing list archive at Nabble.com. From jdnewmil at dcn.davis.ca.us Mon Dec 5 12:48:35 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Mon, 05 Dec 2011 06:48:35 -0500 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: Message-ID: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> This is not a homework help list. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. zz dd wrote: >Hello >The solution maybe there but i need to compute it into R if someone can >help me : >(Previously store score vector t in score matrix T; store loading >vector p >in loading matrix P) that's done by nipals in chemometrics >After use of nipals function you have T and P matrix > >First : "Calculate the residual matrix of X. Stop if the elements of >Xres >are very small >because no further PCA components are reasonable" : >Xres= X-u.b(T) > >u : improved score vector >b: loading vector >X : a mean-centered matrix > >Second : Replace X with Xres and continue with step 2 (with nipals >chemometrics...) for calculation of the next PCA >component. > >If someone can help me ? >Thank's a lot > > >2011/12/1 zz dd > >> Hello >> i need some precision about nipals in the chemometrics package in R . >> >> When i use nipals in chemometrics i obtain T and P matrix. >> >> I really don't understand what to do with these two matrix to obtain >> the scores for every the component (like in spss fo example) >> >> Comp1 Comp2 Comp3 >> quest1 0,8434 0,54333 0,3466 >> quest2 0,665 0,7655 0,433 >> >> Thank you very much for your help >> (I know that X=TP+E)... But don't understand else.... >> > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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 code. From Mintewab.Bezabih at economics.gu.se Mon Dec 5 12:54:25 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Mon, 5 Dec 2011 12:54:25 +0100 Subject: [R] problems using the thin plate spline method In-Reply-To: <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se>, <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se>, <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D5@HGUMAIL6.hgu.gu.se> Dear Jeff and R users, Thanks Jeff. Your first plot suggestion worked. And when I stick dat$x1, dat$x2,dat$y, tpsfit seems to work as well. But it gives me a new error message tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") Warning message: In gcv.Krig(out, nstep.cv = nstep.cv, verbose = verbose, cost = out$cost, : Value of pure error estimate is outside possible range Then I get error messages for the subsequent lines as well. I have now attached the data. And here is the full code I am trying to run. dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") names(dat) <- c("x1", "x2", "y") library(fields) plot (dat) #load the fields package (containing Tps) and fit a thin plate spline tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") #predict the thin plate spline on the fine grid and plot the fitting ngrid <- length(xf); grid <- cbind(rep(xf, ngrid), rep(xf, rep(ngrid, ngrid))) out.p1 <- predict(tpsfit, grid) persp(xf, xf, matrix(out.p1, ngrid, ngrid, byrow=F), theta=130, phi=20, expand=0.45, xlab="x1", ylab="x2", zlab="y", xlim=c(0,1), ylim=c(0,1), zlim=range(zf), ticktype="detailed", scale=F, main="gcv fitting") Many thanks once again. regards mintewab Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] Skickat: den 5 december 2011 12:39 Till: Mintewab Bezabih; Sarah Goslee Kopia: r-help at r-project.org ?mne: Re: [R] problems using the thin plate spline method Try plot( dat$x1, dat$y ) or plot( x1, y, data=dat ) Note that your example is still not reproducible because you have not supplied the data or a shortened version of your data for us to work with. Also, your problem is not with thin plates but with plot, and reading the help for that function by typing ?plot at the R command line would have provided you with more examples and usage info on how to get around this problem. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Mintewab Bezabih wrote: >Dear Sarah and R users, > >Sorry again for not being explicit enough. Here is my full problem > > >dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") >dat >names(dat) <- c("x1", "x2", "y") >library(fields) >plot (dat) > >#load the fields package (containing Tps) and fit a thin plate spline >tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") > >What I meant when I said the graph works is when I do plot(dat) it does >plot of all my three variables. If I do plot(x1,y), though, I get the >'object x1 not found' error message. > >Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, >scale.type="unscaled"). I get the same error message. > >I tried your suggestion of checking str(x1) and I get the same error >message (object x1 not found). >I also typed ls() and I get "dat" after that command. > >I followed the r tutorial guide to read my data and I am following the >r tutorial to guide me to apply the thin plate spline method. > >Regards, > >Mintewab >________________________________________ >Fr?n: Sarah Goslee [sarah.goslee at gmail.com] >Skickat: den 4 december 2011 15:21 >Till: Mintewab Bezabih >Kopia: r-help at r-project.org >?mne: Re: [R] problems using the thin plate spline method > >Hello, > >On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih > wrote: >> Dear R users and Jeff, >> >> Sorry for not being quite explicit in my earlier message. > >And you are still not explicit. We have no idea what you've done. > >> My main problem is while my data seem to be read into R well (I >manage to graph them and all), I cannot get the following line to work. >> >> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >> >> and I get the following error message >> >> Error in as.matrix(x) : >> error in evaluating the argument 'x' in selecting a method for >function 'as.matrix': Error: object 'x1' not found > >I'd have to guess that there's no object x1. What does ls() tell you? >str(x1)? > >What do your data look like? You were already given instructions on how >to >include sample data to construct a reproducible example. You said that >graphing your data worked; how did you do so? > >The posting guide and the advice you were already given were both >offered for a reason. The querent needs to do the work of formulating >an understandable and answerable question. > >Sarah > >> thanks for help >> minti >> ________________________________________ >> Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] >> Skickat: den 3 december 2011 17:45 >> Till: Mintewab Bezabih; r-help at r-project.org >> ?mne: Re: [R] problems using the thin plate spline method >> >> I can tell that you are puzzled and confused. Unfortunately, I am not >psychic, so I cannot tell what you did, and therefore cannot tell where >you went astray. >> >> The solution is for you to read the posting guide mentioned at the >bottom of every R-help message. Spend a little time to create a small >bit of data like yours if your actual data is large (subset and dput >are useful for this). Remember to include the output of sessionInfo, >and so on. Many times you are likely to find the answer yourself by >going through these steps, but they are essential for communication. >> >> Good luck. >> Sent from my phone. Please excuse my brevity. >> >> Mintewab Bezabih wrote: >> >>>Dear R users, >>> >>>I am a beginner in R trying to apply the thin plate spline method to >my >>>climate data. I used the example in R to do so, and the lines seem to >>>run fine ( I am not getting errors) but I am not getting any output >in >>>the form of graph or anything. I got a warning message saying that >>>'surface extends beyond box'. >>> >>>Any help is much appreciated. >>>thanks >>>minti > > >-- >Sarah Goslee >http://www.functionaldiversity.org > >______________________________________________ >R-help at 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 code. From chapkovski at gmail.com Mon Dec 5 13:03:42 2011 From: chapkovski at gmail.com (Philipp Chapkovski) Date: Mon, 5 Dec 2011 13:03:42 +0100 Subject: [R] how to just download file on disk by the link Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From julia.lira at hotmail.co.uk Mon Dec 5 13:14:16 2011 From: julia.lira at hotmail.co.uk (Julia Lira) Date: Mon, 5 Dec 2011 12:14:16 +0000 Subject: [R] extract cov matrix in summary.rq and use as a matrix. Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From E.Vettorazzi at uke.de Mon Dec 5 13:21:42 2011 From: E.Vettorazzi at uke.de (Eik Vettorazzi) Date: Mon, 5 Dec 2011 13:21:42 +0100 Subject: [R] Toggle cASE In-Reply-To: <1323069111.20601.YahooMailNeo@web130111.mail.mud.yahoo.com> References: <1323069111.20601.YahooMailNeo@web130111.mail.mud.yahoo.com> Message-ID: <4EDCB756.2080509@uke.de> Hi Antonio, how about this: txt2 <- "useRs may fly into JFK or laGuardia" chartr("a-zA-Z", "A-Za-z", txt2) Cheers. Am 05.12.2011 08:11, schrieb Tonio: > Hello R-help list, > > I am looking for way to toggle the case of the characters like a flip-flop; that is from ''Hello'' to "hELLO" or vice versa. > > I know that there are a number of functions like casefold, tolower, toupper, etc. but these functions change the case in an uniform way. > > Thanks in advance, > > Antonio Rivero Ostoic > > > > > Antonio Rivero Ostoic > PhD Student, Department of Leadership and Strategy > From 1 Jul until 31 Dec 2011 > Tel. +61 3 8344 4300 > Fax +61 3 9347 6618 > Email jaro at sdu.dk > Addr. The University of Melbourne, Victoria 3010 Australia > ------------------------------------------------------------- > UNIVERSITY OF SOUTHERN DENMARK > Sdr. Stationsvej 28 ? DK-4200 Slagelse ? Denmark ? Tel. +45 6550 1000 ? > www.sdu.dk > > [[alternative HTML version deleted]] > > > > > ______________________________________________ > R-help at 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 code. -- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus From ggrothendieck at gmail.com Mon Dec 5 13:24:47 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Mon, 5 Dec 2011 07:24:47 -0500 Subject: [R] how to just download file on disk by the link In-Reply-To: References: Message-ID: On Mon, Dec 5, 2011 at 7:03 AM, Philipp Chapkovski wrote: > Sorry for stupid question but is there any way to just download file (excel > file) from the url to the disk with a certain name? > Now it seems that I should open it (via read.xls) and then write it by > write.xls. But I am pretty sure it should be something much easier? > read.xls in the gdata package can take the url of an Excel file and will read it into R. (It transparently downloads it into a temporary file and then reads it from there.) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From void1999 at gmail.com Mon Dec 5 13:27:12 2011 From: void1999 at gmail.com (zz dd) Date: Mon, 5 Dec 2011 13:27:12 +0100 Subject: [R] nipals in the chemometrics package in R In-Reply-To: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> References: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Marianne.ZEYRINGER at ec.europa.eu Mon Dec 5 13:44:14 2011 From: Marianne.ZEYRINGER at ec.europa.eu (Marianne.ZEYRINGER at ec.europa.eu) Date: Mon, 5 Dec 2011 13:44:14 +0100 Subject: [R] spatial analysis Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Mon Dec 5 13:55:45 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 07:55:45 -0500 Subject: [R] extract cov matrix in summary.rq and use as a matrix. In-Reply-To: References: Message-ID: I'm not at my desk so this is untested, but I'm pretty sure double brackets will do the trick: qf2_1[[3]] M On Dec 5, 2011, at 7:14 AM, Julia Lira wrote: > > Dear all, > > I need to extract the covariance matrix of my quantile regression estimation to use in a test. My regression is: > > qf2_1 <- summary(rq(wb2 ~ apv2 + vol2, tau = phi2[1]), cov = TRUE) > > I can extract the covaraince matrix by using: qf2_1 [3]. However, if I try to use it in the test, it does not work. I only need to transform qf2_1[3] in a matrix 3x3. I have already tried: matrix(qf2_1[3], nrow=3, ncol=3) but it also does not work. By using the latter, I find: > [,1] [,2] [,3] > [1,] Numeric,9 Numeric,9 Numeric,9 > [2,] Numeric,9 Numeric,9 Numeric,9 > [3,] Numeric,9 Numeric,9 Numeric,9 > > Is there any other way to do it? > > Thanks a lot in advance! > > All the best, > > Julia > > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 14:02:15 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 08:02:15 -0500 Subject: [R] equating approximate values In-Reply-To: <1323043462928-4158691.post@n4.nabble.com> References: <1323021640135-4157551.post@n4.nabble.com> <1323043462928-4158691.post@n4.nabble.com> Message-ID: <7DDE0973-E5AF-4299-87D6-EF46555EBB74@gmail.com> Change which to which.min, but then you won't easily be able to get the corresponding x,y indices. Look at the arrayInd() function to translate the result to a particular x,y. Michael On Dec 4, 2011, at 7:04 PM, vamshi999 wrote: > this is exactly what i wanted. > > How to i select only the minimum value from this?. > > thank you > > > > > My apologies: you need an abs() call as well: > > which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) > > Michael > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4158691.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 14:04:36 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 08:04:36 -0500 Subject: [R] problems using the thin plate spline method In-Reply-To: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D5@HGUMAIL6.hgu.gu.se> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D5@HGUMAIL6.hgu.gu.se> Message-ID: <292964CB-7BD6-4F59-BC60-1256C3571180@gmail.com> Your data was scrubbed by the server. Use dput() to create a plain text representation of dat you can put in the body of the email. Michael On Dec 5, 2011, at 6:54 AM, Mintewab Bezabih wrote: > Dear Jeff and R users, > > Thanks Jeff. > > Your first plot suggestion worked. And when I stick dat$x1, dat$x2,dat$y, tpsfit seems to work as well. But it gives me a new error message > > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > Warning message: > In gcv.Krig(out, nstep.cv = nstep.cv, verbose = verbose, cost = out$cost, : > Value of pure error estimate is outside possible range > > Then I get error messages for the subsequent lines as well. > > I have now attached the data. And here is the full code I am trying to run. > > > dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") > names(dat) <- c("x1", "x2", "y") > library(fields) > plot (dat) > > #load the fields package (containing Tps) and fit a thin plate spline > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > #predict the thin plate spline on the fine grid and plot the fitting > ngrid <- length(xf); grid <- cbind(rep(xf, ngrid), rep(xf, rep(ngrid, ngrid))) > out.p1 <- predict(tpsfit, grid) > > > persp(xf, xf, matrix(out.p1, ngrid, ngrid, byrow=F), theta=130, phi=20, > expand=0.45, xlab="x1", ylab="x2", zlab="y", xlim=c(0,1), ylim=c(0,1), > zlim=range(zf), ticktype="detailed", scale=F, main="gcv fitting") > > Many thanks once again. > > regards > mintewab > > > > Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] > Skickat: den 5 december 2011 12:39 > Till: Mintewab Bezabih; Sarah Goslee > Kopia: r-help at r-project.org > ?mne: Re: [R] problems using the thin plate spline method > > Try > > plot( dat$x1, dat$y ) > > or > > plot( x1, y, data=dat ) > > Note that your example is still not reproducible because you have not supplied the data or a shortened version of your data for us to work with. Also, your problem is not with thin plates but with plot, and reading the help for that function by typing > > ?plot > > at the R command line would have provided you with more examples and usage info on how to get around this problem. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN: Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Mintewab Bezabih wrote: > >> Dear Sarah and R users, >> >> Sorry again for not being explicit enough. Here is my full problem >> >> >> dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") >> dat >> names(dat) <- c("x1", "x2", "y") >> library(fields) >> plot (dat) >> >> #load the fields package (containing Tps) and fit a thin plate spline >> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >> >> What I meant when I said the graph works is when I do plot(dat) it does >> plot of all my three variables. If I do plot(x1,y), though, I get the >> 'object x1 not found' error message. >> >> Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, >> scale.type="unscaled"). I get the same error message. >> >> I tried your suggestion of checking str(x1) and I get the same error >> message (object x1 not found). >> I also typed ls() and I get "dat" after that command. >> >> I followed the r tutorial guide to read my data and I am following the >> r tutorial to guide me to apply the thin plate spline method. >> >> Regards, >> >> Mintewab >> ________________________________________ >> Fr?n: Sarah Goslee [sarah.goslee at gmail.com] >> Skickat: den 4 december 2011 15:21 >> Till: Mintewab Bezabih >> Kopia: r-help at r-project.org >> ?mne: Re: [R] problems using the thin plate spline method >> >> Hello, >> >> On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih >> wrote: >>> Dear R users and Jeff, >>> >>> Sorry for not being quite explicit in my earlier message. >> >> And you are still not explicit. We have no idea what you've done. >> >>> My main problem is while my data seem to be read into R well (I >> manage to graph them and all), I cannot get the following line to work. >>> >>> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >>> >>> and I get the following error message >>> >>> Error in as.matrix(x) : >>> error in evaluating the argument 'x' in selecting a method for >> function 'as.matrix': Error: object 'x1' not found >> >> I'd have to guess that there's no object x1. What does ls() tell you? >> str(x1)? >> >> What do your data look like? You were already given instructions on how >> to >> include sample data to construct a reproducible example. You said that >> graphing your data worked; how did you do so? >> >> The posting guide and the advice you were already given were both >> offered for a reason. The querent needs to do the work of formulating >> an understandable and answerable question. >> >> Sarah >> >>> thanks for help >>> minti >>> ________________________________________ >>> Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] >>> Skickat: den 3 december 2011 17:45 >>> Till: Mintewab Bezabih; r-help at r-project.org >>> ?mne: Re: [R] problems using the thin plate spline method >>> >>> I can tell that you are puzzled and confused. Unfortunately, I am not >> psychic, so I cannot tell what you did, and therefore cannot tell where >> you went astray. >>> >>> The solution is for you to read the posting guide mentioned at the >> bottom of every R-help message. Spend a little time to create a small >> bit of data like yours if your actual data is large (subset and dput >> are useful for this). Remember to include the output of sessionInfo, >> and so on. Many times you are likely to find the answer yourself by >> going through these steps, but they are essential for communication. >>> >>> Good luck. >>> Sent from my phone. Please excuse my brevity. >>> >>> Mintewab Bezabih wrote: >>> >>>> Dear R users, >>>> >>>> I am a beginner in R trying to apply the thin plate spline method to >> my >>>> climate data. I used the example in R to do so, and the lines seem to >>>> run fine ( I am not getting errors) but I am not getting any output >> in >>>> the form of graph or anything. I got a warning message saying that >>>> 'surface extends beyond box'. >>>> >>>> Any help is much appreciated. >>>> thanks >>>> minti >> >> >> -- >> Sarah Goslee >> http://www.functionaldiversity.org >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From bia.cdc at gmail.com Mon Dec 5 13:25:14 2011 From: bia.cdc at gmail.com (bcdc) Date: Mon, 5 Dec 2011 04:25:14 -0800 (PST) Subject: [R] iterative variable names In-Reply-To: <511429D6-561A-4EA6-95A1-44A936973BEE@gmail.com> References: <1323079206895-4159888.post@n4.nabble.com> <511429D6-561A-4EA6-95A1-44A936973BEE@gmail.com> Message-ID: <1323087914497-4160262.post@n4.nabble.com> Thank you very much, assign was exactly what I needed! For my case, it worked better than list! :) Beatriz -- View this message in context: http://r.789695.n4.nabble.com/iterative-variable-names-tp4159888p4160262.html Sent from the R help mailing list archive at Nabble.com. From amsaya2000 at gmail.com Mon Dec 5 13:53:38 2011 From: amsaya2000 at gmail.com (Amsalu Walelign) Date: Mon, 5 Dec 2011 15:53:38 +0300 Subject: [R] Dynamic Linear Models for Times Series - Implemented? Message-ID: Dear sir, As far as my understanding goes, the book ?dynamic linear models with R? does everything based up on the non innovations form. The problem is that I couldn?t find auxiliary residuals, which can be used to check for the presence of outliers and structural breaks. R packages ?dlm? and ?dlmodeler? use this form of model construction. Hence I am stuck in the middle of my work. Is there some R package which performs disturbance smoothing, or use the innovations form? Thanks beforehand! Amsaya From jholtman at gmail.com Mon Dec 5 14:10:35 2011 From: jholtman at gmail.com (jim holtman) Date: Mon, 5 Dec 2011 08:10:35 -0500 Subject: [R] Subsetting a data frame In-Reply-To: <1323084730989-4160127.post@n4.nabble.com> References: <1323084730989-4160127.post@n4.nabble.com> Message-ID: does this do what you want: > db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1, + 2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 = c(1.1, 28, + 9, 1.2)), .Names = c("ind", "test1", "test2", "test3"), class = + "data.frame", row.names = c(NA, + -4L)) > > terms_include <- c("1","2","3") > terms_exclude <- c("1.1","1.2","1.3") > > f.match <- function(obj, inc, exc){ + pat <- paste("^(", paste(inc, collapse = "|"), ")", sep = '') + patex <- paste(exc, collapse = "|") + isMatch <- apply(obj, 1, function(x) any(grepl(pat, x))) + notMatch <- !apply(obj, 1, function(x) any(grepl(patex, x))) + obj[isMatch & notMatch,] + } > > db ind test1 test2 test3 1 ind1 1.0 56 1.1 2 ind2 2.0 27 28.0 3 ind3 1.3 58 9.0 4 ind4 3.0 2 1.2 > f.match(db, terms_include, terms_exclude) ind test1 test2 test3 2 ind2 2 27 28 > On Mon, Dec 5, 2011 at 6:32 AM, natalie.vanzuydam wrote: > Hi R users, > > I really need help with subsetting ?data frames: > > I have a large database of medical records and I want to be able to match > patterns from a list of search terms . > > I've used this simplified data frame in a previous example: > > > db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1, > 2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 = c(1.1, 28, > 9, 1.2)), .Names = c("ind", "test1", "test2", "test3"), class = > "data.frame", row.names = c(NA, > -4L)) > > terms_include <- c("1","2","3") > terms_exclude <- c("1.1","1.2","1.3") > > > So in this example I want to include all the terms from terms include as > long as they don't occur with terms exclude in the same row of the data > frame. > > Previously I was given this function which works very well if you want to > match exactly: > > > f <- function(x) ?!any(x %in% terms_exclude) && any(x %in% terms_include) > db[apply(db[, -1], 1, f), ] > > ? ind test1 test2 test3 > 2 ind2 ? ? 2 ? ?27 ?28.0 > 4 ind4 ? ? 3 ? ? 2 ? 1.2 > > > I would like to know if there is a way to write a similar function that > looks for matches that start with the query string: ?as in > grepl("^pattern",x) > > I started writing a function but am not sure how to get it to return the > dataframe or matrix: > > > for (i in 1:length(terms_include)){ > db_new <- apply(db,2, grepl,pattern=i) > } > > Applying this function gives me: > > db_new <- structure(c(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, > FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), .Dim = c(4L, > 4L), .Dimnames = list(NULL, c("ind", "test1", "test2", "test3" > ))) > > So the above is searching the pattern anywhere in the dataframe instead of > just at the beginning of the string. > > How would I incorporate look for terms to include but don't return the row > of the data frame if it also includes one of the terms to exclude while > using partial matching? > > I hope that this makes sense. > > Many thanks, > Natalie > > ----- > Natalie Van Zuydam > > PhD Student > University of Dundee > nvanzuydam at dundee.ac.uk > -- > View this message in context: http://r.789695.n4.nabble.com/Subsetting-a-data-frame-tp4160127p4160127.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From therneau at mayo.edu Mon Dec 5 14:24:03 2011 From: therneau at mayo.edu (Terry Therneau) Date: Mon, 05 Dec 2011 07:24:03 -0600 Subject: [R] Partitioning Around Mediods then rpart to follow In-Reply-To: References: Message-ID: <1323091443.1719.3.camel@nemo> Yes, that seems like a sensible idea to me. Terry Therneau On Sat, 2011-12-03 at 12:00 +0100, r-help-request at r-project.org wrote: > The problem: There are no a priori groupings to run a classification > on > > My solution: > > This is a non-R code question, so I appreciate any thoughts. I have > used pam in the cluster package proceeded by sillohouette to find the > optimum number of clusters on scaled and centered data. I have > followed > this by a classification tree analysis with rpart to discern which > variables drive the clustering on the original data. Is this a > sensible > approach? > many thanks, > > Stephen Sefick > From Mintewab.Bezabih at economics.gu.se Mon Dec 5 14:24:58 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Mon, 5 Dec 2011 14:24:58 +0100 Subject: [R] problems using the thin plate spline method In-Reply-To: <292964CB-7BD6-4F59-BC60-1256C3571180@gmail.com> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D5@HGUMAIL6.hgu.gu.se>, <292964CB-7BD6-4F59-BC60-1256C3571180@gmail.com> Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D6@HGUMAIL6.hgu.gu.se> Thanks Michael here is my data structure(list(x1 = c(409.5, 349, 385.5, 273, 543, 746, 198.75, 262.5, 320.5, 259, 399.5, 595.5, 374, 293, 330, 658, 299, 775, 559.75, 251, 402, 395.5, 345.5, 283.5, 452, 816.5, 266.5, 360.25, 386, 160.25, 360, 337, 326, 758, 342.5, 389, 347.5, 819.25, 355.25, 281, 494.5, 514.5, 263, 439, 263, 373.25, 546, 348, 380.5, 606, 460, 352.5, 737, 275, 520.5, 385.25, 354.5, 383.5, 322.5, 309, 502.5, 517, 276, 400.5, 272.5, NA, 253, 311, 389, 157.75, 520, 499.5, 481, 448.5, 335.5, 231.5, 492.5, 477.5, 650, 540.75, 620.5, 400.5, 331.5, 311, 229, 432.5, 422.75, 493.5, 414.25, 487, 369, 425, 233.5, 254.5, 417.5, NA, 583.25, 492.5, 490, 300.25, NA, 270, 307, 319, 374.5, 562.5, 569.5, 389.75, 341.25, 366, 262.75, 776.25, 379.5, 360, 203.75, 517, 539.5, 418.75, 353.5, 269, 475.5, 472, 342, 189, 492.5, 412, 467.5, 209.75, 340.75, 231.5, 185.5, 358.5, 354, 670.5, 686, 364, 138, 272, 183, 365.25, 188, 229.5, 553.5, 582.5, 469, 359.5, 284.25, 582.5, 287, NA, 455.25, 410.5, 477, 239, 313.5, 294.5, 523, 372.5, 231.5, NA, 365, 269.5, 394.5, 281.5, 418.5, 553.5, 245.75, 304, 423.75, 369.5, 330.5, 278, 257, 416.5, 413.25, 465.5, 877.25, 204, 475, 289, 425.75, 405, 494.25, 332, 552.5, 433.75, 821, 841.5, 226.5, 266.75, 552, 157.5, 528.5, 248.5, 245.5, 303, 444.25, 310, 768.25, 265.5, 98.25, 525, 407.75, 163.5, 374.25, 749, 318.5, 367, 250, 408, 341.5, 266.5, 348.5, 398.5, 429.5, 420, 263.5, 581.5, 509.5, 724.75, 476.5, 249.5, 297.5, 245, 139.5, 360.5, 983.5, 465.5, 263.75, NA, 510, 325, 122.5, 455.5, 531, 318, 373, 487, 401, 451.75, 561, 364.5, 439.5, 733.5, 455, 376.5, 554, 409.5, 1007.5, 462.5, 183, 342.5, 304, 258.25, 380.5, 373, 683, 577, 430, 324.25, 312, 389, 345, 358.5, 551.75, 317.5, 499, 335.5, 450.5, 363.5, 185, 177.5, 477.75, 644.5, 290.25, 457.5, 295.5, 266.5, 348.5, 357.75, 221.5, 739, 445.5, 416, 261.5, 909, 737.5, 194.5, 438.5, 358, 244, 388.5, 512.5, 315.25, 572, 473.75, 627.5, 507.75, 281, 511.5, 309.25, 308.25, 690, 180, 341.5, 273, 571, 694, 345, 497, 219, 311.5, 458.5, 283, 274, 282.5, 187.5, 332, 281.75, 397.75, 336.5, 392.5, 318, 609.5, 203.5, 144.5, 504.75, 647, 374, 149.5, 319, 306, 304.75, 304.5, 247, 329, 442, 308, 316, 219, 556.5, 643.5, 328.5, 301, 467, 452.5, 351.5, 373, 503.5, 287.5, 393.5, 444, 734, 458.5, 1182, 406, 286.5, 283.5, 642.5, 453.5, 206, 258, 412, 551, 784.75, 316.5, 326.5, 202.25, 336.75, 406, 225.5, 266, 916.5, 387, 496.25, 389, 668.5, 192, 396, 282.5, 414.5, 355, 294.5, 396.5, 348.75, 241.75, 347.5, 250, 473.5, 369, 672, 199.5, 318.25, 219.75, 124, 514.25, 600.5, 256, 574.75, 346.25, 397, 195, 494, 567.5, 431.5, 144.5, 440, 525.5, 375.5, 841.5, 386.25, 490.5, 296.5, 812.25, 385, 232.5, 239.25, 316.5, 312.25, 257.75, NA, 389, 301.5, 242.25, 400.25, 367.25, 321.5, 301, 223, 360, 662.5, 407.5, 736, 379.5, 852, 355, 397, 527.5, 531.25, 473, 559.75, 344, 379.75, 459, 322, 208.5, 424.25, 342.25, 414.5, 308, 574.5, 635, 449.5, 286, 986.25, 563.5, 596, 492, 265, 826.5, 557, 387.5, 531.5, 464, 582, 354.5, 382.75, 833, 347.25, 615.25, 389, 354.25, 564, 890.5, 168, 467.25, 554.5, 296, 744.5, 387.25, 393.25, 331, 391, 274, 707.75, 467.5, 160.5, 569.5, 340.5, 259, 321.75, 286.25, 416.5, 459.25, 276.5, 280.25, 258.5, 309.5, 424.5, 365, 809, 238.75, 524, 563.5, 419, 354.5, 303, 167.5, 236.25, 268, 330.5, 251.5, 249, 443.5, 411.5, 323.5, 485.25, 356.5, 221.5, 515.5, 462, 322.5, 602.5, 446.25, 489.75, 396.5, NA, 222.5, 365.5, 386, 286, 448, 379.75, 293.5, 410, 335.5, 444.5, 464.75, 364.25, 360, 589, 546.5, 470, 304.5, NA, 501.5, 459.5, 715, 349, 285, 268, 507.5, 441.5, 188.5, 186.5, 679, 249, 200, 419.5, 294.25, 596, 395.75, 314.75, 412.5, 363.75, 218.5, 208.5, 535.5, 309.75, 336, 217, 245.5, 608.75, 375, 555.5, 621, 488.5, 271.5, 331.5, 286, 555, 345, 529.5, 370, 584.25, 208.5, 473.5, 244, 296.25, 598, 456.25, 371, 505.5, 269.5, 284, 420.75, 358.25, 476.75, 363, 485.75, 570, 567.25, 355.5, 444, 629, 367.5, 174.5, 217, 239, 378.5, 179.5, 188, 355, 304.5, 354.5, 207.5, 615, 163.5, 374, 316.5, 79, 409, 218.25, 452, 398, 277.5, 289.25, 491, 515 ), x2 = c(673, 335, 1737, 457, 2325, 1255, 388, 104, 786, 516, 542, 916, 1257, 229, 490, 1016, 266, 1139, 1023, 153, 253, 319, 456, 400, 388, 941, 307, 683, 528, 368, 455, 488, 702, 1040, 405, 483, 524, 490, 517, 505, 844, 429, 349, 549, 450, 1212, 546, 485, 378, 598, 838, 519, 624, 185, 632, 696.5, 524, 618, 381, 380, 624, 612, 260, 831, 451, 284, 353, 720, 583, 344, 1175, 761, 694, 606, 239, 273, 394, 899, 721, 730, 1295, 1148, 524, 578, 262, 326, 217, 648, 485, 726, 747, 1663, 269, 488.5, 1137, 310, 434, 536, 486, 1225, 462, 237, 230, 242, 340, 521, 242, 389, 691, 387, 615, 1926, 597, 299, 213, 618, 684, 439, 459, 366, 1098, 384, 488, 181, 5342, 433, 1475, 480, 207, 153, 295, 524, 453, 978, 486, 676, 336, 254, 273, 255, 347, 420, 603, 739, 340, 572, 441, 833, 775, 129, 350, 1445, 328, 585, 412, 446, 679, 519, 372, 1712, 167, 492, 593, 210, 363, 630, 261, 869, 676, 253, 923, 791, 415, 349, 825, 486, 508, 191, 282, 267, 372, 639, 687, 1427, 847, 368, 616, 1723, 310, 449, 301, 378, 573, 273, 405, 653, 606, 943, 926, 399, 282, 1112, 484, 408, 434, 595, 223, 517, 323, 353, 628, 334, 502, 861, 361, 464, 285, 693, 129, 817, 516, 291, 211, 232, 269, 378, 2560.5, 662, 580, 531, 1334, 384, 217, 714, 766, 648, 288, 722, 917, 359, 576, 383, 546, 1379, 622, 201, 549, 575, 1416, 496, 111, 406, 519, 294, 343, 437, 972, 1403, 471, 368, 459, 617, 444, 312, 963, 315, 549, 1022, 423, 384, 195, 265, 827, 827, 309, 546, 385, 380, 422, 188, 378, 772, 233, 339, 952, 1336, 1740, 256, 772, 462, 254, 243, 332, 871, 562, 1761, 689, 623, 286, 233, 668, 1078, 682, 169, 437, 943, 724, 614, 439, 344, 297, 384, 569, 187, 498, 335, 339, 289, 431, 549, 334, 482, 363, 663, 192, 60, 468, 582, 365, 479, 983, 668, 605, 231, 457, 469, 664, 490, 274, 580, 476, 385, 302, 607, 1723, 441, 463, 229, 138, 279, 245, 1081, 1080, 1745, 1157, 338, 571, 211, 2256, 778, 224, 158, 393, 661.5, 4828, 478, 687, 497, 244, 455, 390, 271, 849, 316, 785, 464, 509, 338, 567, 726, 742, 515, 245, 501, 359, 220, 555, 424, 592, 1470, 441, 177, 1302, 245, 429, 597, 809, 835, 1548, 568, 310, 218, 904, 1276, 538, 315, 526, 604, 506, 1836, 365, 889, 508, 446, 999, 392, 189, 377, 335, 214, 469, 530, 197, 630, 814, 1305, 932, 753, 361, 1139, 639, 908, 1535, 483, 786, 476, 467, 703, 830, 565, 883, 1569, 1071, 261, 564, 645, 365, 587, 585, 395, 673, 940, 1002, 225, 1311, 471, 629, 433, 213, 1335, 662, 565, 1028, 442, 548, 418, 741, 798, 482, 595, 362, 580, 953, 1057, 171, 834, 466, 861, 1624, 648, 394, 1008, 626, 442, 530, 716, 211, 960.5, 511, 335, 452, 661, 303, 411, 336, 681, 450, 346, 417, 458, 1313, 795, 529, 203, 699, 500, 282, 339, 479, 361, 330, 366, 169, 882, 3209, 225, 1158, 701, 316, 646, 682, 414, 869, 761, 645, 641, 669, 260, 1155, 908, 878, 609, 519, 313, 527, 511, 538, 339, 803, 232, 773, 1739, 567, 248, 1375, 1340, 456, 1470, 459, 480, 396, 566, 668, 555, 198, 1479, 229, 227, 500, 560, 927, 412, 403, 397, 527, 385, 381, 582, 539, 426, 361, 1212, 624, 469, 294, 1194, 620, 234, 446, 177, 893, 489, 426, 699, 539, 486, 887, 321, 235, 501, 586, 509, 687, 520, 820, 758, 441, 876, 661, 638, 512, 518, 695, 397, 179, 450, 98, 94, 100, 216, 86, 149, 338, 324, 460, 124, 375, 255, 356, 263, 64, 374, 477, 664, 370, 416, 416, 741, 1136), y = c(1082.5, 684, 2122.5, 730, 2868, 2001, 586.75, 366.5, 1106.5, 775, 941.5, 1511.5, 1631, 522, 820, 1674, 565, 1914, 1582.75, 404, 655, 714.5, 801.5, 683.5, 840, 1757.5, 573.5, 1043.25, 914, 528.25, 815, 825, 1028, 1798, 747.5, 872, 871.5, 1309.25, 872.25, 786, 1338.5, 943.5, 612, 988, 713, 1585.25, 1092, 833, 758.5, 1204, 1298, 871.5, 1361, 460, 1152.5, 1081.75, 878.5, 1001.5, 703.5, 689, 1126.5, 1129, 513, 1231.5, 723.5, NA, 606, 1031, 972, 501.75, 1695, 1260.5, 1275, 1054.5, 574.5, 504.5, 886.5, 1376.5, 1371, 1270.75, 1915.5, 1548.5, 855.5, 889, 491, 758.5, 639.75, 1141.5, 899.25, 1213, 1116, 2088, 502.5, 743, 1554.5, NA, 1017.25, 1028.5, 976, 1525.25, NA, 507, 537, 561, 714.5, 1083.5, 811.5, 778.75, 1032.25, 753, 877.75, 2702.25, 976.5, 659, 416.75, 1135, 1223.5, 857.75, 812.5, 635, 1573.5, 856, 830, 370, 5834.5, 845, 1942.5, 689.75, 547.75, 384.5, 480.5, 882.5, 807, 1648.5, 1172, 1040, 474, 526, 456, 620.25, 535, 649.5, 1156.5, 1321.5, 809, 931.5, 725.25, 1415.5, 1062, NA, 805.25, 1855.5, 805, 824, 725.5, 740.5, 1202, 891.5, 603.5, NA, 532, 761.5, 987.5, 491.5, 781.5, 1183.5, 506.75, 1173, 1099.75, 622.5, 1253.5, 1069, 672, 765.5, 1238.25, 951.5, 1385.25, 395, 757, 556, 797.75, 1044, 1181.25, 1759, 1399.5, 801.75, 1437, 2564.5, 536.5, 715.75, 853, 535.5, 1101.5, 521.5, 650.5, 956, 1050.25, 1253, 1694.25, 664.5, 380.25, 1637, 891.75, 571.5, 808.25, 1344, 541.5, 884, 573, 761, 969.5, 600.5, 850.5, 1259.5, 790.5, 884, 548.5, 1274.5, 610.5, 1541.75, 992.5, 540.5, 508.5, 477, 408.5, 738.5, 3544, 1127.5, 843.75, NA, 1844, 709, 339.5, 1169.5, 1297, 966, 661, 1209, 1318, 810.75, 1137, 747.5, 985.5, 2112.5, 1077, 577.5, 1103, 984.5, 2423.5, 958.5, 294, 748.5, 823, 552.25, 723.5, 810, 1655, 1980, 901, 692.25, 771, 1006, 789, 670.5, 1514.75, 632.5, 1048, 1357.5, 873.5, 747.5, 380, 442.5, 1304.75, 1471.5, 599.25, 1003.5, 680.5, 646.5, 770.5, 545.75, 599.5, 1511, 678.5, 755, 1213.5, 2245, 2477.5, 450.5, 1210.5, 820, 498, 631.5, 844.5, 1186.25, 1134, 2234.75, 1316.5, 1130.75, 567, 744.5, 977.25, 1386.25, 1372, 349, 778.5, 1216, 1295, 1308, 784, 841, 516, 695.5, 1027.5, 470, 772, 617.5, 526.5, 621, 712.75, 946.75, 670.5, 874.5, 681, 1272.5, 395.5, 204.5, 972.75, 1229, 739, 658.5, 1302, 974, 909.75, 535.5, 704, 798, 1106, 798, 590, 799, 1032.5, 1028.5, 630.5, 908, 2190, 893.5, 814.5, 602, 641.5, 566.5, 638.5, 1525, 1814, 2203.5, 2339, 744, 857.5, 494.5, 2898.5, 1231.5, 430, 416, 805, 1212.5, 5612.75, 794.5, 1013.5, 699.25, 580.75, 861, 615.5, 537, 1765.5, 703, 1281.25, 853, 1177.5, 530, 963, 1008.5, 1156.5, 870, 539.5, 897.5, 707.75, 461.75, 902.5, 674, 1065.5, 1839, 1113, 376.5, 1620.25, 464.75, 553, 1111.25, 1409.5, 1091, 2122.75, 914.25, 707, 413, 1398, 1843.5, 969.5, 459.5, 966, 1129.5, 881.5, 2677.5, 751.25, 1379.5, 804.5, 1258.25, 1384, 624.5, 428.25, 693.5, 647.25, 471.75, NA, 919, 498.5, 872.25, 1214.25, 1672.25, 1253.5, 1054, 584, 1499, 1301.5, 1315.5, 2271, 862.5, 1638, 831, 864, 1230.5, 1361.25, 1038, 1442.75, 1913, 1450.75, 720, 886, 853.5, 789.25, 929.25, 999.5, 703, 1247.5, 1575, 1451.5, 511, 2297.25, 1034.5, 1225, 925, 478, 2161.5, 1219, 952.5, 1559.5, 906, 1130, 772.5, 1123.75, 1631, 829.25, 1210.25, 751, 934.25, 1517, 1947.5, 339, 1301.25, 1020.5, 1157, 2368.5, 1035.25, 787.25, 1339, 1017, 716, 1237.75, 1183.5, 371.5, 1530, 851.5, 594, 773.75, 947.25, 719.5, 870.25, 612.5, 961.25, 708.5, 655.5, 841.5, 823, 2122, 1033.75, 1053, 766.5, 1118, 854.5, 585, 506.5, 715.25, 629, 660.5, 617.5, 418, 1325.5, 3620.5, 548.5, 1643.25, 1057.5, 537.5, 1161.5, 1144, 736.5, 1471.5, 1207.25, 1134.75, 1037.5, NA, 482.5, 1520.5, 1294, 1164, 1057, 898.75, 606.5, 937, 846.5, 982.5, 803.75, 1167.25, 592, 1362, 2285.5, 1037, 552.5, NA, 1841.5, 915.5, 2185, 808, 765, 664, 1073.5, 1109.5, 743.5, 384.5, 2158, 478, 427, 919.5, 854.25, 1523, 807.75, 717.75, 809.5, 890.75, 603.5, 589.5, 1117.5, 848.75, 762, 578, 1457.5, 1232.75, 844, 849.5, 1815, 1108.5, 505.5, 777.5, 463, 1448, 834, 955.5, 1069, 1123.25, 694.5, 1360.5, 565, 531.25, 1099, 1042.25, 880, 1192.5, 789.5, 1104, 1178.75, 799.25, 1352.75, 1024, 1123.75, 1082, 1085.25, 1050.5, 841, 808, 817.5, 272.5, 311, 339, 594.5, 265.5, 337, 693, 628.5, 814.5, 331.5, 990, 418.5, 730, 579.5, 143, 783, 695.25, 1116, 768, 693.5, 705.25, 1232, 1651)), .Names = c("x1", "x2", "y"), class = "data.frame", row.names = c(NA, -629L)) mintewab ________________________________________ Fr?n: R. Michael Weylandt [michael.weylandt at gmail.com] Skickat: den 5 december 2011 14:04 Till: Mintewab Bezabih Kopia: Jeff Newmiller; Sarah Goslee; r-help at r-project.org ?mne: Re: [R] problems using the thin plate spline method Your data was scrubbed by the server. Use dput() to create a plain text representation of dat you can put in the body of the email. Michael On Dec 5, 2011, at 6:54 AM, Mintewab Bezabih wrote: > Dear Jeff and R users, > > Thanks Jeff. > > Your first plot suggestion worked. And when I stick dat$x1, dat$x2,dat$y, tpsfit seems to work as well. But it gives me a new error message > > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > Warning message: > In gcv.Krig(out, nstep.cv = nstep.cv, verbose = verbose, cost = out$cost, : > Value of pure error estimate is outside possible range > > Then I get error messages for the subsequent lines as well. > > I have now attached the data. And here is the full code I am trying to run. > > > dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") > names(dat) <- c("x1", "x2", "y") > library(fields) > plot (dat) > > #load the fields package (containing Tps) and fit a thin plate spline > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > #predict the thin plate spline on the fine grid and plot the fitting > ngrid <- length(xf); grid <- cbind(rep(xf, ngrid), rep(xf, rep(ngrid, ngrid))) > out.p1 <- predict(tpsfit, grid) > > > persp(xf, xf, matrix(out.p1, ngrid, ngrid, byrow=F), theta=130, phi=20, > expand=0.45, xlab="x1", ylab="x2", zlab="y", xlim=c(0,1), ylim=c(0,1), > zlim=range(zf), ticktype="detailed", scale=F, main="gcv fitting") > > Many thanks once again. > > regards > mintewab > > > > Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] > Skickat: den 5 december 2011 12:39 > Till: Mintewab Bezabih; Sarah Goslee > Kopia: r-help at r-project.org > ?mne: Re: [R] problems using the thin plate spline method > > Try > > plot( dat$x1, dat$y ) > > or > > plot( x1, y, data=dat ) > > Note that your example is still not reproducible because you have not supplied the data or a shortened version of your data for us to work with. Also, your problem is not with thin plates but with plot, and reading the help for that function by typing > > ?plot > > at the R command line would have provided you with more examples and usage info on how to get around this problem. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN: Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Mintewab Bezabih wrote: > >> Dear Sarah and R users, >> >> Sorry again for not being explicit enough. Here is my full problem >> >> >> dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") >> dat >> names(dat) <- c("x1", "x2", "y") >> library(fields) >> plot (dat) >> >> #load the fields package (containing Tps) and fit a thin plate spline >> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >> >> What I meant when I said the graph works is when I do plot(dat) it does >> plot of all my three variables. If I do plot(x1,y), though, I get the >> 'object x1 not found' error message. >> >> Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, >> scale.type="unscaled"). I get the same error message. >> >> I tried your suggestion of checking str(x1) and I get the same error >> message (object x1 not found). >> I also typed ls() and I get "dat" after that command. >> >> I followed the r tutorial guide to read my data and I am following the >> r tutorial to guide me to apply the thin plate spline method. >> >> Regards, >> >> Mintewab >> ________________________________________ >> Fr?n: Sarah Goslee [sarah.goslee at gmail.com] >> Skickat: den 4 december 2011 15:21 >> Till: Mintewab Bezabih >> Kopia: r-help at r-project.org >> ?mne: Re: [R] problems using the thin plate spline method >> >> Hello, >> >> On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih >> wrote: >>> Dear R users and Jeff, >>> >>> Sorry for not being quite explicit in my earlier message. >> >> And you are still not explicit. We have no idea what you've done. >> >>> My main problem is while my data seem to be read into R well (I >> manage to graph them and all), I cannot get the following line to work. >>> >>> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >>> >>> and I get the following error message >>> >>> Error in as.matrix(x) : >>> error in evaluating the argument 'x' in selecting a method for >> function 'as.matrix': Error: object 'x1' not found >> >> I'd have to guess that there's no object x1. What does ls() tell you? >> str(x1)? >> >> What do your data look like? You were already given instructions on how >> to >> include sample data to construct a reproducible example. You said that >> graphing your data worked; how did you do so? >> >> The posting guide and the advice you were already given were both >> offered for a reason. The querent needs to do the work of formulating >> an understandable and answerable question. >> >> Sarah >> >>> thanks for help >>> minti >>> ________________________________________ >>> Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] >>> Skickat: den 3 december 2011 17:45 >>> Till: Mintewab Bezabih; r-help at r-project.org >>> ?mne: Re: [R] problems using the thin plate spline method >>> >>> I can tell that you are puzzled and confused. Unfortunately, I am not >> psychic, so I cannot tell what you did, and therefore cannot tell where >> you went astray. >>> >>> The solution is for you to read the posting guide mentioned at the >> bottom of every R-help message. Spend a little time to create a small >> bit of data like yours if your actual data is large (subset and dput >> are useful for this). Remember to include the output of sessionInfo, >> and so on. Many times you are likely to find the answer yourself by >> going through these steps, but they are essential for communication. >>> >>> Good luck. >>> Sent from my phone. Please excuse my brevity. >>> >>> Mintewab Bezabih wrote: >>> >>>> Dear R users, >>>> >>>> I am a beginner in R trying to apply the thin plate spline method to >> my >>>> climate data. I used the example in R to do so, and the lines seem to >>>> run fine ( I am not getting errors) but I am not getting any output >> in >>>> the form of graph or anything. I got a warning message saying that >>>> 'surface extends beyond box'. >>>> >>>> Any help is much appreciated. >>>> thanks >>>> minti >> >> >> -- >> Sarah Goslee >> http://www.functionaldiversity.org >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From hadley at rice.edu Mon Dec 5 14:30:53 2011 From: hadley at rice.edu (Hadley Wickham) Date: Mon, 5 Dec 2011 08:30:53 -0500 Subject: [R] Project local libraries (reproducible research) In-Reply-To: <4EDA0510.9080003@bitwrit.com.au> References: <4EDA0510.9080003@bitwrit.com.au> Message-ID: On Sat, Dec 3, 2011 at 11:16 AM, Jim Lemon wrote: > On 12/03/2011 06:04 AM, Hadley Wickham wrote: >> >> Hi all, >> >> I was wondering if any one had scripts that they could share for >> capturing the current version of R packages used for a project. I'm >> interested in creating a project local library so that you're safe if >> someone (e.g. the ggplot2 author) updates a package you're relying on >> and breaks your code. ? I could fairly easily hack together, but I was >> wondering if any one had any neat scripts they'd care to share. >> > Hi Hadley, > This makes quite a few assumptions, but I would build a list of packages > called in R scripts: > > # get all calls to library or require in a subdirectory of scripts > packagestrings<-c(system("grep library *.R",intern=TRUE), > ?system("grep require *.R",intern=TRUE)) > # get the unique package names > packagenames<-unique(sapply(strsplit(packagestrings,"[()]"),"[",2)) > # get the information on all installed packages in the system > installedpackages<-installed.packages() > # get the indices of the packages used in the subdirectory > whichpackages<-which(match(rownames(installedpackages),packagenames,0)>0) > # get the version information for each used package > installedpackages[whichpackages,"Built"] Thanks Jim. I was thinking something more like: rec <- dir(file.path(Sys.getenv("R_HOME"), "library")) pkgs <- search()[grepl("package:", search(), fixed = T)] pkgs <- gsub("package:", "", pkgs, fixed = TRUE) pkgs <- setdiff(pkgs, rec) i.e. work from the search path (once you've run your code). Then the next step would be find all dependencies of the packages, then copy them into the current working directory, and give a line to set .libPaths() correctly. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ From murdoch.duncan at gmail.com Mon Dec 5 14:32:26 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Mon, 05 Dec 2011 08:32:26 -0500 Subject: [R] Persp3d freezes when run from within Python In-Reply-To: <1323050239287-4158940.post@n4.nabble.com> References: <1323050239287-4158940.post@n4.nabble.com> Message-ID: <4EDCC7EA.1030008@gmail.com> On 11-12-04 8:57 PM, wchips wrote: > G'day everyone, > > I've been trying to get an interactive OpenGL plot to work from within > Python 2.6 using Rpy2 and the persp3d function. The problem is that the plot > seems to freeze upon activation. All interactivity is lost even though it > works fine when run from within the R console (version 2.11.1). Is this a > known issue? Any ideas as to what might be causing this, or possibly how to > fix it? Presumably your Python program or Rpy2 is not simulating the event handling that the real R console does. Solution: use the real R console, or fix the bug in your program or Rpy2. Duncan Murdoch > > cheers, > wchips > > -- > View this message in context: http://r.789695.n4.nabble.com/Persp3d-freezes-when-run-from-within-Python-tp4158940p4158940.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 14:50:34 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 08:50:34 -0500 Subject: [R] extract cov matrix in summary.rq and use as a matrix. In-Reply-To: References: Message-ID: <397CB275-698B-43EE-8AFF-B28546135FB6@gmail.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rkoenker at illinois.edu Mon Dec 5 14:53:21 2011 From: rkoenker at illinois.edu (Roger Koenker) Date: Mon, 5 Dec 2011 07:53:21 -0600 Subject: [R] about interpretation of anova results... In-Reply-To: <1323069483773-4159510.post@n4.nabble.com> References: <1323069483773-4159510.post@n4.nabble.com> Message-ID: If you were to rtfm you'd see that your anova suggests that the slope coefficients are the same for your tau = .15 and tau = .30 models. url: www.econ.uiuc.edu/~roger Roger Koenker email rkoenker at uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Urbana, IL 61801 On Dec 5, 2011, at 1:18 AM, narendarreddy kalam wrote: > quantreg package is used. > *fit1 results are* > Call: > rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + > inp8 + inp9, tau = 0.15, data = wbc) > > Coefficients: > (Intercept) inp1 inp2 inp3 inp4 > inp5 > -0.191528450 0.005276347 0.021414032 0.016034803 0.007510343 > 0.005276347 > inp6 inp7 inp8 inp9 > 0.058708544 0.005224906 0.006804871 -0.003931540 > > Degrees of freedom: 673 total; 663 residual > *fit2 results are* > Call: > rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + > inp8 + inp9, tau = 0.3, data = wbc) > > Coefficients: > (Intercept) inp1 inp2 inp3 inp4 > -1.111111e-01 5.776765e-19 4.635734e-18 1.874715e-18 2.099872e-18 > inp5 inp6 inp7 inp8 inp9 > -4.942052e-19 1.111111e-01 2.205289e-18 4.138435e-18 9.300642e-19 > > Degrees of freedom: 673 total; 663 residual > > anova(fit1,fit2); > Quantile Regression Analysis of Deviance Table > > Model: op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9 > Joint Test of Equality of Slopes: tau in { 0.15 0.3 } > > Df Resid Df F value Pr(>F) > 1 9 1337 0.5256 0.8568 > Warning messages: > 1: In summary.rq(x, se = "nid", covariance = TRUE) : 93 non-positive fis > 2: In summary.rq(x, se = "nid", covariance = TRUE) : 138 non-positive fis > how to interpret the above results?? > > what is the use of anova function?? > will it give the best among fit1 && fit2.. > > > -- > View this message in context: http://r.789695.n4.nabble.com/about-interpretation-of-anova-results-tp4159510p4159510.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From friendly at yorku.ca Mon Dec 5 15:16:25 2011 From: friendly at yorku.ca (Michael Friendly) Date: Mon, 05 Dec 2011 09:16:25 -0500 Subject: [R] finding interpolated values along an empirical parametric curve Message-ID: <4EDCD239.6040501@yorku.ca> Given the following data, I am plotting log.det ~ norm.beta, where the points depend on a parameter, lambda (but there is no functional form). I want to find the (x,y) positions along this curve corresponding to two special values of lambda lambda.HKB <- 0.004275357 lambda.LW <- 0.03229531 and draw reference lines at ~ -45 degrees (or normal to the curve) thru these points. How can I do this? A complete example is below > pd lambda log.det norm.beta 0.000 0.000 -12.92710 3.806801 0.005 0.005 -14.41144 2.819460 0.010 0.010 -15.41069 2.423197 0.020 0.020 -16.82581 2.010924 0.040 0.040 -18.69819 1.611304 0.080 0.080 -21.05065 1.283928 > pd <- structure(list(lambda = c(0, 0.005, 0.01, 0.02, 0.04, 0.08), log.det = c(-12.9270978142337, -14.411442487768, -15.4106886674014, -16.8258120792945, -18.6981870228698, -21.050646106925), norm.beta = c(3.8068008759562, 2.81945995964196, 2.42319655878575, 2.01092421747594, 1.6113040561427, 1.28392804825009)), .Names = c("lambda", "log.det", "norm.beta"), class = "data.frame", row.names = c("0.000", "0.005", "0.010", "0.020", "0.040", "0.080")) clr <- c("black", rainbow(5, start=.6, end=.1)) lambdaf <- c(expression(~widehat(beta)^OLS), ".005", ".01", ".02", ".04", ".08") op <- par(mar=c(4, 4, 1, 1) + 0.2, xpd=TRUE) with(pd, {plot(norm.beta, log.det, type="b", cex.lab=1.25, pch=16, cex=1.5, col=clr, xlab='shrinkage: ||b||', ylab='variance: log |(Var(b)|)') text(norm.beta, log.det, lambdaf, cex=1.25, pos=2) text(min(norm.beta), max(log.det), "Variance vs. Shrinkage", cex=1.5, pos=4) }) # How to find the (x,y) positions for these values of lambda along the curve of log.det ~ norm.beta ? lambda.HKB <- 0.004275357 lambda.LW <- 0.03229531 -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA From S.Ellison at LGCGroup.com Mon Dec 5 15:45:01 2011 From: S.Ellison at LGCGroup.com (S Ellison) Date: Mon, 5 Dec 2011 14:45:01 +0000 Subject: [R] iterative variable names In-Reply-To: <1323087914497-4160262.post@n4.nabble.com> References: <1323079206895-4159888.post@n4.nabble.com> <511429D6-561A-4EA6-95A1-44A936973BEE@gmail.com> <1323087914497-4160262.post@n4.nabble.com> Message-ID: > -----Original Message----- > Thank you very much, assign was exactly what I needed! For my > case, it worked better than list! :) If assign(paste('x_', i)) works better for your case than using a list or array , you must surely have a very strange case.... S Ellison******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} From jfox at mcmaster.ca Mon Dec 5 15:50:06 2011 From: jfox at mcmaster.ca (John Fox) Date: Mon, 5 Dec 2011 09:50:06 -0500 Subject: [R] finding interpolated values along an empirical parametric curve In-Reply-To: <4EDCD239.6040501@yorku.ca> References: <4EDCD239.6040501@yorku.ca> Message-ID: <002f01ccb35d$2e3a60d0$8aaf2270$@mcmaster.ca> Hi Michael, I can get what appears to be a good interpolation with a regression spline in a multivariate LM, playing around with the tuning parameter to leave 1 residual df. Try this: library(splines) mod <- lm(cbind(log.det, norm.beta) ~ bs(lambda, df=4), data=pd) summary(mod) x <- data.frame(lambda=seq(min(pd$lambda), max(pd$lambda), length=100)) fit <- predict(mod, newdata=x) points(fit[, "norm.beta"], fit[, "log.det"], pch=16, cex=0.5) x.2 <- data.frame(lambda=c(lambda.HKB, lambda.LW)) fit.2 <- predict(mod, x.2) points(fit.2[, "norm.beta"], fit.2[, "log.det"], pch=15, col="green") That doesn't solve the problem of calculating the normal, however. I hope this helps, John > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Michael Friendly > Sent: December-05-11 9:16 AM > To: R-help > Subject: [R] finding interpolated values along an empirical parametric > curve > > Given the following data, I am plotting log.det ~ norm.beta, where the > points depend on a parameter, lambda (but there is no functional form). > I want to find the (x,y) positions along this curve corresponding to > two special values of lambda > > lambda.HKB <- 0.004275357 > lambda.LW <- 0.03229531 > > and draw reference lines at ~ -45 degrees (or normal to the curve) thru > these points. > How can I do this? A complete example is below > > > pd > lambda log.det norm.beta > 0.000 0.000 -12.92710 3.806801 > 0.005 0.005 -14.41144 2.819460 > 0.010 0.010 -15.41069 2.423197 > 0.020 0.020 -16.82581 2.010924 > 0.040 0.040 -18.69819 1.611304 > 0.080 0.080 -21.05065 1.283928 > > > > pd <- > structure(list(lambda = c(0, 0.005, 0.01, 0.02, 0.04, 0.08), > log.det = c(-12.9270978142337, -14.411442487768, - > 15.4106886674014, > -16.8258120792945, -18.6981870228698, -21.050646106925), > norm.beta = c(3.8068008759562, 2.81945995964196, 2.42319655878575, > 2.01092421747594, 1.6113040561427, 1.28392804825009)), .Names = > c("lambda", "log.det", "norm.beta"), class = "data.frame", row.names = > c("0.000", "0.005", "0.010", "0.020", "0.040", "0.080")) > > clr <- c("black", rainbow(5, start=.6, end=.1)) lambdaf <- > c(expression(~widehat(beta)^OLS), ".005", ".01", ".02", ".04", ".08") > op <- par(mar=c(4, 4, 1, 1) + 0.2, xpd=TRUE) with(pd, {plot(norm.beta, > log.det, type="b", > cex.lab=1.25, pch=16, cex=1.5, col=clr, > xlab='shrinkage: ||b||', > ylab='variance: log |(Var(b)|)') > text(norm.beta, log.det, lambdaf, cex=1.25, pos=2) > text(min(norm.beta), max(log.det), "Variance vs. Shrinkage", > cex=1.5, pos=4) > }) > > > # How to find the (x,y) positions for these values of lambda along the > curve of log.det ~ norm.beta ? > lambda.HKB <- 0.004275357 > lambda.LW <- 0.03229531 > > -- > Michael Friendly Email: friendly AT yorku DOT ca > Professor, Psychology Dept. > York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 > 4700 Keele Street Web: http://www.datavis.ca > Toronto, ONT M3J 1P3 CANADA > > ______________________________________________ > R-help at 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 code. From erinm.hodgess at gmail.com Mon Dec 5 16:03:10 2011 From: erinm.hodgess at gmail.com (Erin Hodgess) Date: Mon, 5 Dec 2011 09:03:10 -0600 Subject: [R] R 2-14.0 locking up Message-ID: Dear R People: I'm working with R-2.14.0 created from source on a quad core Windows 7 machine. Starting yesterday, nearly everything I run just sits. When I hit escape or Ctrl C, nothing happens. Has anyone run into this, please? Any suggestions would be much appreciated. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com From mardones.p at gmail.com Mon Dec 5 16:06:10 2011 From: mardones.p at gmail.com (Pedro Mardones) Date: Mon, 5 Dec 2011 12:06:10 -0300 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> Message-ID: Perhaps you can try the examples given in http://www.jstatsoft.org/v18/i02 for getting a better idea about how the NIPALS algorithm works. BTW, yes,it looks like a homework question specially when your user name is "zz dd " so you can't be recognized. On Mon, Dec 5, 2011 at 9:27 AM, zz dd wrote: > Thank you for your brevity you don't have to say more things to show who > you are. > Else if you don't understand what we are talking about, you shouldn't ?be > rude and insulting. > May be you are quite young please take time to read Nonaka and Takeuchi and > moreover Takanashi to uderstand the way to go from information to knowledge > to wisdom that's quite useful for IS / IT and should bring you a bit of > etiquette. > *I have a dream* *that one day this nation will rise up and live out the > true meaning of its creed : ?We hold these truths to be self-evident : that > all men are created equal.?* > > Have a nice day. > > 2011/12/5 Jeff Newmiller > >> This is not a homework help list. >> --------------------------------------------------------------------------- >> Jeff Newmiller ? ? ? ? ? ? ? ? ? ? ? ?The ? ? ..... ? ? ? ..... ?Go Live... >> DCN: ? ? ? ?Basics: ##.#. ? ? ? ##.#. ?Live >> Go... >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Live: ? OO#.. Dead: OO#.. ?Playing >> Research Engineer (Solar/Batteries ? ? ? ? ? ?O.O#. ? ? ? #.O#. ?with >> /Software/Embedded Controllers) ? ? ? ? ? ? ? .OO#. ? ? ? .OO#. ?rocks...1k >> --------------------------------------------------------------------------- >> Sent from my phone. Please excuse my brevity. >> >> zz dd wrote: >> >> >Hello >> >The solution maybe there but i need to compute it into R if someone can >> >help me : >> >(Previously store score vector t in score matrix T; store loading >> >vector p >> >in loading matrix P) that's done by nipals in chemometrics >> >After use of nipals function you have T and P matrix >> > >> >First : "Calculate the residual matrix of X. Stop if the elements of >> >Xres >> >are very small >> >because no further PCA components are reasonable" : >> >Xres= X-u.b(T) >> > >> >u : improved score vector >> >b: loading vector >> >X : a mean-centered matrix >> > >> >Second : Replace X with Xres and continue with step 2 (with nipals >> >chemometrics...) for calculation of the next PCA >> >component. >> > >> >If someone can help me ? >> >Thank's a lot >> > >> > >> >2011/12/1 zz dd >> > >> >> Hello >> >> i need some precision about nipals in the chemometrics package in R . >> >> >> >> When i use nipals in chemometrics i obtain T and P matrix. >> >> >> >> I really don't understand what to do with these two matrix to obtain >> >> the scores for every the component (like in spss fo example) >> >> >> >> ? ? ? ? ? ? Comp1 ? ?Comp2 ? Comp3 >> >> quest1 0,8434 ? ? ?0,54333 ? 0,3466 >> >> quest2 0,665 ? ? ? 0,7655 ? ? ?0,433 >> >> >> >> Thank you very much for your help >> >> (I know that X=TP+E)... But don't understand else.... >> >> >> > >> > ? ? ? [[alternative HTML version deleted]] >> > >> >______________________________________________ >> >R-help at 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 code. >> >> > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From mailinglist.honeypot at gmail.com Mon Dec 5 16:13:27 2011 From: mailinglist.honeypot at gmail.com (Steve Lianoglou) Date: Mon, 5 Dec 2011 10:13:27 -0500 Subject: [R] R 2-14.0 locking up In-Reply-To: References: Message-ID: Hi, On Mon, Dec 5, 2011 at 10:03 AM, Erin Hodgess wrote: > Dear R People: > > I'm working with R-2.14.0 created from source on a quad core Windows 7 machine. > > Starting yesterday, nearly everything I run just sits. ?When I hit > escape or Ctrl C, nothing happens. > > Has anyone run into this, please? > > Any suggestions would be much appreciated. Does this happen when you run R from the command line? Are you loading something wonky from a stored workspace (ie, your ~/.RData file)? Can you start R from terminal with the "vanilla" switch to see if its something else, ie: $ R --vanilla (where `$` is the command line prompt you typically see in a *nix environment, I'm not sure what the equivalent is in windows -- not that it matters) Does any of that work? And out of curiosity, why did you compile R from source instead of using the binaries? What were the configure args you used to compile? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact From bps0002 at auburn.edu Mon Dec 5 16:23:32 2011 From: bps0002 at auburn.edu (B77S) Date: Mon, 5 Dec 2011 07:23:32 -0800 (PST) Subject: [R] similarity matrix In-Reply-To: <1323071233237-4159547.post@n4.nabble.com> References: <1323022265536-4157576.post@n4.nabble.com> <1323027562692-4157840.post@n4.nabble.com> <1323071233237-4159547.post@n4.nabble.com> Message-ID: <1323098612063-4160902.post@n4.nabble.com> That really all depends on what you need; and I can't tell you what you need. set wrote > > I'm sorry, I made a mistake in my example. you're right. I don't really > know how a similarity alogrithm works....but I'm willing to try that...are > there any good examples available? > Thank you > -- View this message in context: http://r.789695.n4.nabble.com/similarity-matrix-tp4157576p4160902.html Sent from the R help mailing list archive at Nabble.com. From dwinsemius at comcast.net Mon Dec 5 16:28:08 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Mon, 5 Dec 2011 10:28:08 -0500 Subject: [R] equating approximate values In-Reply-To: <7DDE0973-E5AF-4299-87D6-EF46555EBB74@gmail.com> References: <1323021640135-4157551.post@n4.nabble.com> <1323043462928-4158691.post@n4.nabble.com> <7DDE0973-E5AF-4299-87D6-EF46555EBB74@gmail.com> Message-ID: On Dec 5, 2011, at 8:02 AM, R. Michael Weylandt wrote: > Change which to which.min, but then you won't easily be able to get > the corresponding x,y indices. Look at the arrayInd() function to > translate the result to a particular x,y. The arrayInd help page is shared by the which help and which has an arr.ind=TRUE option that let's you encapsulate both steps: which( abs(outer(x, y, "-")) == min(abs(outer(x, y, "-"))), arr.ind=TRUE) > > Michael > > On Dec 4, 2011, at 7:04 PM, vamshi999 wrote: > >> this is exactly what i wanted. >> >> How to i select only the minimum value from this?. >> >> thank you >> >> >> >> >> My apologies: you need an abs() call as well: >> >> which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) >> >> Michael >> >> >> >> >> -- >> View this message in context: http://r.789695.n4.nabble.com/equating-approximate-values-tp4157551p4158691.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From matteo.richiardi at gmail.com Mon Dec 5 16:36:18 2011 From: matteo.richiardi at gmail.com (Matteo Richiardi) Date: Mon, 5 Dec 2011 16:36:18 +0100 Subject: [R] using StatEt IDE for Eclipse Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From f.calboli at imperial.ac.uk Mon Dec 5 16:44:21 2011 From: f.calboli at imperial.ac.uk (Federico Calboli) Date: Mon, 5 Dec 2011 15:44:21 +0000 Subject: [R] barplot ignoring col parameter Message-ID: Hi All, I'm having a problem with barplot: mydata [1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1 mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) barplot(mydata, col = mycol) gives me an uniformly yellow barplot. How do I solve this? bw Federico -- Federico C. F. Calboli Neuroepidemiology and Ageing Research Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com From void1999 at gmail.com Mon Dec 5 16:46:38 2011 From: void1999 at gmail.com (zz dd) Date: Mon, 5 Dec 2011 16:46:38 +0100 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Mon Dec 5 16:51:55 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Mon, 5 Dec 2011 10:51:55 -0500 Subject: [R] barplot ignoring col parameter In-Reply-To: References: Message-ID: <8E367CCF-313A-4849-B5A1-2AD635AD3933@comcast.net> On Dec 5, 2011, at 10:44 AM, Federico Calboli wrote: > Hi All, > > I'm having a problem with barplot: > > mydata > [1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 > 19 7 1 1 > > mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), > rep('white', 5), rep('orange',3), rep('red',9)) > > barplot(mydata, col = mycol) > > gives me an uniformly yellow barplot. How do I solve this? Hard to say, since it involves graphics devices and I cannot reproduce it. > mydata <- scan() 1: 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1 25: Read 24 items > barplot(mydata) > ?barplot > mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) > > barplot(mydata, col = mycol) Gives a multicolored display on my machine: -------------- next part -------------- A non-text attachment was scrubbed... Name: Rplot.pdf Type: application/pdf Size: 39931 bytes Desc: not available URL: -------------- next part -------------- > > bw > > Federico > > > > -- > Federico C. F. Calboli > Neuroepidemiology and Ageing Research > Imperial College, St. Mary's Campus > Norfolk Place, London W2 1PG > > Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 > > f.calboli [.a.t] imperial.ac.uk > f.calboli [.a.t] gmail.com > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From michael.weylandt at gmail.com Mon Dec 5 16:58:36 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 10:58:36 -0500 Subject: [R] barplot ignoring col parameter In-Reply-To: References: Message-ID: x <- c(2L, 108L, 0L, 0L, 0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 7L, 18L, 3L, 4L, 8L, 20L, 26L, 20L, 19L, 7L, 1L, 1L) mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) barplot(x, col = mycol) Produces a multi-colored barplot on my machine so I understand your confusion. Does the above work for you? It may be something hidden in your data. What is your sessionInfo() and str(mydata)? Same problem in a fresh R session (with --vanilla if necessary)? Michael On Mon, Dec 5, 2011 at 10:44 AM, Federico Calboli wrote: > Hi All, > > I'm having a problem with barplot: > > mydata > [1,] ?2 108 ?0 ?0 ?0 ?1 ?3 ?0 ?0 ?0 ?0 ?0 ?7 18 ?3 ?4 ?8 20 26 20 19 ?7 ?1 ?1 > > mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) > > barplot(mydata, col = mycol) > > gives me an uniformly yellow barplot. How do I solve this? > > bw > > Federico > > > > -- > Federico C. F. Calboli > Neuroepidemiology and Ageing Research > Imperial College, St. Mary's Campus > Norfolk Place, London W2 1PG > > Tel +44 (0)20 75941602 ? Fax +44 (0)20 75943193 > > f.calboli [.a.t] imperial.ac.uk > f.calboli [.a.t] gmail.com > > ______________________________________________ > R-help at 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 code. From friendly at yorku.ca Mon Dec 5 17:02:07 2011 From: friendly at yorku.ca (Michael Friendly) Date: Mon, 05 Dec 2011 11:02:07 -0500 Subject: [R] finding interpolated values along an empirical parametric curve In-Reply-To: <002f01ccb35d$2e3a60d0$8aaf2270$@mcmaster.ca> References: <4EDCD239.6040501@yorku.ca> <002f01ccb35d$2e3a60d0$8aaf2270$@mcmaster.ca> Message-ID: <4EDCEAFF.50202@yorku.ca> Thanks, John That's very clever. I didn't realize that the splines package supports multivariate regression splines and that works well enough for my purposes; plus this solution is very transparent. best, -Michael On 12/5/2011 9:50 AM, John Fox wrote: > Hi Michael, > > I can get what appears to be a good interpolation with a regression spline > in a multivariate LM, playing around with the tuning parameter to leave 1 > residual df. Try this: > > library(splines) > mod<- lm(cbind(log.det, norm.beta) ~ bs(lambda, df=4), data=pd) > summary(mod) > > x<- data.frame(lambda=seq(min(pd$lambda), max(pd$lambda), length=100)) > fit<- predict(mod, newdata=x) > points(fit[, "norm.beta"], fit[, "log.det"], pch=16, cex=0.5) > > x.2<- data.frame(lambda=c(lambda.HKB, lambda.LW)) > fit.2<- predict(mod, x.2) > points(fit.2[, "norm.beta"], fit.2[, "log.det"], pch=15, col="green") > > That doesn't solve the problem of calculating the normal, however. > > I hope this helps, > John > >> -----Original Message----- >> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- >> project.org] On Behalf Of Michael Friendly >> Sent: December-05-11 9:16 AM >> To: R-help >> Subject: [R] finding interpolated values along an empirical parametric >> curve >> >> Given the following data, I am plotting log.det ~ norm.beta, where the >> points depend on a parameter, lambda (but there is no functional form). >> I want to find the (x,y) positions along this curve corresponding to >> two special values of lambda >> >> lambda.HKB<- 0.004275357 >> lambda.LW<- 0.03229531 >> >> and draw reference lines at ~ -45 degrees (or normal to the curve) thru >> these points. >> How can I do this? A complete example is below >> >> > pd >> lambda log.det norm.beta >> 0.000 0.000 -12.92710 3.806801 >> 0.005 0.005 -14.41144 2.819460 >> 0.010 0.010 -15.41069 2.423197 >> 0.020 0.020 -16.82581 2.010924 >> 0.040 0.040 -18.69819 1.611304 >> 0.080 0.080 -21.05065 1.283928 >> > >> >> pd<- >> structure(list(lambda = c(0, 0.005, 0.01, 0.02, 0.04, 0.08), >> log.det = c(-12.9270978142337, -14.411442487768, - >> 15.4106886674014, >> -16.8258120792945, -18.6981870228698, -21.050646106925), >> norm.beta = c(3.8068008759562, 2.81945995964196, 2.42319655878575, >> 2.01092421747594, 1.6113040561427, 1.28392804825009)), .Names = >> c("lambda", "log.det", "norm.beta"), class = "data.frame", row.names = >> c("0.000", "0.005", "0.010", "0.020", "0.040", "0.080")) >> >> clr<- c("black", rainbow(5, start=.6, end=.1)) lambdaf<- >> c(expression(~widehat(beta)^OLS), ".005", ".01", ".02", ".04", ".08") >> op<- par(mar=c(4, 4, 1, 1) + 0.2, xpd=TRUE) with(pd, {plot(norm.beta, >> log.det, type="b", >> cex.lab=1.25, pch=16, cex=1.5, col=clr, >> xlab='shrinkage: ||b||', >> ylab='variance: log |(Var(b)|)') >> text(norm.beta, log.det, lambdaf, cex=1.25, pos=2) >> text(min(norm.beta), max(log.det), "Variance vs. Shrinkage", >> cex=1.5, pos=4) >> }) >> >> >> # How to find the (x,y) positions for these values of lambda along the >> curve of log.det ~ norm.beta ? >> lambda.HKB<- 0.004275357 >> lambda.LW<- 0.03229531 >> >> -- >> Michael Friendly Email: friendly AT yorku DOT ca >> Professor, Psychology Dept. >> York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 >> 4700 Keele Street Web: http://www.datavis.ca >> Toronto, ONT M3J 1P3 CANADA >> >> ______________________________________________ >> R-help at 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 code. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA From julia.lira at hotmail.co.uk Mon Dec 5 14:09:21 2011 From: julia.lira at hotmail.co.uk (Julia Lira) Date: Mon, 5 Dec 2011 13:09:21 +0000 Subject: [R] extract cov matrix in summary.rq and use as a matrix. In-Reply-To: References: , Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From juancarlosmarsan at gmail.com Mon Dec 5 16:19:07 2011 From: juancarlosmarsan at gmail.com (SilvaForever) Date: Mon, 5 Dec 2011 07:19:07 -0800 (PST) Subject: [R] Weighting and recodification Message-ID: <1323098347580-4160876.post@n4.nabble.com> I have a question that is more statistical than r-specific I have to recode a variable into quartiles, and I have weighted individuals. To calculate the quartiles that will serve me to recode the variable, should I use the weight or not? -- View this message in context: http://r.789695.n4.nabble.com/Weighting-and-recodification-tp4160876p4160876.html Sent from the R help mailing list archive at Nabble.com. From mark.pundurs at navteq.com Mon Dec 5 17:10:56 2011 From: mark.pundurs at navteq.com (Pundurs, Mark) Date: Mon, 5 Dec 2011 10:10:56 -0600 Subject: [R] Flexclust package: kcca object's methods and properties? Message-ID: <8A18D8FA4293104C9A710494FD6C273CB678DDDA@hq-ex-mb03.ad.navteq.com> What are all the methods and properties for the flexclust package's kcca object? Neither http://cran.r-project.org/web/packages/flexclust/flexclust.pdf nor http://www.stat.uni-muenchen.de/~leisch/papers/Leisch-2006.pdf appear to include a comprehensive centralized list. Mark Pundurs Data Analyst - Traffic Nokia Location & Commerce The information contained in this communication may be C...{{dropped:8}} From f.calboli at imperial.ac.uk Mon Dec 5 17:41:23 2011 From: f.calboli at imperial.ac.uk (Federico Calboli) Date: Mon, 5 Dec 2011 16:41:23 +0000 Subject: [R] barplot ignoring col parameter In-Reply-To: References: Message-ID: On 5 Dec 2011, at 15:58, R. Michael Weylandt wrote: > x <- c(2L, 108L, 0L, 0L, 0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 7L, 18L, > 3L, 4L, 8L, 20L, 26L, 20L, 19L, 7L, 1L, 1L) > mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), > rep('white', 5), rep('orange',3), rep('red',9)) > barplot(x, col = mycol) > > Produces a multi-colored barplot on my machine so I understand your > confusion. Does the above work for you? It may be something hidden in > your data. It does work. Might it be that my data is a matrix? I'm using it to give a name for each bar. > > What is your sessionInfo() and str(mydata)? Same problem in a fresh R > session (with --vanilla if necessary)? sessionInfo() R version 2.14.0 (2011-10-31) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] splines stats graphics grDevices utils datasets methods base other attached packages: [1] survival_2.36-10 loaded via a namespace (and not attached): [1] tools_2.14.0 str(mydata) num [1, 1:24] 2 108 0 0 0 1 3 0 0 0 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:24] "A" "B" "C" "D" ... Basically, using the 'x' object as you created the code works, and I can have a workaround. I fail to see why it would not work using mydata. Cheers F > > Michael > > On Mon, Dec 5, 2011 at 10:44 AM, Federico Calboli > wrote: >> Hi All, >> >> I'm having a problem with barplot: >> >> mydata >> [1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1 >> >> mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) >> >> barplot(mydata, col = mycol) >> >> gives me an uniformly yellow barplot. How do I solve this? >> >> bw >> >> Federico >> >> >> >> -- >> Federico C. F. Calboli >> Neuroepidemiology and Ageing Research >> Imperial College, St. Mary's Campus >> Norfolk Place, London W2 1PG >> >> Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 >> >> f.calboli [.a.t] imperial.ac.uk >> f.calboli [.a.t] gmail.com >> >> ______________________________________________ >> R-help at 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 code. -- Federico C. F. Calboli Neuroepidemiology and Ageing Research Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com From dwinsemius at comcast.net Mon Dec 5 17:43:38 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Mon, 5 Dec 2011 11:43:38 -0500 Subject: [R] Weighting and recodification In-Reply-To: <1323098347580-4160876.post@n4.nabble.com> References: <1323098347580-4160876.post@n4.nabble.com> Message-ID: On Dec 5, 2011, at 10:19 AM, SilvaForever wrote: > I have a question that is more statistical than r-specific > > I have to recode a variable into quartiles, and I have weighted > individuals. > To calculate the quartiles that will serve me to recode the > variable, should > I use the weight or not? I would think that an affirmative answer should raise the follow-on question of "how", and an R-specific answer would be `wtd.quantile` in the Hmisc package. -- David Winsemius, MD West Hartford, CT From michael.weylandt at gmail.com Mon Dec 5 17:49:34 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 11:49:34 -0500 Subject: [R] barplot ignoring col parameter In-Reply-To: References: Message-ID: barplot() defaults to stacked bars for matrices and uses the colors fresh for each bar: e.g., layout(1:2) barplot(matrix(1:6, 2), col = c("red", "blue","green")) barplot(matrix(1:6, 3), col = c("red", "blue","green")) To get what you are looking for, try something like this: x = matrix(1:6,1); colnames(x) = LETTERS[1:6] barplot(as.vector(x), names.arg = colnames(x)) More generally, just turn the matrix into a vector mat2vec <- function(x){ stopifnot(any(dim(x) == 1L)) if(nrow(x) != 1L) x <- t(x) cn <- colnames(x) x <- c(x) names(x) <- cn return(x) } and barplot that. Hope this helps, Michael On Mon, Dec 5, 2011 at 11:41 AM, Federico Calboli wrote: > > On 5 Dec 2011, at 15:58, R. Michael Weylandt wrote: > >> x <- c(2L, 108L, 0L, 0L, 0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 7L, 18L, >> 3L, 4L, 8L, 20L, 26L, 20L, 19L, 7L, 1L, 1L) >> mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), >> rep('white', 5), rep('orange',3), rep('red',9)) >> barplot(x, col = mycol) >> >> Produces a multi-colored barplot on my machine so I understand your >> confusion. Does the above work for you? It may be something hidden in >> your data. > > It does work. Might it be that my data is a matrix? I'm using it to give a name for each bar. > > >> >> What is your sessionInfo() and str(mydata)? Same problem in a fresh R >> session (with --vanilla if necessary)? > > > sessionInfo() > R version 2.14.0 (2011-10-31) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > locale: > [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 > > attached base packages: > [1] splines ? stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base > > other attached packages: > [1] survival_2.36-10 > > loaded via a namespace (and not attached): > [1] tools_2.14.0 > > > str(mydata) > num [1, 1:24] 2 108 0 0 0 1 3 0 0 0 ... > - attr(*, "dimnames")=List of 2 > ?..$ : NULL > ?..$ : chr [1:24] "A" "B" "C" "D" ... > > > Basically, using the 'x' object as you created the code works, and I can have a workaround. I fail to see why it would not work using mydata. > > Cheers > > F > > > >> >> Michael >> >> On Mon, Dec 5, 2011 at 10:44 AM, Federico Calboli >> wrote: >>> Hi All, >>> >>> I'm having a problem with barplot: >>> >>> mydata >>> [1,] ?2 108 ?0 ?0 ?0 ?1 ?3 ?0 ?0 ?0 ?0 ?0 ?7 18 ?3 ?4 ?8 20 26 20 19 ?7 ?1 ?1 >>> >>> mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) >>> >>> barplot(mydata, col = mycol) >>> >>> gives me an uniformly yellow barplot. How do I solve this? >>> >>> bw >>> >>> Federico >>> >>> >>> >>> -- >>> Federico C. F. Calboli >>> Neuroepidemiology and Ageing Research >>> Imperial College, St. Mary's Campus >>> Norfolk Place, London W2 1PG >>> >>> Tel +44 (0)20 75941602 ? Fax +44 (0)20 75943193 >>> >>> f.calboli [.a.t] imperial.ac.uk >>> f.calboli [.a.t] gmail.com >>> >>> ______________________________________________ >>> R-help at 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 code. > > -- > Federico C. F. Calboli > Neuroepidemiology and Ageing Research > Imperial College, St. Mary's Campus > Norfolk Place, London W2 1PG > > Tel +44 (0)20 75941602 ? Fax +44 (0)20 75943193 > > f.calboli [.a.t] imperial.ac.uk > f.calboli [.a.t] gmail.com > From fincher at cs.fsu.edu Mon Dec 5 19:39:21 2011 From: fincher at cs.fsu.edu (Justin Fincher) Date: Mon, 5 Dec 2011 13:39:21 -0500 Subject: [R] adding hyperlinked text to pdf plot Message-ID: Howdy, I have read that if you put a URL in the text of a plot being saved into pdf, the result is a functional hyperlink. I am interested in having text in a plot that is linked to a URL, but I would like the text to be something other than the URL. Is this possible? Thank you. - Fincher From gianni.lavaredo at gmail.com Mon Dec 5 19:40:57 2011 From: gianni.lavaredo at gmail.com (gianni lavaredo) Date: Mon, 5 Dec 2011 19:40:57 +0100 Subject: [R] explanation why RandomForest don't require a transformations (e.g. logarithmic) of variables Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ted.harding at wlandres.net Mon Dec 5 19:58:56 2011 From: ted.harding at wlandres.net ( (Ted Harding)) Date: Mon, 05 Dec 2011 18:58:56 -0000 (GMT) Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: Message-ID: On 05-Dec-11 18:39:21, Justin Fincher wrote: > Howdy, > I have read that if you put a URL in the text of a plot > being saved into pdf, the result is a functional hyperlink. > I am interested in having text in a plot that is linked to > a URL, but I would like the text to be something other than > the URL. Is this possible? Thank you. > > - Fincher The "kosher" method of doing this kind of thing (and a host of other interactive elements in a PDF file) would be to incorporate a so-called PDFmark into the PDF code. See for instance: http://www.pdflib.com/developer/technical-documentation/ books/pdfmark-primer/ There are various ways of doing this in some document-preparation programs, but I don't know whether it would be easy to do this when creating a PDF in R. In mt experience, this involves first passing via PostScript. Any comments, anyone? Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) Fax-to-email: +44 (0)870 094 0861 Date: 05-Dec-11 Time: 18:58:53 ------------------------------ XFMail ------------------------------ From andy_liaw at merck.com Mon Dec 5 19:59:37 2011 From: andy_liaw at merck.com (Liaw, Andy) Date: Mon, 5 Dec 2011 13:59:37 -0500 Subject: [R] explanation why RandomForest don't require a transformations (e.g. logarithmic) of variables In-Reply-To: References: Message-ID: Tree based models (such as RF) are invriant to monotonic transformations in the predictor (x) variables, because they only use the ranks of the variables, not their actual values. More specifically, they look for splits that are at the mid-points of unique values. Thus the resulting trees are basically identical regardless of how you transform the x variables. Of course, the only, probably minor, differences is, e.g., mid-points can be different between the original and transformed data. While this doesn't impact the training data, it can impact the prediction on test data (although difference should be slight). Transformation of the response variable is quite another thing. RF needs it just as much as others if the situation calls for it. Cheers, Andy > -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of gianni lavaredo > Sent: Monday, December 05, 2011 1:41 PM > To: r-help at r-project.org > Subject: [R] explanation why RandomForest don't require a > transformations (e.g. logarithmic) of variables > > Dear Researches, > > sorry for the easy and common question. I am trying to > justify the idea of > RandomForest don't require a transformations (e.g. logarithmic) of > variables, comparing this non parametrics method with e.g. the linear > regressions. In leteruature to study my phenomena i need to apply a > logarithmic trasformation to describe my model, but i found RF don't > required this approach. Some people could suggest me text or > bibliography > to study? > > thanks in advance > > Gianni > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. > Notice: This e-mail message, together with any attachme...{{dropped:11}} From dwinsemius at comcast.net Mon Dec 5 20:05:14 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Mon, 5 Dec 2011 14:05:14 -0500 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: <8363B812-47B0-4A43-8EF5-CEEC89F80942@comcast.net> On Dec 5, 2011, at 1:39 PM, Justin Fincher wrote: > Howdy, > I have read that if you put a URL in the text of a plot being saved > into pdf, the result is a functional hyperlink. Don't believe everything you read. pdf("test.pdf") plot(1,1,main="http://test.gov/some.htm") dev.off() "Non-functioning" text. > I am interested in > having text in a plot that is linked to a URL, but I would like the > text to be something other than the URL. Is this possible? Thank you. > > - Fincher > David Winsemius, MD West Hartford, CT From xie at yihui.name Mon Dec 5 20:09:56 2011 From: xie at yihui.name (Yihui Xie) Date: Mon, 5 Dec 2011 13:09:56 -0600 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: It seems I missed the context of this post -- who is "you", and what is "something other than the URL"? I feel the tikzDevice package should be an option for the task. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: > Howdy, > ? I have read that if you put a URL in the text of a plot being saved > into pdf, the result is a functional hyperlink. I am interested in > having text in a plot that is linked to a URL, but I would like the > text to be something other than the URL. Is this possible? Thank you. > > - Fincher > > ______________________________________________ > R-help at 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 code. From gianni.lavaredo at gmail.com Mon Dec 5 20:19:18 2011 From: gianni.lavaredo at gmail.com (gianni lavaredo) Date: Mon, 5 Dec 2011 20:19:18 +0100 Subject: [R] explanation why RandomForest don't require a transformations (e.g. logarithmic) of variables In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kehld at ktk.pte.hu Mon Dec 5 20:21:20 2011 From: kehld at ktk.pte.hu (=?ISO-8859-1?Q?Kehl_D=E1niel?=) Date: Mon, 05 Dec 2011 20:21:20 +0100 Subject: [R] lists everywhere In-Reply-To: References: Message-ID: <4EDD19B0.80202@ktk.pte.hu> Dear list members, I have a really simple problem. I connected to a DB and have the following query adat <- dbGetQuery(con, paste("select * from kmdata where SzeAZ='", szeazok[i], "' order by datum", sep="")) now I have the data in the adat variable which is a list. In fact the elements of the list are lists as well > is.list(adat) [1] TRUE > is.list(adat[10]) [1] TRUE > is.list(adat[[10]]) [1] FALSE > is.vector(adat[[10]]) [1] TRUE I simply want to use a function with sapply on the 13-76th columns of the original list. sapply(data[[13:76]], myfunc) does not work of course. I tried to define 13:76 in a vector, still no result. How is it possible? thanks a lot d From andy_liaw at merck.com Mon Dec 5 20:30:16 2011 From: andy_liaw at merck.com (Liaw, Andy) Date: Mon, 5 Dec 2011 14:30:16 -0500 Subject: [R] explanation why RandomForest don't require a transformations (e.g. logarithmic) of variables In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kehld at ktk.pte.hu Mon Dec 5 20:36:09 2011 From: kehld at ktk.pte.hu (=?ISO-8859-1?Q?Kehl_D=E1niel?=) Date: Mon, 05 Dec 2011 20:36:09 +0100 Subject: [R] SOLVED, Re: lists everywhere In-Reply-To: <4EDD19B0.80202@ktk.pte.hu> References: <4EDD19B0.80202@ktk.pte.hu> Message-ID: <4EDD1D29.7000000@ktk.pte.hu> nevermind, typo (and some gray hair) sorry 12/5/2011 8:21 PM keltez?ssel, Kehl D?niel ?rta: > Dear list members, > > I have a really simple problem. > I connected to a DB and have the following query > > adat <- dbGetQuery(con, paste("select * from kmdata where SzeAZ='", > szeazok[i], "' order by datum", sep="")) > > now I have the data in the adat variable which is a list. In fact the > elements of the list are lists as well > > is.list(adat) > [1] TRUE > > is.list(adat[10]) > [1] TRUE > > is.list(adat[[10]]) > [1] FALSE > > is.vector(adat[[10]]) > [1] TRUE > > I simply want to use a function with sapply on the 13-76th columns of > the original list. > sapply(data[[13:76]], myfunc) does not work of course. I tried to > define 13:76 in a vector, still no result. > How is it possible? > > thanks a lot > d > > ______________________________________________ > R-help at 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 code. > > From bt_jannis at yahoo.de Mon Dec 5 20:47:03 2011 From: bt_jannis at yahoo.de (Jannis) Date: Mon, 5 Dec 2011 19:47:03 +0000 (GMT) Subject: [R] installing several versions of R (2.14 and 2.12.2) on the same system on Ubuntu Message-ID: <1323114423.8857.YahooMailNeo@web28210.mail.ukl.yahoo.com> Dear R users, besides the current R 2.14 I would like to install a second version of R (2.12.2) on my Ubuntu system. The current version is easily installed as a precompiled package from Cran but I am heavily fighting with the older version. I tried to follow the instructions here: http://cran.r-project.org/doc/manuals/R-admin.html Unfortunately I got totally confused by all the different locations of the script, the library and the rest of the program. As I understand these all have to be different from the ones of the R 2.14 installation. In case anybody could point me to some nice instructions, fell welcome to do so. Otherwise we would need to check what went wrong during my try. I finally managed to install R.2.12.2 but, as it seems, without Java correctly set up and without tcltk support (both are needed). r-base-dev is installed. This I what I did: 1. downloaded R.2.12.2.tar.gz from Cran 2. tar -xzf R-2.12.2.tar.gz 3. sudo cp R-2.12.2 /usr/lib 4. cd /usr/lib/R.2.12.2 5. mkdir prog 5. sudo ./configure --prefix=/usr/bin 6. sudo make prefix=/usr/lib/R-2.12.2/prog rhome=/usr/lib/R-2.12.2/library 7. sudo mv /usr/bin/R /usr/bin/R-2.12.2 Most probably these two arguments for make are not correct as I did not fully understand the instructions here. Additionally I would need to facilitate tcl/tk and Java. Both works with R.2.14 so their dependecies should be installed but I probably need some more arguments during the build for that. Also this renaming of the R script seems arkward to me but I did this to easily run "R-2.12.2" or "R-2.14" from the command line. Does anybody have any advice on how to fix this stuff? Thanks for your help! Jannis From wdunlap at tibco.com Mon Dec 5 20:50:59 2011 From: wdunlap at tibco.com (William Dunlap) Date: Mon, 5 Dec 2011 19:50:59 +0000 Subject: [R] lists everywhere In-Reply-To: <4EDD19B0.80202@ktk.pte.hu> References: <4EDD19B0.80202@ktk.pte.hu> Message-ID: First, some general suggestions: To see the structure of an object I would recommend the str() function or, for a more concise output, the class() function. I don't think most ordinary users should be using is.list() and, especially, is.vector(). Now for the particulars. dbGetQuery probably returns an object of class "data.frame". data.frames are implemented as lists with certain attributes, so if 'dat' is a data.frame then is.list(dat) reports TRUE. class(dat) would report "data.frame", which is what you want to know. Similarly, dat[1] is a data.frame so is.list(dat[1]) reports TRUE. dat[[1]] is a column of a data.frame, not a data.frame, and class(dat[[1]]) will tell you its class. I haven't come across a case where is.vector is useful. is.vector(x) returns TRUE if x has no attributes other than "names" is x is not a language object, environment, or other esoteric type. E.g., is.vector of a factor object returns FALSE and is.vector of a numeric object or a list object returns TRUE (unless the object has some attributes). is.vector has nothing to do with the concept of a vector in linear algebra (or aviation or physics or almost anywhere else). Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Kehl D?niel > Sent: Monday, December 05, 2011 11:21 AM > To: r-help at r-project.org > Subject: [R] lists everywhere > > Dear list members, > > I have a really simple problem. > I connected to a DB and have the following query > > adat <- dbGetQuery(con, paste("select * from kmdata where SzeAZ='", > szeazok[i], "' order by datum", sep="")) > > now I have the data in the adat variable which is a list. In fact the > elements of the list are lists as well > > is.list(adat) > [1] TRUE > > is.list(adat[10]) > [1] TRUE > > is.list(adat[[10]]) > [1] FALSE > > is.vector(adat[[10]]) > [1] TRUE > > I simply want to use a function with sapply on the 13-76th columns of > the original list. > sapply(data[[13:76]], myfunc) does not work of course. I tried to define > 13:76 in a vector, still no result. > How is it possible? > > thanks a lot > d > > ______________________________________________ > R-help at 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 code. From fincher at cs.fsu.edu Mon Dec 5 21:10:57 2011 From: fincher at cs.fsu.edu (Justin Fincher) Date: Mon, 5 Dec 2011 15:10:57 -0500 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: For example, say I am plotting some data that is genomic and therefore maps to a specific locus on the human genome, like a gene. I was hoping to have the title of the plot display the gene name, but have it be a link so that clicking on it would take you to those coordinates on a public browser, like USCS's genome browser. So basically, I was hoping to have text in a plot generated by R function as a normal html-style link. - Fincher On Mon, Dec 5, 2011 at 14:09, Yihui Xie wrote: > It seems I missed the context of this post -- who is "you", and what > is "something other than the URL"? > > I feel the tikzDevice package should be an option for the task. > > Regards, > Yihui > -- > Yihui Xie > Phone: 515-294-2465 Web: http://yihui.name > Department of Statistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > > On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: >> Howdy, >> ? I have read that if you put a URL in the text of a plot being saved >> into pdf, the result is a functional hyperlink. I am interested in >> having text in a plot that is linked to a URL, but I would like the >> text to be something other than the URL. Is this possible? Thank you. >> >> - Fincher >> >> ______________________________________________ >> R-help at 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 code. > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > From xie at yihui.name Mon Dec 5 21:20:04 2011 From: xie at yihui.name (Yihui Xie) Date: Mon, 5 Dec 2011 14:20:04 -0600 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: Sorry I experimented with tikzDevice using \href{}{} but failed. You can probably try the old image hotspot technique in HTML. I remember someone did this before in R, but I cannot find the link to the work now. The key is your need to use the two functions grconvertX and grconvertY. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Dec 5, 2011 at 2:10 PM, Justin Fincher wrote: > For example, say I am plotting some data that is genomic and therefore > maps to a specific locus on the human genome, like a gene. ?I was > hoping to have the title of the plot display the gene name, but have > it be a link so that clicking on it would take you to those > coordinates on a public browser, like USCS's genome browser. ?So > basically, I was hoping to have text in a plot generated by R function > as a normal html-style link. > > - Fincher > > > On Mon, Dec 5, 2011 at 14:09, Yihui Xie wrote: >> It seems I missed the context of this post -- who is "you", and what >> is "something other than the URL"? >> >> I feel the tikzDevice package should be an option for the task. >> >> Regards, >> Yihui >> -- >> Yihui Xie >> Phone: 515-294-2465 Web: http://yihui.name >> Department of Statistics, Iowa State University >> 2215 Snedecor Hall, Ames, IA >> >> >> >> On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: >>> Howdy, >>> ? I have read that if you put a URL in the text of a plot being saved >>> into pdf, the result is a functional hyperlink. I am interested in >>> having text in a plot that is linked to a URL, but I would like the >>> text to be something other than the URL. Is this possible? Thank you. >>> >>> - Fincher >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> From murdoch.duncan at gmail.com Mon Dec 5 21:20:37 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Mon, 05 Dec 2011 15:20:37 -0500 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: <4EDD2795.2070702@gmail.com> On 05/12/2011 3:10 PM, Justin Fincher wrote: > For example, say I am plotting some data that is genomic and therefore > maps to a specific locus on the human genome, like a gene. I was > hoping to have the title of the plot display the gene name, but have > it be a link so that clicking on it would take you to those > coordinates on a public browser, like USCS's genome browser. So > basically, I was hoping to have text in a plot generated by R function > as a normal html-style link. Just use Sweave, and put the URL in a LaTeX \href{URL}{text} tag, not in the R code. This can be generated in R code in \Sexp{}. It's not part of the PDF image, but it's part of the final document. Duncan Murdoch > - Fincher > > > On Mon, Dec 5, 2011 at 14:09, Yihui Xie wrote: > > It seems I missed the context of this post -- who is "you", and what > > is "something other than the URL"? > > > > I feel the tikzDevice package should be an option for the task. > > > > Regards, > > Yihui > > -- > > Yihui Xie > > Phone: 515-294-2465 Web: http://yihui.name > > Department of Statistics, Iowa State University > > 2215 Snedecor Hall, Ames, IA > > > > > > > > On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: > >> Howdy, > >> I have read that if you put a URL in the text of a plot being saved > >> into pdf, the result is a functional hyperlink. I am interested in > >> having text in a plot that is linked to a URL, but I would like the > >> text to be something other than the URL. Is this possible? Thank you. > >> > >> - Fincher > >> > >> ______________________________________________ > >> R-help at 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 code. > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > > > ______________________________________________ > R-help at 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 code. From p.murrell at auckland.ac.nz Mon Dec 5 21:30:50 2011 From: p.murrell at auckland.ac.nz (Paul Murrell) Date: Tue, 06 Dec 2011 09:30:50 +1300 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: <4EDD29FA.8040004@auckland.ac.nz> Hi On 6/12/2011 9:10 a.m., Justin Fincher wrote: > For example, say I am plotting some data that is genomic and therefore > maps to a specific locus on the human genome, like a gene. I was > hoping to have the title of the plot display the gene name, but have > it be a link so that clicking on it would take you to those > coordinates on a public browser, like USCS's genome browser. So > basically, I was hoping to have text in a plot generated by R function > as a normal html-style link. The 'gridSVG' package will let you associate a hyperlink with text (or anything else) and produce SVG that can then be viewed in a web page (as long as your plot is a 'lattice' or 'ggplot2' one). Paul > - Fincher > > > On Mon, Dec 5, 2011 at 14:09, Yihui Xie wrote: >> It seems I missed the context of this post -- who is "you", and what >> is "something other than the URL"? >> >> I feel the tikzDevice package should be an option for the task. >> >> Regards, >> Yihui >> -- >> Yihui Xie >> Phone: 515-294-2465 Web: http://yihui.name >> Department of Statistics, Iowa State University >> 2215 Snedecor Hall, Ames, IA >> >> >> >> On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: >>> Howdy, >>> I have read that if you put a URL in the text of a plot being saved >>> into pdf, the result is a functional hyperlink. I am interested in >>> having text in a plot that is linked to a URL, but I would like the >>> text to be something other than the URL. Is this possible? Thank you. >>> >>> - Fincher >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> > > ______________________________________________ > R-help at 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 code. -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/ From diviya.smith at gmail.com Mon Dec 5 21:37:31 2011 From: diviya.smith at gmail.com (Diviya Smith) Date: Mon, 5 Dec 2011 15:37:31 -0500 Subject: [R] Binning the data based on a value Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Mon Dec 5 21:41:36 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 15:41:36 -0500 Subject: [R] Binning the data based on a value In-Reply-To: References: Message-ID: I'd so something like split(a, a$spending) and you can include a round(a$spending, -2) or something similar if you want to group by the 100's. Michael On Mon, Dec 5, 2011 at 3:37 PM, Diviya Smith wrote: > Hello there, > > I have a matrix with some data and I want to split this matrix based on the > values in one column. Is there a quick way of doing this? I have looked at > cut but I am not sure how to exactly use it? > for example: > > I would like to split the matrix "a" based on the spending such that the > data is binned groups [0..99],[100..199]...and so on. > > a <- data.frame(patient=1:7, charges=c(100,500,200,90,400,500,600), > ?age=c(0,3,5,7,10,16,19), ?spending=c(10, 60, 110, 200, 250, 400, 450)) > > Expected ?output - > bin[1] <- c(10, 60) > bin[2] <- c(110, 200, 250) > bin[3] <- c(400, 450) > > NOTE that the number of data points in each bin is not the same and the > empty bins are removed (since there are no points between [199..299], > bin[3] starts at 400. > > Any help would be most appreciated. Thank you in advance. > > Diviya > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 21:43:52 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 15:43:52 -0500 Subject: [R] Binning the data based on a value In-Reply-To: References: Message-ID: Just a clarification: I can't get round to work as I first expected so if you want to do bins by 100's you'd probably want: split(a, cut(a$spending, breaks = (0:5)*100)) Michael On Mon, Dec 5, 2011 at 3:41 PM, R. Michael Weylandt wrote: > I'd so something like > > split(a, a$spending) > > and you can include a round(a$spending, -2) or something similar if > you want to group by the 100's. > > Michael > > On Mon, Dec 5, 2011 at 3:37 PM, Diviya Smith wrote: >> Hello there, >> >> I have a matrix with some data and I want to split this matrix based on the >> values in one column. Is there a quick way of doing this? I have looked at >> cut but I am not sure how to exactly use it? >> for example: >> >> I would like to split the matrix "a" based on the spending such that the >> data is binned groups [0..99],[100..199]...and so on. >> >> a <- data.frame(patient=1:7, charges=c(100,500,200,90,400,500,600), >> ?age=c(0,3,5,7,10,16,19), ?spending=c(10, 60, 110, 200, 250, 400, 450)) >> >> Expected ?output - >> bin[1] <- c(10, 60) >> bin[2] <- c(110, 200, 250) >> bin[3] <- c(400, 450) >> >> NOTE that the number of data points in each bin is not the same and the >> empty bins are removed (since there are no points between [199..299], >> bin[3] starts at 400. >> >> Any help would be most appreciated. Thank you in advance. >> >> Diviya >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. From gyanendra.pokharel at gmail.com Mon Dec 5 21:46:18 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 15:46:18 -0500 Subject: [R] Problem in while loop Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gyanendra.pokharel at gmail.com Mon Dec 5 21:47:59 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 15:47:59 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rcreeves at west.net Mon Dec 5 21:04:51 2011 From: rcreeves at west.net (Rick Reeves) Date: Mon, 05 Dec 2011 12:04:51 -0800 Subject: [R] args() function does not list function prototype for locally-produced/installed R package Message-ID: <4EDD23E3.2080802@west.net> Greetings: I have check the 'Building R Extensions' manual and can find no advice on this issue, so I am asking -- I have created an R package consisting entirely of R source code, and created an installer using the R CMD build / R CMD check commands. The package installs correctly, using R CMD install, and the .Rd files for each function (one function per .R / .Rd file) are visible using the '?function' command. However, the 'args(function)' command does not list the function prototype; instead generating the error: Error in args(function) : object "function" not found. Question: If it is possible, what changes do I make to my package and install process to get args() to display the function prototype(s) for the functions in my local package? Thanks, Rick Reeves From h_a_patience at hotmail.com Mon Dec 5 20:24:41 2011 From: h_a_patience at hotmail.com (Bazman76) Date: Mon, 5 Dec 2011 11:24:41 -0800 (PST) Subject: [R] a question on autocorrelation acf In-Reply-To: References: <4BDA115C.9040504@gmail.com> Message-ID: <1323113081359-4161818.post@n4.nabble.com> Hi there, I am wondering how R calculates the acf too? I have a data set of approx 1500 returns when I calculate the lag 1 autocorrelation in excel I get a value of -0.4 but in R its approximately -0.18? I have cross checked with PC give and PC give agrees with excel? I'm sure its just some kind of scaling but it would be nice to resolve this discrepency! Baz -- View this message in context: http://r.789695.n4.nabble.com/a-question-on-autocorrelation-acf-tp2076280p4161818.html Sent from the R help mailing list archive at Nabble.com. From ajdowd at hotmail.co.uk Mon Dec 5 21:57:34 2011 From: ajdowd at hotmail.co.uk (Gathurst) Date: Mon, 5 Dec 2011 12:57:34 -0800 (PST) Subject: [R] Summary coefficients give NA values because of singularities Message-ID: <1323118654603-4162113.post@n4.nabble.com> Hello, I have a data set which I am using to find a model with the most significant parameters included and most importantly, the p-values. The full model is of the form: sad[,1]~b_1 sad[,2]+b_2 sad[,3]+b_3 sad[,4]+b_4 sad[,5]+b_5 sad[,6]+b_6 sad[,7]+b_7 sad[,8]+b_8 sad[,9]+b_9 sad[,10], where the 9 variables on the right hand side are all indicator variables. The thing I don't understand is the line ' sad[, 10] NA NA NA NA ' as a result of 'Coefficients: (1 not defined because of singularities)'. I think the output is taking sad[,10] as the intercept, based on previous attempts at figuring my issue out, which I find a bit wierd considering sad[,10] is either 0 or 1. How do I produce the correct output showing all p-values? My code and output is as follows: sad<-matrix(1,ncol=11,nrow=486) sad[,c(1:10)]<-d[,2][-357] sad[,1]<-d[,29][-357] sad[,2][sad[,2]!=1]<-0 sad[,3][sad[,3]!=2]<-0 sad[,4][sad[,4]!=3]<-0 sad[,5][sad[,5]!=4]<-0 sad[,6][sad[,6]!=5]<-0 sad[,7][sad[,7]!=6]<-0 sad[,8][sad[,8]!=7]<-0 sad[,9][sad[,9]!=8]<-0 sad[,10][sad[,10]!=9]<-0 sad[,2][sad[,2]==1]<-1 sad[,3][sad[,3]==2]<-1 sad[,4][sad[,4]==3]<-1 sad[,5][sad[,5]==4]<-1 sad[,6][sad[,6]==5]<-1 sad[,7][sad[,7]==6]<-1 sad[,8][sad[,8]==7]<-1 sad[,9][sad[,9]==8]<-1 sad[,10][sad[,10]==9]<-1 sad summary(lm(sad[,1]~sad[,2]+sad[,3] +sad[,4]+sad[,5]+sad[,6] +sad[,7]+sad[,8]+sad[,9]+sad[,10])) Call: lm(formula = sad[, 1] ~ sad[, 2] + sad[, 3] + sad[, 4] + sad[, 5] + sad[, 6] + sad[, 7] + sad[, 8] + sad[, 9] + sad[, 10]) Residuals: Min 1Q Median 3Q Max -3.3191 -0.3893 0.0519 0.7436 1.0519 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 4.34091 0.14495 29.947 <2e-16 *** sad[, 2] -0.16142 0.18128 -0.890 0.3737 sad[, 3] -0.23221 0.20275 -1.145 0.2527 sad[, 4] 0.17832 0.19695 0.905 0.3657 sad[, 5] 0.06450 0.21447 0.301 0.7638 sad[, 6] -0.15909 0.18713 -0.850 0.3957 sad[, 7] -0.39286 0.18171 -2.162 0.0311 * sad[, 8] -0.08450 0.21146 -0.400 0.6896 sad[, 9] -0.02176 0.20170 -0.108 0.9141 sad[, 10] NA NA NA NA --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Residual standard error: 0.9615 on 477 degrees of freedom Multiple R-squared: 0.02984, Adjusted R-squared: 0.01357 F-statistic: 1.834 on 8 and 477 DF, p-value: 0.06869 Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/Summary-coefficients-give-NA-values-because-of-singularities-tp4162113p4162113.html Sent from the R help mailing list archive at Nabble.com. From peter.langfelder at gmail.com Mon Dec 5 22:03:27 2011 From: peter.langfelder at gmail.com (Peter Langfelder) Date: Mon, 5 Dec 2011 13:03:27 -0800 Subject: [R] installing several versions of R (2.14 and 2.12.2) on the same system on Ubuntu In-Reply-To: <1323114423.8857.YahooMailNeo@web28210.mail.ukl.yahoo.com> References: <1323114423.8857.YahooMailNeo@web28210.mail.ukl.yahoo.com> Message-ID: On Mon, Dec 5, 2011 at 11:47 AM, Jannis wrote: > Dear R users, > > > besides the current R 2.14 I would like to install a second version of R (2.12.2) on my Ubuntu system. The current version is easily installed as a precompiled package from Cran but I am heavily fighting with the older version. I tried to follow the instructions here: > > http://cran.r-project.org/doc/manuals/R-admin.html > > Unfortunately I got totally confused by all the different locations of the script, the library and the rest of the program. As I understand these all have to be different from the ones of the R 2.14 installation. In case anybody could point me to some nice instructions, fell welcome to do so. > > > Otherwise we would need to check what went wrong during my try. I finally managed to install R.2.12.2 but, as it seems, without Java correctly set up and without tcltk support (both are needed). r-base-dev is installed. > > > This I what I did: > > 1. downloaded R.2.12.2.tar.gz from Cran > 2. tar -xzf R-2.12.2.tar.gz > 3. sudo cp R-2.12.2 /usr/lib > 4. cd /usr/lib/R.2.12.2 > 5. mkdir prog > 5. sudo ./configure --prefix=/usr/bin > 6. sudo make prefix=/usr/lib/R-2.12.2/prog rhome=/usr/lib/R-2.12.2/library > > 7. sudo mv /usr/bin/R /usr/bin/R-2.12.2 > > > Most probably these two arguments for make are not correct as I did not fully understand the instructions here. Additionally I would need to facilitate tcl/tk and Java. Both works with R.2.14 so their dependecies should be installed but I probably need some more arguments during the build for that. Also this renaming of the R script seems arkward to me but I did this to easily run "R-2.12.2" or "R-2.14" from the command line. > > > Does anybody have any advice on how to fix this stuff? I think you did basically the right thing. To be able to compile R with tcl/tk, you have to install the development files for tcl/tk - on Fedora the files are contained in package tcl-devel (this is a Fedora/Ubuntu package, not an R package). Then run the entire compilation process (./configure, make, make install) again. When you install a pre-compiled R, you don't need the development files, which is probably why you never needed them in the past. I'm not sure about Java - you may want to examine the output of configure (which is usually saved in configure.log) to see what is missing. HTH, Peter From diviya.smith at gmail.com Mon Dec 5 22:06:48 2011 From: diviya.smith at gmail.com (Diviya Smith) Date: Mon, 5 Dec 2011 16:06:48 -0500 Subject: [R] Binning the data based on a value In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Mon Dec 5 22:09:10 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 16:09:10 -0500 Subject: [R] Binning the data based on a value In-Reply-To: References: Message-ID: Add the drop = TRUE command to split ?split split(a, cut(a$spending, breaks = (0:5)*100), drop = TRUE) Michael On Mon, Dec 5, 2011 at 4:06 PM, Diviya Smith wrote: > Thank you very much Michael. This is very helpful. However, if there is any > way to exclude zero length bins. Lets imagine that the matrix was as follows > - > > a <- data.frame(patient=1:7, charges=c(100,500,200,90,400,500,600), > ?age=c(0,3,5,7,10,16,19), ?spending=c(10, 60, 110, 200, 400, 450, 500)) > > bins <- split(a, cut(a$spending, breaks = (0:5)*100) > > then bins[3] = > $`(200,300]` > [1] patient ?charges ?age ? ? ?spending > <0 rows> (or 0-length row.names) > > Is there a way to exclude this? > > Priya > > On Mon, Dec 5, 2011 at 3:43 PM, R. Michael Weylandt > wrote: >> >> Just a clarification: I can't get round to work as I first expected so >> if you want to do bins by 100's you'd probably want: >> >> split(a, cut(a$spending, breaks = (0:5)*100)) >> >> Michael >> >> On Mon, Dec 5, 2011 at 3:41 PM, R. Michael Weylandt >> wrote: >> > I'd so something like >> > >> > split(a, a$spending) >> > >> > and you can include a round(a$spending, -2) or something similar if >> > you want to group by the 100's. >> > >> > Michael >> > >> > On Mon, Dec 5, 2011 at 3:37 PM, Diviya Smith >> > wrote: >> >> Hello there, >> >> >> >> I have a matrix with some data and I want to split this matrix based on >> >> the >> >> values in one column. Is there a quick way of doing this? I have looked >> >> at >> >> cut but I am not sure how to exactly use it? >> >> for example: >> >> >> >> I would like to split the matrix "a" based on the spending such that >> >> the >> >> data is binned groups [0..99],[100..199]...and so on. >> >> >> >> a <- data.frame(patient=1:7, charges=c(100,500,200,90,400,500,600), >> >> ?age=c(0,3,5,7,10,16,19), ?spending=c(10, 60, 110, 200, 250, 400, 450)) >> >> >> >> Expected ?output - >> >> bin[1] <- c(10, 60) >> >> bin[2] <- c(110, 200, 250) >> >> bin[3] <- c(400, 450) >> >> >> >> NOTE that the number of data points in each bin is not the same and the >> >> empty bins are removed (since there are no points between [199..299], >> >> bin[3] starts at 400. >> >> >> >> Any help would be most appreciated. Thank you in advance. >> >> >> >> Diviya >> >> >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> >> >> ______________________________________________ >> >> R-help at 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 code. > > From michael.weylandt at gmail.com Mon Dec 5 22:23:49 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 16:23:49 -0500 Subject: [R] a question on autocorrelation acf In-Reply-To: <1323113081359-4161818.post@n4.nabble.com> References: <4BDA115C.9040504@gmail.com> <1323113081359-4161818.post@n4.nabble.com> Message-ID: Did you check the MASS reference given above in the thread? If you want to see the source, it's here: http://svn.r-project.org/R/trunk/src/library/stats/src/filter.c (best I can tell) Michael On Mon, Dec 5, 2011 at 2:24 PM, Bazman76 wrote: > Hi there, > > I am wondering how R calculates the acf too? > > I have a data set of approx 1500 returns when I calculate the lag 1 > autocorrelation in excel I get a value of -0.4 but in R its approximately > -0.18? > > I have cross checked with PC give and PC give agrees with excel? > > I'm sure its just some kind of scaling but it would be nice to resolve this > discrepency! > > Baz > > -- > View this message in context: http://r.789695.n4.nabble.com/a-question-on-autocorrelation-acf-tp2076280p4161818.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From void1999 at gmail.com Mon Dec 5 22:35:45 2011 From: void1999 at gmail.com (zz dd) Date: Mon, 5 Dec 2011 22:35:45 +0100 Subject: [R] nipals in the chemometrics package in R In-Reply-To: References: <1c18fb68-fdbd-4525-904d-496361f639b1@email.android.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From un_tonio at yahoo.com Mon Dec 5 22:47:32 2011 From: un_tonio at yahoo.com (Tonio) Date: Mon, 5 Dec 2011 13:47:32 -0800 (PST) Subject: [R] Toggle cASE In-Reply-To: <4EDCB756.2080509@uke.de> References: <1323069111.20601.YahooMailNeo@web130111.mail.mud.yahoo.com> <4EDCB756.2080509@uke.de> Message-ID: <1323121652.3211.YahooMailNeo@web130113.mail.mud.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Mintewab.Bezabih at economics.gu.se Mon Dec 5 22:55:58 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Mon, 5 Dec 2011 22:55:58 +0100 Subject: [R] problems using the thin plate spline method In-Reply-To: <292964CB-7BD6-4F59-BC60-1256C3571180@gmail.com> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578CD@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D2@HGUMAIL6.hgu.gu.se> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D3@HGUMAIL6.hgu.gu.se> <67c9a4a2-ee18-49b6-a1a1-791a2d3bda2e@email.android.com> <4B46FB7EED800046A5952FCFA92D3BA0347DF578D5@HGUMAIL6.hgu.gu.se>, <292964CB-7BD6-4F59-BC60-1256C3571180@gmail.com> Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D7@HGUMAIL6.hgu.gu.se> Dear Michael and R users, I generated a more orderly looking data again and below are the data and the codes I am trying to run. many thanks mintewab dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") names(dat) <- c("x1", "x2", "y") library(fidelds) plot (dat) plot (dat$x1, dat$x2) #load the fields package (containing Tps) and fit a thin plate spline tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") x1 x2 y 1 409.50 673.0 1082.50 2 349.00 335.0 684.00 3 385.50 1737.0 2122.50 4 273.00 457.0 730.00 5 543.00 2325.0 2868.00 6 746.00 1255.0 2001.00 7 198.75 388.0 586.75 8 262.50 104.0 366.50 9 320.50 786.0 1106.50 10 259.00 516.0 775.00 11 399.50 542.0 941.50 12 595.50 916.0 1511.50 13 374.00 1257.0 1631.00 14 293.00 229.0 522.00 15 330.00 490.0 820.00 16 658.00 1016.0 1674.00 17 299.00 266.0 565.00 18 775.00 1139.0 1914.00 19 559.75 1023.0 1582.75 20 251.00 153.0 404.00 21 402.00 253.0 655.00 22 395.50 319.0 714.50 23 345.50 456.0 801.50 24 283.50 400.0 683.50 25 452.00 388.0 840.00 26 816.50 941.0 1757.50 27 266.50 307.0 573.50 28 360.25 683.0 1043.25 29 386.00 528.0 914.00 30 160.25 368.0 528.25 31 360.00 455.0 815.00 32 337.00 488.0 825.00 33 326.00 702.0 1028.00 34 758.00 1040.0 1798.00 35 342.50 405.0 747.50 36 389.00 483.0 872.00 37 347.50 524.0 871.50 38 819.25 490.0 1309.25 39 355.25 517.0 872.25 40 281.00 505.0 786.00 41 494.50 844.0 1338.50 42 514.50 429.0 943.50 43 263.00 349.0 612.00 44 439.00 549.0 988.00 45 263.00 450.0 713.00 46 373.25 1212.0 1585.25 47 546.00 546.0 1092.00 48 348.00 485.0 833.00 49 380.50 378.0 758.50 50 606.00 598.0 1204.00 51 460.00 838.0 1298.00 52 352.50 519.0 871.50 53 737.00 624.0 1361.00 54 275.00 185.0 460.00 55 520.50 632.0 1152.50 56 385.25 696.5 1081.75 57 354.50 524.0 878.50 58 383.50 618.0 1001.50 59 322.50 381.0 703.50 60 309.00 380.0 689.00 61 502.50 624.0 1126.50 62 517.00 612.0 1129.00 63 276.00 260.0 513.00 64 400.50 831.0 1231.50 65 272.50 451.0 723.50 66 NA 284.0 NA 67 253.00 353.0 606.00 68 311.00 720.0 1031.00 69 389.00 583.0 972.00 70 157.75 344.0 501.75 71 520.00 1175.0 1695.00 72 499.50 761.0 1260.50 73 481.00 694.0 1275.00 74 448.50 606.0 1054.50 75 335.50 239.0 574.50 76 231.50 273.0 504.50 77 492.50 394.0 886.50 78 477.50 899.0 1376.50 79 650.00 721.0 1371.00 80 540.75 730.0 1270.75 81 620.50 1295.0 1915.50 82 400.50 1148.0 1548.50 83 331.50 524.0 855.50 84 311.00 578.0 889.00 85 229.00 262.0 491.00 86 432.50 326.0 758.50 87 422.75 217.0 639.75 88 493.50 648.0 1141.50 89 414.25 485.0 899.25 90 487.00 726.0 1213.00 91 369.00 747.0 1116.00 92 425.00 1663.0 2088.00 93 233.50 269.0 502.50 94 254.50 488.5 743.00 95 417.50 1137.0 1554.50 96 NA 310.0 NA 97 583.25 434.0 1017.25 98 492.50 536.0 1028.50 99 490.00 486.0 976.00 100 300.25 1225.0 1525.25 101 NA 462.0 NA 102 270.00 237.0 507.00 103 307.00 230.0 537.00 104 319.00 242.0 561.00 105 374.50 340.0 714.50 106 562.50 521.0 1083.50 107 569.50 242.0 811.50 108 389.75 389.0 778.75 109 341.25 691.0 1032.25 110 366.00 387.0 753.00 111 262.75 615.0 877.75 112 776.25 1926.0 2702.25 113 379.50 597.0 976.50 114 360.00 299.0 659.00 115 203.75 213.0 416.75 116 517.00 618.0 1135.00 117 539.50 684.0 1223.50 118 418.75 439.0 857.75 119 353.50 459.0 812.50 120 269.00 366.0 635.00 121 475.50 1098.0 1573.50 122 472.00 384.0 856.00 123 342.00 488.0 830.00 124 189.00 181.0 370.00 125 492.50 5342.0 5834.50 126 412.00 433.0 845.00 127 467.50 1475.0 1942.50 128 209.75 480.0 689.75 129 340.75 207.0 547.75 130 231.50 153.0 384.50 131 185.50 295.0 480.50 132 358.50 524.0 882.50 133 354.00 453.0 807.00 134 670.50 978.0 1648.50 135 686.00 486.0 1172.00 136 364.00 676.0 1040.00 137 138.00 336.0 474.00 138 272.00 254.0 526.00 139 183.00 273.0 456.00 140 365.25 255.0 620.25 141 188.00 347.0 535.00 142 229.50 420.0 649.50 143 553.50 603.0 1156.50 144 582.50 739.0 1321.50 145 469.00 340.0 809.00 146 359.50 572.0 931.50 147 284.25 441.0 725.25 148 582.50 833.0 1415.50 149 287.00 775.0 1062.00 150 NA 129.0 NA 151 455.25 350.0 805.25 152 410.50 1445.0 1855.50 153 477.00 328.0 805.00 154 239.00 585.0 824.00 155 313.50 412.0 725.50 156 294.50 446.0 740.50 157 523.00 679.0 1202.00 158 372.50 519.0 891.50 159 231.50 372.0 603.50 160 NA 1712.0 NA 161 365.00 167.0 532.00 162 269.50 492.0 761.50 163 394.50 593.0 987.50 164 281.50 210.0 491.50 165 418.50 363.0 781.50 166 553.50 630.0 1183.50 167 245.75 261.0 506.75 168 304.00 869.0 1173.00 169 423.75 676.0 1099.75 170 369.50 253.0 622.50 171 330.50 923.0 1253.50 172 278.00 791.0 1069.00 173 257.00 415.0 672.00 174 416.50 349.0 765.50 175 413.25 825.0 1238.25 176 465.50 486.0 951.50 177 877.25 508.0 1385.25 178 204.00 191.0 395.00 179 475.00 282.0 757.00 180 289.00 267.0 556.00 181 425.75 372.0 797.75 182 405.00 639.0 1044.00 183 494.25 687.0 1181.25 184 332.00 1427.0 1759.00 185 552.50 847.0 1399.50 186 433.75 368.0 801.75 187 821.00 616.0 1437.00 188 841.50 1723.0 2564.50 189 226.50 310.0 536.50 190 266.75 449.0 715.75 191 552.00 301.0 853.00 192 157.50 378.0 535.50 193 528.50 573.0 1101.50 194 248.50 273.0 521.50 195 245.50 405.0 650.50 196 303.00 653.0 956.00 197 444.25 606.0 1050.25 198 310.00 943.0 1253.00 199 768.25 926.0 1694.25 200 265.50 399.0 664.50 201 98.25 282.0 380.25 202 525.00 1112.0 1637.00 203 407.75 484.0 891.75 204 163.50 408.0 571.50 205 374.25 434.0 808.25 206 749.00 595.0 1344.00 207 318.50 223.0 541.50 208 367.00 517.0 884.00 209 250.00 323.0 573.00 210 408.00 353.0 761.00 211 341.50 628.0 969.50 212 266.50 334.0 600.50 213 348.50 502.0 850.50 214 398.50 861.0 1259.50 215 429.50 361.0 790.50 216 420.00 464.0 884.00 217 263.50 285.0 548.50 218 581.50 693.0 1274.50 219 509.50 129.0 610.50 220 724.75 817.0 1541.75 221 476.50 516.0 992.50 222 249.50 291.0 540.50 223 297.50 211.0 508.50 224 245.00 232.0 477.00 225 139.50 269.0 408.50 226 360.50 378.0 738.50 227 983.50 2560.5 3544.00 228 465.50 662.0 1127.50 229 263.75 580.0 843.75 230 NA 531.0 NA 231 510.00 1334.0 1844.00 232 325.00 384.0 709.00 233 122.50 217.0 339.50 234 455.50 714.0 1169.50 235 531.00 766.0 1297.00 236 318.00 648.0 966.00 237 373.00 288.0 661.00 238 487.00 722.0 1209.00 239 401.00 917.0 1318.00 240 451.75 359.0 810.75 241 561.00 576.0 1137.00 242 364.50 383.0 747.50 243 439.50 546.0 985.50 244 733.50 1379.0 2112.50 245 455.00 622.0 1077.00 246 376.50 201.0 577.50 247 554.00 549.0 1103.00 248 409.50 575.0 984.50 249 1007.50 1416.0 2423.50 250 462.50 496.0 958.50 251 183.00 111.0 294.00 252 342.50 406.0 748.50 253 304.00 519.0 823.00 254 258.25 294.0 552.25 255 380.50 343.0 723.50 256 373.00 437.0 810.00 257 683.00 972.0 1655.00 258 577.00 1403.0 1980.00 259 430.00 471.0 901.00 260 324.25 368.0 692.25 261 312.00 459.0 771.00 262 389.00 617.0 1006.00 263 345.00 444.0 789.00 264 358.50 312.0 670.50 265 551.75 963.0 1514.75 266 317.50 315.0 632.50 267 499.00 549.0 1048.00 268 335.50 1022.0 1357.50 269 450.50 423.0 873.50 270 363.50 384.0 747.50 271 185.00 195.0 380.00 272 177.50 265.0 442.50 273 477.75 827.0 1304.75 274 644.50 827.0 1471.50 275 290.25 309.0 599.25 276 457.50 546.0 1003.50 277 295.50 385.0 680.50 278 266.50 380.0 646.50 279 348.50 422.0 770.50 280 357.75 188.0 545.75 281 221.50 378.0 599.50 282 739.00 772.0 1511.00 283 445.50 233.0 678.50 284 416.00 339.0 755.00 285 261.50 952.0 1213.50 286 909.00 1336.0 2245.00 287 737.50 1740.0 2477.50 288 194.50 256.0 450.50 289 438.50 772.0 1210.50 290 358.00 462.0 820.00 291 244.00 254.0 498.00 292 388.50 243.0 631.50 293 512.50 332.0 844.50 294 315.25 871.0 1186.25 295 572.00 562.0 1134.00 296 473.75 1761.0 2234.75 297 627.50 689.0 1316.50 298 507.75 623.0 1130.75 299 281.00 286.0 567.00 300 511.50 233.0 744.50 301 309.25 668.0 977.25 302 308.25 1078.0 1386.25 303 690.00 682.0 1372.00 304 180.00 169.0 349.00 305 341.50 437.0 778.50 306 273.00 943.0 1216.00 307 571.00 724.0 1295.00 308 694.00 614.0 1308.00 309 345.00 439.0 784.00 310 497.00 344.0 841.00 311 219.00 297.0 516.00 312 311.50 384.0 695.50 313 458.50 569.0 1027.50 314 283.00 187.0 470.00 315 274.00 498.0 772.00 316 282.50 335.0 617.50 317 187.50 339.0 526.50 318 332.00 289.0 621.00 319 281.75 431.0 712.75 320 397.75 549.0 946.75 321 336.50 334.0 670.50 322 392.50 482.0 874.50 323 318.00 363.0 681.00 324 609.50 663.0 1272.50 325 203.50 192.0 395.50 326 144.50 60.0 204.50 327 504.75 468.0 972.75 328 647.00 582.0 1229.00 329 374.00 365.0 739.00 330 149.50 479.0 658.50 331 319.00 983.0 1302.00 332 306.00 668.0 974.00 333 304.75 605.0 909.75 334 304.50 231.0 535.50 335 247.00 457.0 704.00 336 329.00 469.0 798.00 337 442.00 664.0 1106.00 338 308.00 490.0 798.00 339 316.00 274.0 590.00 340 219.00 580.0 799.00 341 556.50 476.0 1032.50 342 643.50 385.0 1028.50 343 328.50 302.0 630.50 344 301.00 607.0 908.00 345 467.00 1723.0 2190.00 346 452.50 441.0 893.50 347 351.50 463.0 814.50 348 373.00 229.0 602.00 349 503.50 138.0 641.50 350 287.50 279.0 566.50 351 393.50 245.0 638.50 352 444.00 1081.0 1525.00 353 734.00 1080.0 1814.00 354 458.50 1745.0 2203.50 355 1182.00 1157.0 2339.00 356 406.00 338.0 744.00 357 286.50 571.0 857.50 358 283.50 211.0 494.50 359 642.50 2256.0 2898.50 360 453.50 778.0 1231.50 361 206.00 224.0 430.00 362 258.00 158.0 416.00 363 412.00 393.0 805.00 364 551.00 661.5 1212.50 365 784.75 4828.0 5612.75 366 316.50 478.0 794.50 367 326.50 687.0 1013.50 368 202.25 497.0 699.25 369 336.75 244.0 580.75 370 406.00 455.0 861.00 371 225.50 390.0 615.50 372 266.00 271.0 537.00 373 916.50 849.0 1765.50 374 387.00 316.0 703.00 375 496.25 785.0 1281.25 376 389.00 464.0 853.00 377 668.50 509.0 1177.50 378 192.00 338.0 530.00 379 396.00 567.0 963.00 380 282.50 726.0 1008.50 381 414.50 742.0 1156.50 382 355.00 515.0 870.00 383 294.50 245.0 539.50 384 396.50 501.0 897.50 385 348.75 359.0 707.75 386 241.75 220.0 461.75 387 347.50 555.0 902.50 388 250.00 424.0 674.00 389 473.50 592.0 1065.50 390 369.00 1470.0 1839.00 391 672.00 441.0 1113.00 392 199.50 177.0 376.50 393 318.25 1302.0 1620.25 394 219.75 245.0 464.75 395 124.00 429.0 553.00 396 514.25 597.0 1111.25 397 600.50 809.0 1409.50 398 256.00 835.0 1091.00 399 574.75 1548.0 2122.75 400 346.25 568.0 914.25 401 397.00 310.0 707.00 402 195.00 218.0 413.00 403 494.00 904.0 1398.00 404 567.50 1276.0 1843.50 405 431.50 538.0 969.50 406 144.50 315.0 459.50 407 440.00 526.0 966.00 408 525.50 604.0 1129.50 409 375.50 506.0 881.50 410 841.50 1836.0 2677.50 411 386.25 365.0 751.25 412 490.50 889.0 1379.50 413 296.50 508.0 804.50 414 812.25 446.0 1258.25 415 385.00 999.0 1384.00 416 232.50 392.0 624.50 417 239.25 189.0 428.25 418 316.50 377.0 693.50 419 312.25 335.0 647.25 420 257.75 214.0 471.75 421 NA 469.0 NA 422 389.00 530.0 919.00 423 301.50 197.0 498.50 424 242.25 630.0 872.25 425 400.25 814.0 1214.25 426 367.25 1305.0 1672.25 427 321.50 932.0 1253.50 428 301.00 753.0 1054.00 429 223.00 361.0 584.00 430 360.00 1139.0 1499.00 431 662.50 639.0 1301.50 432 407.50 908.0 1315.50 433 736.00 1535.0 2271.00 434 379.50 483.0 862.50 435 852.00 786.0 1638.00 436 355.00 476.0 831.00 437 397.00 467.0 864.00 438 527.50 703.0 1230.50 439 531.25 830.0 1361.25 440 473.00 565.0 1038.00 441 559.75 883.0 1442.75 442 344.00 1569.0 1913.00 443 379.75 1071.0 1450.75 444 459.00 261.0 720.00 445 322.00 564.0 886.00 446 208.50 645.0 853.50 447 424.25 365.0 789.25 448 342.25 587.0 929.25 449 414.50 585.0 999.50 450 308.00 395.0 703.00 451 574.50 673.0 1247.50 452 635.00 940.0 1575.00 453 449.50 1002.0 1451.50 454 286.00 225.0 511.00 455 986.25 1311.0 2297.25 456 563.50 471.0 1034.50 457 596.00 629.0 1225.00 458 492.00 433.0 925.00 459 265.00 213.0 478.00 460 826.50 1335.0 2161.50 461 557.00 662.0 1219.00 462 387.50 565.0 952.50 463 531.50 1028.0 1559.50 464 464.00 442.0 906.00 465 582.00 548.0 1130.00 466 354.50 418.0 772.50 467 382.75 741.0 1123.75 468 833.00 798.0 1631.00 469 347.25 482.0 829.25 470 615.25 595.0 1210.25 471 389.00 362.0 751.00 472 354.25 580.0 934.25 473 564.00 953.0 1517.00 474 890.50 1057.0 1947.50 475 168.00 171.0 339.00 476 467.25 834.0 1301.25 477 554.50 466.0 1020.50 478 296.00 861.0 1157.00 479 744.50 1624.0 2368.50 480 387.25 648.0 1035.25 481 393.25 394.0 787.25 482 331.00 1008.0 1339.00 483 391.00 626.0 1017.00 484 274.00 442.0 716.00 485 707.75 530.0 1237.75 486 467.50 716.0 1183.50 487 160.50 211.0 371.50 488 569.50 960.5 1530.00 489 340.50 511.0 851.50 490 259.00 335.0 594.00 491 321.75 452.0 773.75 492 286.25 661.0 947.25 493 416.50 303.0 719.50 494 459.25 411.0 870.25 495 276.50 336.0 612.50 496 280.25 681.0 961.25 497 258.50 450.0 708.50 498 309.50 346.0 655.50 499 424.50 417.0 841.50 500 365.00 458.0 823.00 501 809.00 1313.0 2122.00 502 238.75 795.0 1033.75 503 524.00 529.0 1053.00 504 563.50 203.0 766.50 505 419.00 699.0 1118.00 506 354.50 500.0 854.50 507 303.00 282.0 585.00 508 167.50 339.0 506.50 509 236.25 479.0 715.25 510 268.00 361.0 629.00 511 330.50 330.0 660.50 512 251.50 366.0 617.50 513 249.00 169.0 418.00 514 443.50 882.0 1325.50 515 411.50 3209.0 3620.50 516 323.50 225.0 548.50 517 485.25 1158.0 1643.25 518 356.50 701.0 1057.50 519 221.50 316.0 537.50 520 515.50 646.0 1161.50 521 462.00 682.0 1144.00 522 322.50 414.0 736.50 523 602.50 869.0 1471.50 524 446.25 761.0 1207.25 525 489.75 645.0 1134.75 526 396.50 641.0 1037.50 527 NA 669.0 NA 528 222.50 260.0 482.50 529 365.50 1155.0 1520.50 530 386.00 908.0 1294.00 531 286.00 878.0 1164.00 532 448.00 609.0 1057.00 533 379.75 519.0 898.75 534 293.50 313.0 606.50 535 410.00 527.0 937.00 536 335.50 511.0 846.50 537 444.50 538.0 982.50 538 464.75 339.0 803.75 539 364.25 803.0 1167.25 540 360.00 232.0 592.00 541 589.00 773.0 1362.00 542 546.50 1739.0 2285.50 543 470.00 567.0 1037.00 544 304.50 248.0 552.50 545 NA 1375.0 NA 546 501.50 1340.0 1841.50 547 459.50 456.0 915.50 548 715.00 1470.0 2185.00 549 349.00 459.0 808.00 550 285.00 480.0 765.00 551 268.00 396.0 664.00 552 507.50 566.0 1073.50 553 441.50 668.0 1109.50 554 188.50 555.0 743.50 555 186.50 198.0 384.50 556 679.00 1479.0 2158.00 557 249.00 229.0 478.00 558 200.00 227.0 427.00 559 419.50 500.0 919.50 560 294.25 560.0 854.25 561 596.00 927.0 1523.00 562 395.75 412.0 807.75 563 314.75 403.0 717.75 564 412.50 397.0 809.50 565 363.75 527.0 890.75 566 218.50 385.0 603.50 567 208.50 381.0 589.50 568 535.50 582.0 1117.50 569 309.75 539.0 848.75 570 336.00 426.0 762.00 571 217.00 361.0 578.00 572 245.50 1212.0 1457.50 573 608.75 624.0 1232.75 574 375.00 469.0 844.00 575 555.50 294.0 849.50 576 621.00 1194.0 1815.00 577 488.50 620.0 1108.50 578 271.50 234.0 505.50 579 331.50 446.0 777.50 580 286.00 177.0 463.00 581 555.00 893.0 1448.00 582 345.00 489.0 834.00 583 529.50 426.0 955.50 584 370.00 699.0 1069.00 585 584.25 539.0 1123.25 586 208.50 486.0 694.50 587 473.50 887.0 1360.50 588 244.00 321.0 565.00 589 296.25 235.0 531.25 590 598.00 501.0 1099.00 591 456.25 586.0 1042.25 592 371.00 509.0 880.00 593 505.50 687.0 1192.50 594 269.50 520.0 789.50 595 284.00 820.0 1104.00 596 420.75 758.0 1178.75 597 358.25 441.0 799.25 598 476.75 876.0 1352.75 599 363.00 661.0 1024.00 600 485.75 638.0 1123.75 601 570.00 512.0 1082.00 602 567.25 518.0 1085.25 603 355.50 695.0 1050.50 604 444.00 397.0 841.00 605 629.00 179.0 808.00 606 367.50 450.0 817.50 607 174.50 98.0 272.50 608 217.00 94.0 311.00 609 239.00 100.0 339.00 610 378.50 216.0 594.50 611 179.50 86.0 265.50 612 188.00 149.0 337.00 613 355.00 338.0 693.00 614 304.50 324.0 628.50 615 354.50 460.0 814.50 616 207.50 124.0 331.50 617 615.00 375.0 990.00 618 163.50 255.0 418.50 619 374.00 356.0 730.00 620 316.50 263.0 579.50 621 79.00 64.0 143.00 622 409.00 374.0 783.00 623 218.25 477.0 695.25 624 452.00 664.0 1116.00 625 398.00 370.0 768.00 626 277.50 416.0 693.50 627 289.25 416.0 705.25 628 491.00 741.0 1232.00 629 515.00 1136.0 1651.00 ________________________________________ Fr?n: R. Michael Weylandt [michael.weylandt at gmail.com] Skickat: den 5 december 2011 14:04 Till: Mintewab Bezabih Kopia: Jeff Newmiller; Sarah Goslee; r-help at r-project.org ?mne: Re: [R] problems using the thin plate spline method Your data was scrubbed by the server. Use dput() to create a plain text representation of dat you can put in the body of the email. Michael On Dec 5, 2011, at 6:54 AM, Mintewab Bezabih wrote: > Dear Jeff and R users, > > Thanks Jeff. > > Your first plot suggestion worked. And when I stick dat$x1, dat$x2,dat$y, tpsfit seems to work as well. But it gives me a new error message > > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > Warning message: > In gcv.Krig(out, nstep.cv = nstep.cv, verbose = verbose, cost = out$cost, : > Value of pure error estimate is outside possible range > > Then I get error messages for the subsequent lines as well. > > I have now attached the data. And here is the full code I am trying to run. > > > dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") > names(dat) <- c("x1", "x2", "y") > library(fields) > plot (dat) > > #load the fields package (containing Tps) and fit a thin plate spline > tpsfit <- Tps(cbind(dat$x1, dat$x2), dat$y, scale.type="unscaled") > > #predict the thin plate spline on the fine grid and plot the fitting > ngrid <- length(xf); grid <- cbind(rep(xf, ngrid), rep(xf, rep(ngrid, ngrid))) > out.p1 <- predict(tpsfit, grid) > > > persp(xf, xf, matrix(out.p1, ngrid, ngrid, byrow=F), theta=130, phi=20, > expand=0.45, xlab="x1", ylab="x2", zlab="y", xlim=c(0,1), ylim=c(0,1), > zlim=range(zf), ticktype="detailed", scale=F, main="gcv fitting") > > Many thanks once again. > > regards > mintewab > > > > Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] > Skickat: den 5 december 2011 12:39 > Till: Mintewab Bezabih; Sarah Goslee > Kopia: r-help at r-project.org > ?mne: Re: [R] problems using the thin plate spline method > > Try > > plot( dat$x1, dat$y ) > > or > > plot( x1, y, data=dat ) > > Note that your example is still not reproducible because you have not supplied the data or a shortened version of your data for us to work with. Also, your problem is not with thin plates but with plot, and reading the help for that function by typing > > ?plot > > at the R command line would have provided you with more examples and usage info on how to get around this problem. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN: Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Mintewab Bezabih wrote: > >> Dear Sarah and R users, >> >> Sorry again for not being explicit enough. Here is my full problem >> >> >> dat <- read.table("E:/thin plate/thin plate.csv", header=T, sep=",") >> dat >> names(dat) <- c("x1", "x2", "y") >> library(fields) >> plot (dat) >> >> #load the fields package (containing Tps) and fit a thin plate spline >> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >> >> What I meant when I said the graph works is when I do plot(dat) it does >> plot of all my three variables. If I do plot(x1,y), though, I get the >> 'object x1 not found' error message. >> >> Same when I do the next line tpsfit <- Tps(cbind(x1, x2), y, >> scale.type="unscaled"). I get the same error message. >> >> I tried your suggestion of checking str(x1) and I get the same error >> message (object x1 not found). >> I also typed ls() and I get "dat" after that command. >> >> I followed the r tutorial guide to read my data and I am following the >> r tutorial to guide me to apply the thin plate spline method. >> >> Regards, >> >> Mintewab >> ________________________________________ >> Fr?n: Sarah Goslee [sarah.goslee at gmail.com] >> Skickat: den 4 december 2011 15:21 >> Till: Mintewab Bezabih >> Kopia: r-help at r-project.org >> ?mne: Re: [R] problems using the thin plate spline method >> >> Hello, >> >> On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih >> wrote: >>> Dear R users and Jeff, >>> >>> Sorry for not being quite explicit in my earlier message. >> >> And you are still not explicit. We have no idea what you've done. >> >>> My main problem is while my data seem to be read into R well (I >> manage to graph them and all), I cannot get the following line to work. >>> >>> tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") >>> >>> and I get the following error message >>> >>> Error in as.matrix(x) : >>> error in evaluating the argument 'x' in selecting a method for >> function 'as.matrix': Error: object 'x1' not found >> >> I'd have to guess that there's no object x1. What does ls() tell you? >> str(x1)? >> >> What do your data look like? You were already given instructions on how >> to >> include sample data to construct a reproducible example. You said that >> graphing your data worked; how did you do so? >> >> The posting guide and the advice you were already given were both >> offered for a reason. The querent needs to do the work of formulating >> an understandable and answerable question. >> >> Sarah >> >>> thanks for help >>> minti >>> ________________________________________ >>> Fr?n: Jeff Newmiller [jdnewmil at dcn.davis.ca.us] >>> Skickat: den 3 december 2011 17:45 >>> Till: Mintewab Bezabih; r-help at r-project.org >>> ?mne: Re: [R] problems using the thin plate spline method >>> >>> I can tell that you are puzzled and confused. Unfortunately, I am not >> psychic, so I cannot tell what you did, and therefore cannot tell where >> you went astray. >>> >>> The solution is for you to read the posting guide mentioned at the >> bottom of every R-help message. Spend a little time to create a small >> bit of data like yours if your actual data is large (subset and dput >> are useful for this). Remember to include the output of sessionInfo, >> and so on. Many times you are likely to find the answer yourself by >> going through these steps, but they are essential for communication. >>> >>> Good luck. >>> Sent from my phone. Please excuse my brevity. >>> >>> Mintewab Bezabih wrote: >>> >>>> Dear R users, >>>> >>>> I am a beginner in R trying to apply the thin plate spline method to >> my >>>> climate data. I used the example in R to do so, and the lines seem to >>>> run fine ( I am not getting errors) but I am not getting any output >> in >>>> the form of graph or anything. I got a warning message saying that >>>> 'surface extends beyond box'. >>>> >>>> Any help is much appreciated. >>>> thanks >>>> minti >> >> >> -- >> Sarah Goslee >> http://www.functionaldiversity.org >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Mon Dec 5 23:11:59 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 17:11:59 -0500 Subject: [R] Shading the plot In-Reply-To: References: Message-ID: As David said, your "minimal working example" is neither minimal nor working...consider this (admittedly quite clunky) example though: time <- seq(10, 20, length.out = 100) S1 <- 10*exp( cumsum(rnorm(100))/20) S2 <- 10*exp( cumsum(rnorm(100))/20) plot(time, S1, ylim = range(c(S1,S2)), type = "n") lines(time, S1); lines(time, S2, col = 2) r <- c(1, which(diff(sign(S1-S2)) != 0L), length(time)) for(i in seq_along(r)){ if(i == length(r)){next} ind1 <- r[i] ind2 <- r[i+1] Xbnds <- time[ind1:ind2] Xbnds <- c(Xbnds, rev(Xbnds)) Ybnds <- c(S1[ind1:ind2],S2[ind2:ind1]) col = if(median((S1>S2)[ind1:ind2])) "blue" else "green" polygon(Xbnds, Ybnds, col = col, border = NA) } Best I can figure, this fills green if the red line is on top and blue otherwise. You may have to run it a few times to see that behavior. Michael On Sat, Dec 3, 2011 at 11:37 PM, avinash barnwal wrote: > Hi, > > I apologies? for my naive doubts > I have been trying it from a while. I need the area between the curve based > on conditions i wrote (whenever red line is above the blue line then area > between curves to be grey color and whenever blue line is above red line > then area between curves to be red color ) > > x and y are vectors > > Thank you for replying > > > > > On Sun, Dec 4, 2011 at 7:56 AM, David Winsemius > wrote: >> >> >> On Dec 3, 2011, at 5:28 PM, avinash barnwal wrote: >> >>> Hi Weylandt, >>> >>> >>> I tried it but i was not successful. >>> >>> Here is the full code >>> >>> Any help would be great. >>> ######################################################################## >>> >>> time<-c("02-Jan-05","09-Jan-05","16-Jan-05","23-Jan-05","30-Jan-05","06-Feb-05","13-Feb-05","20-Feb-05","27-Feb-05","06-Mar-05","13-Mar-05", >>> >>> "20-Mar-05","27-Mar-05","03-Apr-05","10-Apr-05","17-Apr-05","24-Apr-05","01-May-05","08-May-05","15-May-05") >>> time<-as.Date(time,"%d-%b-%y") >>> >>> a2<-c("81.96392786","81.96392786","82.16432866","82.56513026","82.76553106","79.96593186","78.16633267", >>> >>> "75.56713427","74.76753507","72.96793587","70.96793587","45.96793587","83.96793587","84.36873747", >>> >>> "84.56913828","84.56913828","84.56913828","84.56913828","84.36873747","84.36873747") >>> >>> a3<-c("81.96392786","81.96392786","81.96392786","70.96392786","68.16432866","66.16432866", >>> >>> "62.16432866","58.56513026","56.56513026","54.56513026","48.56513026","49.76553106","52.76553106", >>> >>> "54.76553106","57.96593186","59.36673347","83.36673347","83.36673347","83.36673347", >>> "83.56713427") >>> j<-0 >>> for(i in 1:length(a3)) >>> { >>> if(a2[i]>a3[i]) >>> { >>> j<-j+1 >>> x[j]<-a2[i] >>> y[j]<-a3[i] >>> temp_time[j]<-time[i] >>> } >>> } >>> plot(time,a2,type='l',col='red',ylab='',xlab=" ",axes=FALSE) >>> lines(time,a3,col='blue',ylab='',xlab=" ") >>> polygon(c(temp_time,rev(temp_time)),c(x,y),col="grey") >>> ######################################################################### >> >> >> What are the rules that govern requesting outside help in homework at your >> institution? >> >> Your current code does not recognize ?that there is line crossing. Nor do >> you describe what you mean by shading. If you wanted a rectangle within the >> lpot area it would drive one strategy and if you wanted only the area >> between the curves to be shaded it would drive a different strategy. >> >> AND you never define "x" or "y". >> >> -- >> David. >> >> >> >>> On Sun, Dec 4, 2011 at 2:46 AM, R. Michael Weylandt < >>> michael.weylandt at gmail.com> wrote: >>> >>>> ? polygon >>>> example(polygon) >>>> >>>> Michael >>>> >>>> On Sat, Dec 3, 2011 at 4:08 PM, avinash barnwal >>>> wrote: >>>>> >>>>> Hi all, >>>>> >>>>> I have been trying to shade the specific part of the plot >>>>> >>>>> Part to be shaded >>>>> >>>>> 1. Any color whenever a2>a3 >>>>> >>>>> 2. Any other color( Not same as 1) whenever a2>>>> >>>>> Suggest me some code for this task >>>>> >>>>> PLOT CODE for reference >>>>> >>>>> >>>> >>>> ###################################################################################################### >>>>> >>>>> >>>> >>>> a2<-c("81.96392786","81.96392786","82.16432866","82.56513026","82.76553106","79.96593186","78.16633267", >>>>> >>>>> >>>> >>>> "75.56713427","74.76753507","72.96793587","70.96793587","45.96793587","83.96793587","84.36873747", >>>>> >>>>> >>>> >>>> "84.56913828","84.56913828","84.56913828","84.56913828","84.36873747","84.36873747") >>>>> >>>>> >>>> >>>> a3<-c("81.96392786","81.96392786","81.96392786","70.96392786","68.16432866","66.16432866", >>>>> >>>>> >>>> >>>> "62.16432866","58.56513026","56.56513026","54.56513026","48.56513026","49.76553106","52.76553106", >>>>> >>>>> >>>> >>>> "54.76553106","57.96593186","59.36673347","83.36673347","83.36673347","83.36673347", >>>>> >>>>> "83.56713427") >>>>> plot(a2,type='l',col='red',ylab='',xlab=" ",axes=FALSE) >>>>> lines(a3,col='blue',ylab='',xlab=" ") >>>>> >>>> >>>> ###################################################################################################### >>>>> >>>>> >>>>> Thank you in the advance >>>>> -- >>>>> Avinash Barnwal >>>>> Final year undergraduate student >>>>> Statistics and informatics >>>>> Department of Mathematics >>>>> IIT Kharagpur >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>>> >>>> >>> >>> >>> >>> -- >>> Avinash Barnwal >>> Final year undergraduate student >>> Statistics and informatics >>> Department of Mathematics >>> IIT Kharagpur >>> >>> ? ? ? ?[[alternative HTML version deleted]] >>> >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> >> David Winsemius, MD >> West Hartford, CT >> > > > > -- > Avinash Barnwal > Final year undergraduate student > Statistics and informatics > Department of Mathematics > IIT Kharagpur From michael.weylandt at gmail.com Mon Dec 5 23:18:46 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 17:18:46 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: Your code is not reproducible nor minimal, but why don't you put a command print(acceptprob) in and see if you are getting reasonable values. If these values are extremely low it shouldn't surprise you that your loop takes a long time to run. More generally, read up on the use of print() and browser() as debugging tools. Michael On Mon, Dec 5, 2011 at 3:47 PM, Gyanendra Pokharel wrote: > I forgot to upload the R-code in last email, so heare is one > > epiann <- function(T0 = 1, N=1000, ainit=1, binit=1,rho = 0.99, amean = 3, > bmean=1.6, avar =.1, bvar=.1, f){ > > ? ? ? ?moving <- 1 > ? ? ? ?count <- 0 > ? ? ? ?Temp <- T0 > ? ? ? ?aout <- ainit > ? ? ? ?bout <- binit > ? ? ? ?while(moving > 0){ > ? ? ? ? ? ? ? ?moving <- 0 > ? ? ? ? ? ? ? ?for (i in 1:N) { > ? ? ? ? ? ? ? ?aprop <- rnorm (1,amean, avar) > ? ? ? ? ? ? ? ?bprop <- rnorm (1,bmean, bvar) > ? ? ? ? ? ? ? ?if (aprop > 0 & bprop > 0){ > ? ? ? ? ? ? ? ?acceptprob <- min(1,exp((f(aout, bout) - > f(aprop,bprop))/Temp)) > ? ? ? ? ? ? ? ?u <- runif(1) > ? ? ? ? ? ? ? ?if(u ? ? ? ? ? ? ? ? ? ?moving <- moving +1 > ? ? ? ? ? ? ? ? ? ?aout <- aprop > ? ? ? ? ? ? ? ? ? ?bout <- bprop > ? ? ? ? ? ? ? ? ? ?} > ? ? ? ? ? ? ? ? ? ?else{aprob <- aout > ? ? ? ? ? ? ? ? ? ? ? ?bprob <- bout} > ? ? ? ? ? ? ? ?} > ? ? ? ? ? ?} > ? ? ? ?Temp <- Temp*rho > ? ? ? ? ? ?count <- count +1 > > ? ?} > ? ?fmin <- f(aout,bout) > ? ?return(c(aout, bout,fmin, count) ) > > } > out<- epiann(f = loglikelihood) > > On Mon, Dec 5, 2011 at 3:46 PM, Gyanendra Pokharel < > gyanendra.pokharel at gmail.com> wrote: > >> Hi all, >> I have the following code, >> When I run the code, it never terminate this is because of the while loop >> i am using. In general, if you need a loop for which you don't know in >> advance how many iterations there will be, you can use the `while' >> statement so here too i don't know the number how many iterations are >> there. So Can some one suggest me whats going on? >> I am using the Metropolis simulated annealing algorithm >> Best >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From gyanendra.pokharel at gmail.com Mon Dec 5 23:29:24 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 17:29:24 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jpntsang at yahoo.com Mon Dec 5 23:43:35 2011 From: jpntsang at yahoo.com (Juliet Ndukum) Date: Mon, 5 Dec 2011 14:43:35 -0800 (PST) Subject: [R] plot mixed variables Message-ID: <1323125015.70141.YahooMailClassic@web161203.mail.bf1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Mon Dec 5 23:49:08 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Mon, 05 Dec 2011 17:49:08 -0500 Subject: [R] args() function does not list function prototype for locally-produced/installed R package In-Reply-To: <4EDD23E3.2080802@west.net> References: <4EDD23E3.2080802@west.net> Message-ID: <4EDD4A64.8040906@gmail.com> On 11-12-05 3:04 PM, Rick Reeves wrote: > Greetings: > > I have check the 'Building R Extensions' manual and can find no advice > on this issue, > so I am asking -- > > I have created an R package consisting entirely of R source code, and > created an installer > using the R CMD build / R CMD check commands. The package installs > correctly, using > R CMD install, and the .Rd files for each function (one function per .R > / .Rd file) are visible > using the '?function' command. However, the 'args(function)' command > does not list the > function prototype; instead generating the error: > > Error in args(function) : object "function" not found. > > Question: If it is possible, what changes do I make to my package and > install process to get > args() to display the function prototype(s) for the functions in my > local package? Is the function visible (e.g., if you type the name of the function, does it print)? I would guess not: I think you have a NAMESPACE file, and you haven't listed this function in it. If you don't have a NAMESPACE file, or you do have one and you list this function, then I think you need to be more forthcoming with accurate information. When I type args(function), I don't get the error you get, since "function" is a reserved word: > args(function) Error: unexpected ')' in "args(function)" Duncan Murdoch Duncan Murdoch From murdoch.duncan at gmail.com Mon Dec 5 23:54:48 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Mon, 05 Dec 2011 17:54:48 -0500 Subject: [R] installing several versions of R (2.14 and 2.12.2) on the same system on Ubuntu In-Reply-To: References: <1323114423.8857.YahooMailNeo@web28210.mail.ukl.yahoo.com> Message-ID: <4EDD4BB8.8060007@gmail.com> On 11-12-05 4:03 PM, Peter Langfelder wrote: > On Mon, Dec 5, 2011 at 11:47 AM, Jannis wrote: >> Dear R users, >> >> >> besides the current R 2.14 I would like to install a second version of R (2.12.2) on my Ubuntu system. The current version is easily installed as a precompiled package from Cran but I am heavily fighting with the older version. I tried to follow the instructions here: >> >> http://cran.r-project.org/doc/manuals/R-admin.html >> >> Unfortunately I got totally confused by all the different locations of the script, the library and the rest of the program. As I understand these all have to be different from the ones of the R 2.14 installation. In case anybody could point me to some nice instructions, fell welcome to do so. >> >> >> Otherwise we would need to check what went wrong during my try. I finally managed to install R.2.12.2 but, as it seems, without Java correctly set up and without tcltk support (both are needed). r-base-dev is installed. >> >> >> This I what I did: >> >> 1. downloaded R.2.12.2.tar.gz from Cran >> 2. tar -xzf R-2.12.2.tar.gz >> 3. sudo cp R-2.12.2 /usr/lib >> 4. cd /usr/lib/R.2.12.2 >> 5. mkdir prog >> 5. sudo ./configure --prefix=/usr/bin >> 6. sudo make prefix=/usr/lib/R-2.12.2/prog rhome=/usr/lib/R-2.12.2/library >> >> 7. sudo mv /usr/bin/R /usr/bin/R-2.12.2 >> >> >> Most probably these two arguments for make are not correct as I did not fully understand the instructions here. Additionally I would need to facilitate tcl/tk and Java. Both works with R.2.14 so their dependecies should be installed but I probably need some more arguments during the build for that. Also this renaming of the R script seems arkward to me but I did this to easily run "R-2.12.2" or "R-2.14" from the command line. >> >> >> Does anybody have any advice on how to fix this stuff? > > I think you did basically the right thing. To be able to compile R > with tcl/tk, you have to install the development files for tcl/tk - on > Fedora the files are contained in package tcl-devel (this is a > Fedora/Ubuntu package, not an R package). Then run the entire > compilation process (./configure, make, make install) again. When you > install a pre-compiled R, you don't need the development files, which > is probably why you never needed them in the past. > > I'm not sure about Java - you may want to examine the output of > configure (which is usually saved in configure.log) to see what is > missing. > Besides what Peter said, I would suggest that you follow the instructions for "simple compilation" in the document you cited. You are doing way too much as a superuser. You don't need that at all if you are the only user who needs this old version of R. If you need to install it for others to use, then follow the instructions for "installation" in that document, and let your users change their path to select the R version. Duncan Murdoch From sarah.goslee at gmail.com Mon Dec 5 23:58:46 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Mon, 5 Dec 2011 17:58:46 -0500 Subject: [R] plot mixed variables In-Reply-To: <1323125015.70141.YahooMailClassic@web161203.mail.bf1.yahoo.com> References: <1323125015.70141.YahooMailClassic@web161203.mail.bf1.yahoo.com> Message-ID: plot(xx1, yy, ylim = c(-13.5, 4), col="blue", xaxt="n") axis(1, at=c(1, 2), labels=c("C", "D")) Defining your own axes with axis() offers a great deal of flexibility. And thank you for providing a small reproducible example. Sarah On Mon, Dec 5, 2011 at 5:43 PM, Juliet Ndukum wrote: > > > > ?My data consists of a numeric (yy) > ?variable and a categorical (xx) variable, as shown below. > > > > > xx = > c(rep("C", 5), rep("D",5)) > > yy = rnorm(10, 0, 4) > > xx1 = > as.integer(as.factor(xx)) > > > > plot(xx1, yy, ylim = > c(-13.5, 4), col="blue") > > > > I > wish to generate a scatter plot of the data such that instead of 1 it prints C, > and instead of 2, it prints D on the x- axis. > > > > Could > someone help me with an R code on how to go about this. Thank you in advance > for your ?help, > > JN > ? ? ? ?[[alternative HTML version deleted]] > > -- Sarah Goslee http://www.functionaldiversity.org From michael.weylandt at gmail.com Tue Dec 6 00:07:19 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Mon, 5 Dec 2011 18:07:19 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: If you run out<- epiann(f = function(a,b) log(dnorm(a)*dnorm(b))), N = 10) It takes less than 0.5 seconds so there's no problem I can see: perhaps you want to look elsewhere to get better speed (like Rcpp or general vectorization), or maybe your loglikihood is not what's desired, but there's no problem with the loop. Michael On Mon, Dec 5, 2011 at 5:29 PM, Gyanendra Pokharel wrote: > Yes, I checked the acceptprob, it is very high but in my view, the while > loop is not stopping, so there is some thing wrong in the use of while loop. > When I removed the while loop, it returned some thing but not the result > what I want. When i run the while loop separately, it never stops. > > > > On Mon, Dec 5, 2011 at 5:18 PM, R. Michael Weylandt > wrote: >> >> Your code is not reproducible nor minimal, but why don't you put a >> command print(acceptprob) in and see if you are getting reasonable >> values. If these values are extremely low it shouldn't surprise you >> that your loop takes a long time to run. >> >> More generally, read up on the use of print() and browser() as debugging >> tools. >> >> Michael >> >> On Mon, Dec 5, 2011 at 3:47 PM, Gyanendra Pokharel >> wrote: >> > I forgot to upload the R-code in last email, so heare is one >> > >> > epiann <- function(T0 = 1, N=1000, ainit=1, binit=1,rho = 0.99, amean = >> > 3, >> > bmean=1.6, avar =.1, bvar=.1, f){ >> > >> > ? ? ? ?moving <- 1 >> > ? ? ? ?count <- 0 >> > ? ? ? ?Temp <- T0 >> > ? ? ? ?aout <- ainit >> > ? ? ? ?bout <- binit >> > ? ? ? ?while(moving > 0){ >> > ? ? ? ? ? ? ? ?moving <- 0 >> > ? ? ? ? ? ? ? ?for (i in 1:N) { >> > ? ? ? ? ? ? ? ?aprop <- rnorm (1,amean, avar) >> > ? ? ? ? ? ? ? ?bprop <- rnorm (1,bmean, bvar) >> > ? ? ? ? ? ? ? ?if (aprop > 0 & bprop > 0){ >> > ? ? ? ? ? ? ? ?acceptprob <- min(1,exp((f(aout, bout) - >> > f(aprop,bprop))/Temp)) >> > ? ? ? ? ? ? ? ?u <- runif(1) >> > ? ? ? ? ? ? ? ?if(u> > ? ? ? ? ? ? ? ? ? ?moving <- moving +1 >> > ? ? ? ? ? ? ? ? ? ?aout <- aprop >> > ? ? ? ? ? ? ? ? ? ?bout <- bprop >> > ? ? ? ? ? ? ? ? ? ?} >> > ? ? ? ? ? ? ? ? ? ?else{aprob <- aout >> > ? ? ? ? ? ? ? ? ? ? ? ?bprob <- bout} >> > ? ? ? ? ? ? ? ?} >> > ? ? ? ? ? ?} >> > ? ? ? ?Temp <- Temp*rho >> > ? ? ? ? ? ?count <- count +1 >> > >> > ? ?} >> > ? ?fmin <- f(aout,bout) >> > ? ?return(c(aout, bout,fmin, count) ) >> > >> > } >> > out<- epiann(f = loglikelihood) >> > >> > On Mon, Dec 5, 2011 at 3:46 PM, Gyanendra Pokharel < >> > gyanendra.pokharel at gmail.com> wrote: >> > >> >> Hi all, >> >> I have the following code, >> >> When I run the code, it never terminate this is because of the while >> >> loop >> >> i am using. In general, if you need a loop for which you don't know in >> >> advance how many iterations there will be, you can use the `while' >> >> statement so here too i don't know the number how many iterations are >> >> there. So Can some one suggest me whats going on? >> >> I am using the Metropolis simulated annealing algorithm >> >> Best >> >> >> > >> > ? ? ? ?[[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. > > From jpntsang at yahoo.com Mon Dec 5 23:22:40 2011 From: jpntsang at yahoo.com (Juliet Ndukum) Date: Mon, 5 Dec 2011 14:22:40 -0800 (PST) Subject: [R] Plot numeric and categorical variable Message-ID: <1323123760.89219.YahooMailClassic@web161204.mail.bf1.yahoo.com> My data consists of numeric (yy) and categorical (xx) variables, as shown below.? > xx = c(rep("C", 5), rep("D",5))> xx?[1] "C" "C" "C" "C" "C" "D" "D" "D" "D" "D"> yy = rnorm(10, 0, 4)> yy?[1] ?2.7219346 -3.7142481 ?6.8716534 -0.9352463 ?0.4901249 ?3.8113247?[7] -2.6602041 ?1.7714471 ?4.7298233 ?0.8848188 > xx1 = as.integer(as.factor(xx))> plot(xx1, yy, ylim = c(-13.5, 4), col="blue") I have attached the plot above ?as plot1 I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis (see plot1 attached). How could I possibly go about this, let me know. Any help will be greatly appreciated. Thanks in advance for your help,JN From smoochie3002 at gmail.com Mon Dec 5 23:58:26 2011 From: smoochie3002 at gmail.com (crazedruff) Date: Mon, 5 Dec 2011 14:58:26 -0800 (PST) Subject: [R] Plotting Time Series Data by Month Message-ID: <1323125906801-4162534.post@n4.nabble.com> Hi, I have a dataset which includes monthly data for 17 years. I want to be able to see the monthly data behavior for the period of all 17 years. What my data looks like: http://r.789695.n4.nabble.com/file/n4162534/data.jpg I would like to represent the data in a graph such as the one below: http://r.789695.n4.nabble.com/file/n4162534/Untitled-2.jpg Any help would be appreciated. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-Time-Series-Data-by-Month-tp4162534p4162534.html Sent from the R help mailing list archive at Nabble.com. From magee20v at uregina.ca Tue Dec 6 01:32:00 2011 From: magee20v at uregina.ca (Jasmine007) Date: Mon, 5 Dec 2011 16:32:00 -0800 (PST) Subject: [R] Why can't I figure this out? :S Message-ID: <1323131520211-4162826.post@n4.nabble.com> Hi, so I don't speak computer and I have no idea what this code is telling the program to do, but I apparently need to be able to find and isolate influencial observations. Problem, I have no idea what the error means and where it may be from in the code. error I get is below the code { ## OLS results NameC<- lm(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy) ## default: choose psamp = quantile n <- length(residuals(NameC)) k <- length(coef(NameC)) if(is.null(quantile)) quantile <- c(floor((n + k + 1)/2), floor((n + k)/2)) quantile <- rep(quantile, length.out = 2) if(is.null(psamp)) psamp <- quantile[1] ## LTS results with robust residuals NameC_lts <- lqs(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy, quantile = quantile[1], psamp = psamp, nsamp = nsamp) rr <- residuals(NameC_lts)/NameC_lts$scale[2] rr_nok <- abs(rr) > critval[1] ## robust leverage via MCD (or MVE) X <- model.matrix(NameC)[,-1] cv <- cov.rob(X, method = method, quantile = quantile[2], nsamp = dist_nsamp) rd <- sqrt(mahalanobis(X, cv$center, cv$cov)) rd_nok <- rd > critval[2] ## ROBUST results nok <- rr_nok & rd_nok NameC_rob <- lm(formula, data[!nok,]) rval <- list(ols = NameC, lts = NameC_lts, robust = NameC_rob, cov.rob = cv, robresid = rr, robdist = rd, high_residuals = rr[rr_nok], high_leverage = rd[rd_nok], bad_leverage = nok, psamp = psamp, method = method, nsamp = list(lts = nsamp, dist = dist_nsamp), quantile = list(lts = quantile[1], dist = quantile[2])) return(rval) } Error: object of type 'closure' is not subsettable Any ideas, In plain non-computer language.. I have a headache from trying to figure out if this question had been answered before. Thank you -- View this message in context: http://r.789695.n4.nabble.com/Why-can-t-I-figure-this-out-S-tp4162826p4162826.html Sent from the R help mailing list archive at Nabble.com. From wchips at y7mail.com Tue Dec 6 01:10:43 2011 From: wchips at y7mail.com (wchips) Date: Mon, 5 Dec 2011 16:10:43 -0800 (PST) Subject: [R] Persp3d freezes when run from within Python In-Reply-To: <4EDCC7EA.1030008@gmail.com> References: <1323050239287-4158940.post@n4.nabble.com> <4EDCC7EA.1030008@gmail.com> Message-ID: <1323130243190-4162766.post@n4.nabble.com> Thanks Duncan. The thing is, if you want to display a static R graph using Rpy2 you need to bring your Python program to a halt immediately after printing the graph to screen using something like: raw_input("Press any key to continue ...") , otherwise it flashes up on the screen for a fraction of a second and then disappears. I assume this is one and the same issue.. That being, that R is somehow opened and then _closed_ after each instruction when using Rpy2. So whilst "pausing" Python might give you a "snapshot" of the 3d graph, it doesn't give you dynamic interactivity. I just need to find a way to keep R running in the background when I execute that command. Again, if anyone has had the same problem throw me a line! Or other suggestions are also welcome. cheers, chips -- View this message in context: http://r.789695.n4.nabble.com/Persp3d-freezes-when-run-from-within-Python-tp4158940p4162766.html Sent from the R help mailing list archive at Nabble.com. From comtech.usa at gmail.com Tue Dec 6 02:01:00 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 19:01:00 -0600 Subject: [R] how to view/edit large matrix/array in R? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 02:07:52 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 19:07:52 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 02:09:32 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 19:09:32 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From carl at witthoft.com Tue Dec 6 02:12:25 2011 From: carl at witthoft.com (Carl Witthoft) Date: Mon, 05 Dec 2011 20:12:25 -0500 Subject: [R] Why can't I figure this out? :S Message-ID: <4EDD6BF9.1000208@witthoft.com> If you 'don't speak computer,' what are you doing trying to run R in the first place? Your email address suggests this is homework, but even if it isn't please go talk to your professor or teaching assistant. From: Jasmine007 Date: Mon, 05 Dec 2011 16:32:00 -0800 (PST) Hi, so I don't speak computer and I have no idea what this code is telling the program to do, but I apparently need to be able to find and isolate influencial observations. Problem, I have no idea what the error means and where it may be from in the code. error I get is below the code { ## OLS results NameC<- lm(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy) ## default: choose psamp = quantile n <- length(residuals(NameC)) k <- length(coef(NameC)) if(is.null(quantile)) quantile <- c(floor((n + k + 1)/2), floor((n + k)/2)) quantile <- rep(quantile, length.out = 2) if(is.null(psamp)) psamp <- quantile[1] ## LTS results with robust residuals NameC_lts <- lqs(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy, quantile = quantile[1], psamp = psamp, nsamp = nsamp) rr <- residuals(NameC_lts)/NameC_lts$scale[2] rr_nok <- abs(rr) > critval[1] ## robust leverage via MCD (or MVE) X <- model.matrix(NameC)[,-1] cv <- cov.rob(X, method = method, quantile = quantile[2], nsamp = dist_nsamp) rd <- sqrt(mahalanobis(X, cv$center, cv$cov)) rd_nok <- rd > critval[2] ## ROBUST results nok <- rr_nok & rd_nok NameC_rob <- lm(formula, data[!nok,]) rval <- list(ols = NameC, lts = NameC_lts, robust = NameC_rob, cov.rob = cv, robresid = rr, robdist = rd, high_residuals = rr[rr_nok], high_leverage = rd[rd_nok], bad_leverage = nok, psamp = psamp, method = method, nsamp = list(lts = nsamp, dist = dist_nsamp), quantile = list(lts = quantile[1], dist = quantile[2])) return(rval) } Error: object of type 'closure' is not subsettable Any ideas, In plain non-computer language.. I have a headache from trying to figure out if this question had been answered before. Thank you -- Sent from my Cray XK6 "Pendeo-navem mei anguillae plena est." From gunter.berton at gene.com Tue Dec 6 02:12:44 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Mon, 5 Dec 2011 17:12:44 -0800 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: ... and do you really think perusing thousands of numbers by eye is any way to edit/check data?! Personal viewpoint: I would say that this is a large area of statistics and data analysis that the discipline fails to address in any systematic way ... perhaps because there is no way to address it systematically? Contrary views and corrections -- especially references! -- would be very welcome. My advice would be: graphics! -- but I can't provide anything more useful without the specifics of the problem. Some packages may provide the interactivity you seek -- check the CRAN GUI task view, R Commander, etc. -- Bert On Mon, Dec 5, 2011 at 5:01 PM, Michael wrote: > head, tail and fix commands don't really work well if I have large > matrix/array for which I would like to be able to scroll up and dow, left > and right ... > > Could anybody please help me? > > Thanks > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From comtech.usa at gmail.com Tue Dec 6 02:35:14 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 19:35:14 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Tue Dec 6 02:37:07 2011 From: jholtman at gmail.com (jim holtman) Date: Mon, 5 Dec 2011 20:37:07 -0500 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: Have you tried ?View ?edit On Mon, Dec 5, 2011 at 8:12 PM, Bert Gunter wrote: > ... and do you really think perusing thousands of numbers by eye is > any way to edit/check data?! > > Personal viewpoint: I would say that this is a large area of > statistics and data analysis that the discipline fails to address in > any systematic way ... perhaps because there is no way to address it > systematically? Contrary views and corrections -- especially > references! -- would be very welcome. > > ?My advice would be: graphics! -- but I can't provide anything more > useful without the specifics of the problem. > > Some packages may provide the interactivity you seek -- check the CRAN > GUI task view, R Commander, etc. > > -- Bert > > On Mon, Dec 5, 2011 at 5:01 PM, Michael wrote: >> head, tail and fix commands don't really work well if I have large >> matrix/array for which I would like to be able to scroll up and dow, left >> and right ... >> >> Could anybody please help me? >> >> Thanks >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > > Bert Gunter > Genentech Nonclinical Biostatistics > > Internal Contact Info: > Phone: 467-7374 > Website: > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From rolf.turner at xtra.co.nz Tue Dec 6 02:45:05 2011 From: rolf.turner at xtra.co.nz (Rolf Turner) Date: Tue, 06 Dec 2011 14:45:05 +1300 Subject: [R] Spatstat - problem with which.marks and as.pp In-Reply-To: References: , Message-ID: <4EDD73A1.5080502@xtra.co.nz> Basically the problem is that you have a *VERY* old version of spatstat. Upgrade! Comments interpolated below. On 05/12/11 21:52, karajamu wrote: > I forgot to change the header, so I guess no one read my mail. That's why I'm trying it again... > > >> >> Hello everbody, >> >> I am new to this mailing list and hope to find some help. >> I'm trying to get into the spatstat package and encountered two problems. First a graphical one: >> There is an example dataset called "finpines" which has several marks (http://www.oga-lab.net/RGM2/func.php?rd_id=spatstat:finpines) >> When I pass the given code from the website to R >> >> >> >> data(finpines) If you were using the latest version of "spatstat" you wouldn't need to do this any more. The data are now lazy-loaded. See latest.news(). >> >> plot(unmark(finpines), main="Finnish pines: locations") >> plot(finpines, which.marks="height", main="heights") >> >> plot(finpines, which.marks="diameter", main="diameters") >> I get the warning >> >> Warnmeldung: >> In symbols(c(-1.993875, -1.019901, -4.914071, -4.469962, -4.303847, : >> "which.marks" ist kein Grafikparameter >> >> Something like "which.marks" is not a graphic parameter; and the plots for height and diameter show now differences. The version of spatstat that you are using must hail from a time prior to when the argument "which.marks" was added to plot.ppp(). >> Furthermore, I want to create a ppp with several marks, but I did not figure out how this works. >> Trying >> >> X<- as.ppp(mydata, owin(c(174, 178), c(29, 33))) >> >> just gives the error >> >> Error in as.ppp(mydata, owin(c(174, 178), c(29, 33))) : >> X must be a two-column or three-column data frame >> >> The data set looks something like >> >> Date X Y Mar1 Mar2 Mar3 >> >> 1.1. 4 3 50 6 A >> 2.1. 2 1 40 9 A >> 3.1. 5 8 35 12 B >> >> But how can I integrate two or more marks in a three-column data frame, when two columns are already needed for the X and Y coordinates? Presumably you want "X" and "Y" to be the x and y coordinates of the points of the pattern, respectively. In which case they must be the ***first two*** columns of the data frame. (Not the second and third!) As you have written "mydata", the first "Date" (the first column) will be of mode "character", which will cause as.ppp() to throw an error. I.e. it will try to take "Date" as the x coordinates (and "X" as the y coordinates) and since "Date" is not numeric, it will give up in disgust. When I do X <- as.ppp(mydata, owin(c(174, 178), c(29, 33))) (using the bit of "mydata" that your email showed) I get the error Error: is.numeric(x) is not TRUE (as expected). Of course I do not get the error that you got, which would have been thrown by as.ppp() waaaayyyy back, when marks had to be *vectors* and data frames of marks weren't allowed for. Bottom line: Update your version of spatstat. cheers, Rolf Turner From bps0002 at auburn.edu Tue Dec 6 03:28:45 2011 From: bps0002 at auburn.edu (B77S) Date: Mon, 5 Dec 2011 18:28:45 -0800 (PST) Subject: [R] Why can't I figure this out? :S In-Reply-To: <1323131520211-4162826.post@n4.nabble.com> References: <1323131520211-4162826.post@n4.nabble.com> Message-ID: <1323138525390-4163150.post@n4.nabble.com> Why can't you figure this out? I think you already know the answer: "I don't speak computer"..... Time to learn, or get another job I suppose. I hope you at least speak math-statistics if you are going to attempt to understand this. The only way you are going to be able to figure that code out is to break it up into pieces until you DO understand it. If that is too much work for you, then ???? Good luck. Jasmine007 wrote > > Hi, so I don't speak computer and I have no idea what this code is telling > the program to do, but I apparently need to be able to find and isolate > influencial observations. Problem, I have no idea what the error means and > where it may be from in the code. > > error I get is below the code > > { > ## OLS results > NameC<- lm(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy) > > ## default: choose psamp = quantile > n <- length(residuals(NameC)) > k <- length(coef(NameC)) > if(is.null(quantile)) quantile <- c(floor((n + k + 1)/2), > floor((n + k)/2)) > quantile <- rep(quantile, length.out = 2) > if(is.null(psamp)) psamp <- quantile[1] > > ## LTS results with robust residuals > NameC_lts <- > lqs(gpanew~female+female:lastinit+agenew+canadian+mom_ed+yearstudy, > quantile = quantile[1], psamp = psamp, nsamp = nsamp) > rr <- residuals(NameC_lts)/NameC_lts$scale[2] > rr_nok <- abs(rr) > critval[1] > ## robust leverage via MCD (or MVE) > X <- model.matrix(NameC)[,-1] > cv <- cov.rob(X, method = method, > quantile = quantile[2], nsamp = dist_nsamp) > rd <- sqrt(mahalanobis(X, cv$center, cv$cov)) > rd_nok <- rd > critval[2] > ## ROBUST results > nok <- rr_nok & rd_nok > NameC_rob <- lm(formula, data[!nok,]) > rval <- list(ols = NameC, lts = NameC_lts, robust = NameC_rob, > cov.rob = cv, robresid = rr, robdist = rd, > high_residuals = rr[rr_nok], high_leverage = rd[rd_nok], > bad_leverage = nok, psamp = psamp, method = method, > nsamp = list(lts = nsamp, dist = dist_nsamp), > quantile = list(lts = quantile[1], dist = quantile[2])) > return(rval) > } > > Error: object of type 'closure' is not subsettable > > Any ideas, In plain non-computer language.. I have a headache from trying > to figure out if this question had been answered before. > > Thank you > -- View this message in context: http://r.789695.n4.nabble.com/Why-can-t-I-figure-this-out-S-tp4162826p4163150.html Sent from the R help mailing list archive at Nabble.com. From gyanendra.pokharel at gmail.com Tue Dec 6 03:30:29 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 21:30:29 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bps0002 at auburn.edu Tue Dec 6 03:40:00 2011 From: bps0002 at auburn.edu (B77S) Date: Mon, 5 Dec 2011 18:40:00 -0800 (PST) Subject: [R] frequency table? In-Reply-To: <1322990509062-4156422.post@n4.nabble.com> References: <1322990509062-4156422.post@n4.nabble.com> Message-ID: <1323139200476-4163192.post@n4.nabble.com> Set, This is the same post as your "Similarity Matrix" post. I'm not trying to be a smart ass here, but ... ?Can you fit a square peg in a round hole?... yes, but it doesn't mean it belongs there. I suggest you get a piece of paper and a pencil and figure out 1) what you are trying to do and why, and 2) how you would do that by hand. After you do that, you should be able to figure this out on your own or formulate a question to post that someone will be able to answer. Reading might help as well. set wrote > > Hello R-users, > > I've got a file with individuals as colums and the clusters where they > occur in as rows. And I wanted a table which tells me how many times each > individual occurs with another. I don't really know how such a table is > called...it is not a frequency table....My eventual goal is to make > Venn-diagrams from the occurence of my individuals. > > So I've this: > > cluster ind1 ind2 ind3 etc. > 1 0 1 2 > 2 3 0 1 > 3 1 1 1 > > And I want to go to this: > ind1 ind2 ind3 > ind1 0 4 2 > ind2 4 0 4 > ind3 2 4 1 > > is there a way to do this? > Thank you for your help > -- View this message in context: http://r.789695.n4.nabble.com/frequency-table-tp4156422p4163192.html Sent from the R help mailing list archive at Nabble.com. From comtech.usa at gmail.com Tue Dec 6 03:52:22 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 20:52:22 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Tue Dec 6 03:54:55 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Mon, 5 Dec 2011 21:54:55 -0500 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: On Dec 5, 2011, at 8:37 PM, jim holtman wrote: > Have you tried > > ?View > ?edit Or: ?pairs help(splom, package=lattice) (My preference is plot(density()) but the 2d density plots are slow so also use: help(hexbin, package=hexbin) -- david. > > On Mon, Dec 5, 2011 at 8:12 PM, Bert Gunter > wrote: >> ... and do you really think perusing thousands of numbers by eye is >> any way to edit/check data?! >> >> Personal viewpoint: I would say that this is a large area of >> statistics and data analysis that the discipline fails to address in >> any systematic way ... perhaps because there is no way to address it >> systematically? Contrary views and corrections -- especially >> references! -- would be very welcome. >> >> My advice would be: graphics! -- but I can't provide anything more >> useful without the specifics of the problem. >> >> Some packages may provide the interactivity you seek -- check the >> CRAN >> GUI task view, R Commander, etc. >> >> -- Bert >> >> On Mon, Dec 5, 2011 at 5:01 PM, Michael >> wrote: >>> head, tail and fix commands don't really work well if I have large >>> matrix/array for which I would like to be able to scroll up and >>> dow, left >>> and right ... >>> >>> Could anybody please help me? >>> >>> Thanks >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> >> >> -- >> >> Bert Gunter >> Genentech Nonclinical Biostatistics >> >> Internal Contact Info: >> Phone: 467-7374 >> Website: >> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From jholtman at gmail.com Tue Dec 6 04:17:54 2011 From: jholtman at gmail.com (jim holtman) Date: Mon, 5 Dec 2011 22:17:54 -0500 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: 'edit' does allow you to change it. If all else fails, export to Excel, split the screen and then synchronize the two displays. On Mon, Dec 5, 2011 at 9:52 PM, Michael wrote: > View doesn't allow editing? And not multi-window so I cannot put variables > side-by-side for comparsion? Thanks! > > On Mon, Dec 5, 2011 at 7:37 PM, jim holtman wrote: >> >> Have you tried >> >> ?View >> ?edit >> >> On Mon, Dec 5, 2011 at 8:12 PM, Bert Gunter >> wrote: >> > ... and do you really think perusing thousands of numbers by eye is >> > any way to edit/check data?! >> > >> > Personal viewpoint: I would say that this is a large area of >> > statistics and data analysis that the discipline fails to address in >> > any systematic way ... perhaps because there is no way to address it >> > systematically? Contrary views and corrections -- especially >> > references! -- would be very welcome. >> > >> > ?My advice would be: graphics! -- but I can't provide anything more >> > useful without the specifics of the problem. >> > >> > Some packages may provide the interactivity you seek -- check the CRAN >> > GUI task view, R Commander, etc. >> > >> > -- Bert >> > >> > On Mon, Dec 5, 2011 at 5:01 PM, Michael wrote: >> >> head, tail and fix commands don't really work well if I have large >> >> matrix/array for which I would like to be able to scroll up and dow, >> >> left >> >> and right ... >> >> >> >> Could anybody please help me? >> >> >> >> Thanks >> >> >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> >> >> ______________________________________________ >> >> R-help at 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 code. >> > >> > >> > >> > -- >> > >> > Bert Gunter >> > Genentech Nonclinical Biostatistics >> > >> > Internal Contact Info: >> > Phone: 467-7374 >> > Website: >> > >> > http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >> > >> > ______________________________________________ >> > R-help at 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 code. >> >> >> >> -- >> Jim Holtman >> Data Munger Guru >> >> What is the problem that you are trying to solve? >> Tell me what you want to do, not how you want to do it. > > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From comtech.usa at gmail.com Tue Dec 6 04:26:22 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 21:26:22 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 04:27:56 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 21:27:56 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Tue Dec 6 04:27:39 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 22:27:39 -0500 Subject: [R] Problem in while loop In-Reply-To: References: Message-ID: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 04:32:29 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 21:32:29 -0600 Subject: [R] help! what's wrong with setBreakpoint Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gyanendra.pokharel at gmail.com Tue Dec 6 04:37:45 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 22:37:45 -0500 Subject: [R] Problem in while loop In-Reply-To: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Tue Dec 6 04:38:06 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 22:38:06 -0500 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: <20CD0A34-701A-4EED-B098-A27314D48068@gmail.com> I think what most everyone is getting at is that the visual identification of numeric outliers is an exceedingly difficult task and one we humans are not well evolved for. Rather they are all suggesting you use visual techniques to spot and fix outliers individually. This practice has a long and reputable history in statistics and has been shown to be far more efficient than simply scanning pages of numbers for a single misplaced decimal. In conjunction, I'd also recommend use of the identify() function, which serves just this purpose. If you have so much data that the csv export is unbearably slow it seems unlikely you can check it all by hand. Another, more general, methodology if you are worried about data corruption is to use robust statistics when applicable. Michael On Dec 5, 2011, at 10:27 PM, Michael wrote: > In R-Studio, "edit" gives non-grid based format which is similar to "fix"... > > But exporting to Excel is time-consuming... > > On Mon, Dec 5, 2011 at 9:17 PM, jim holtman wrote: > >> 'edit' does allow you to change it. If all else fails, export to >> Excel, split the screen and then synchronize the two displays. >> >> On Mon, Dec 5, 2011 at 9:52 PM, Michael wrote: >>> View doesn't allow editing? And not multi-window so I cannot put >> variables >>> side-by-side for comparsion? Thanks! >>> >>> On Mon, Dec 5, 2011 at 7:37 PM, jim holtman wrote: >>>> >>>> Have you tried >>>> >>>> ?View >>>> ?edit >>>> >>>> On Mon, Dec 5, 2011 at 8:12 PM, Bert Gunter >>>> wrote: >>>>> ... and do you really think perusing thousands of numbers by eye is >>>>> any way to edit/check data?! >>>>> >>>>> Personal viewpoint: I would say that this is a large area of >>>>> statistics and data analysis that the discipline fails to address in >>>>> any systematic way ... perhaps because there is no way to address it >>>>> systematically? Contrary views and corrections -- especially >>>>> references! -- would be very welcome. >>>>> >>>>> My advice would be: graphics! -- but I can't provide anything more >>>>> useful without the specifics of the problem. >>>>> >>>>> Some packages may provide the interactivity you seek -- check the CRAN >>>>> GUI task view, R Commander, etc. >>>>> >>>>> -- Bert >>>>> >>>>> On Mon, Dec 5, 2011 at 5:01 PM, Michael >> wrote: >>>>>> head, tail and fix commands don't really work well if I have large >>>>>> matrix/array for which I would like to be able to scroll up and dow, >>>>>> left >>>>>> and right ... >>>>>> >>>>>> Could anybody please help me? >>>>>> >>>>>> Thanks >>>>>> >>>>>> [[alternative HTML version deleted]] >>>>>> >>>>>> ______________________________________________ >>>>>> R-help at 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 code. >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Bert Gunter >>>>> Genentech Nonclinical Biostatistics >>>>> >>>>> Internal Contact Info: >>>>> Phone: 467-7374 >>>>> Website: >>>>> >>>>> >> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>> >>>> >>>> >>>> -- >>>> Jim Holtman >>>> Data Munger Guru >>>> >>>> What is the problem that you are trying to solve? >>>> Tell me what you want to do, not how you want to do it. >>> >>> >> >> >> >> -- >> Jim Holtman >> Data Munger Guru >> >> What is the problem that you are trying to solve? >> Tell me what you want to do, not how you want to do it. >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Tue Dec 6 04:40:22 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 21:40:22 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 04:42:17 2011 From: comtech.usa at gmail.com (Michael) Date: Mon, 5 Dec 2011 21:42:17 -0600 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: <20CD0A34-701A-4EED-B098-A27314D48068@gmail.com> References: <20CD0A34-701A-4EED-B098-A27314D48068@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gyanendra.pokharel at gmail.com Tue Dec 6 04:43:59 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Mon, 5 Dec 2011 22:43:59 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ivan.popivanov at gmail.com Tue Dec 6 05:13:45 2011 From: ivan.popivanov at gmail.com (Ivan Popivanov) Date: Mon, 5 Dec 2011 23:13:45 -0500 Subject: [R] rugarch package: is this forecast correct? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Tue Dec 6 05:40:39 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Mon, 5 Dec 2011 23:40:39 -0500 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: References: Message-ID: A function is a parsed object stored in memory; your edit applies to the source, but not to the memory object being executed. There is no way, to my knowledge, to use browser to alter the execution flow of an function once it's going (other than changing values of course). You need to edit the function definition to put the breakpoint where desired and then reread and rerun the function. Michael On Dec 5, 2011, at 10:32 PM, Michael wrote: > Hi all, > > I am in the middle of debugging which is stopped using "browser()"... in > myfile.R at around line #25. > > I was then stuck in a big loop which I want to escape and stop the program > at the line after the big loop. > > In the debugging mode, I used > > Browse[2]> setBreakpoint("myfile.R#38") > > I then typed "c" and "ENTER", thinking that it will continue to execute > until when it comes across line #38 and then stop there... > > But it didn't work - it continued the execution until the end of the > function, right at the line "return(results)"... > > What happened? How to solve this problem? > > Thanks a lot! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From GormleyA at landcareresearch.co.nz Tue Dec 6 04:01:39 2011 From: GormleyA at landcareresearch.co.nz (Andrew Gormley) Date: Tue, 6 Dec 2011 16:01:39 +1300 Subject: [R] Memory getting eaten up with XML Message-ID: Hi all. I have an issue that I cannot resolve. I am trying to read in lots of data that are stored in xml files. But after I read them in and copy the relevant data, then remove the document etc, it doesn't free up the memory. When I monitor it in windows task manager the memory usage just climbs with each iteration until R crashes. I can replicate the problem with the small example: file.name<-"C:\\MyData.xml.gz" TEMPP<-xmlParse(file.name) xx <- xmlRoot(TEMPP) rm(xx) rm(TEMPP) gc() Even though I remove the root node xx and the document TEMPP, the memory usage remains the same as it was when I first read it in... Any ideas/solutions? I am using a 32bit version of R 2.14.0 on windows XP, and the latest version of XML (3.6.1). Many thanks Andrew (apologies for the large footer my work appends to all my emails...) Please consider the environment before printing this email Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails. The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz From h_a_patience at hotmail.com Tue Dec 6 02:32:37 2011 From: h_a_patience at hotmail.com (Bazman76) Date: Mon, 5 Dec 2011 17:32:37 -0800 (PST) Subject: [R] a question on autocorrelation acf In-Reply-To: References: <4BDA115C.9040504@gmail.com> <1323113081359-4161818.post@n4.nabble.com> Message-ID: <1323135157369-4163021.post@n4.nabble.com> Hi there, I have now cheked the results against pc give and the excel add-in poptools. Poptools and pc give get the same answer but R is quite different especially for the acf and pacf()? I looked at the book you recommended on p390 itshows the formulas and they look pretty standard. However looking at the code that you sent the acf function does not seem to be being calculated as shown in the book? At no point is the series mean calculated? unless the variable x is already demeaned in some way ie. there is some preprocessing that I need to see to fully understand? -- View this message in context: http://r.789695.n4.nabble.com/a-question-on-autocorrelation-acf-tp2076280p4163021.html Sent from the R help mailing list archive at Nabble.com. From rolf.turner at xtra.co.nz Tue Dec 6 03:06:39 2011 From: rolf.turner at xtra.co.nz (Rolf Turner) Date: Tue, 06 Dec 2011 15:06:39 +1300 Subject: [R] spatial analysis In-Reply-To: References: Message-ID: <4EDD78AF.9030106@xtra.co.nz> On 06/12/11 01:44, Marianne.ZEYRINGER at ec.europa.eu wrote: > Dear all, > > I am a PhD student in energy modelling. I am completely stuck with the > following problem and would be very grateful for any kind of help. > I have cells Don't we all? We're made of them. :-) What do you mean by ``I have''? I.e. be a bit more explicit about the nature of your data. > and each cell is assigned a number. I would like to form > clusters of cells where the sum of the cell numbers in each cluster must > not exceed 250. One restriction is that only neighbouring cells Define "neighbouring". > can be > formed into clusters. In the end I would like to have a list with all > possible cell combinations. Do you mean all possible ways in which your ``collection of cells'' can be subdivided into such clusters? My guess is that the number of such ways could be extremely large. (Depending of course on how many cells there are in the collection.) > Is it possible to do this with R If yes, I would very much appreciate > all possible hints how to solve it. Install the "fortunes" package. Then type fortune("Yoda") But if you want useful help you'll have to make your question much clearer. cheers, Rolf Turner From luc.villandre at mail.mcgill.ca Tue Dec 6 03:33:02 2011 From: luc.villandre at mail.mcgill.ca (Luc Villandre) Date: Mon, 5 Dec 2011 21:33:02 -0500 Subject: [R] Can't load package 'lars' Message-ID: <4EDD7EDE.6090809@mail.mcgill.ca> Hi, I installed package 'lars' earlier tonight and did not get any sort of error message. ### ** building package indices ... ** testing if installed package can be loaded Loaded lars 0.9-8 * DONE (lars) ### However, when I try to load it, I get ### > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") Error : .onLoad failed in loadNamespace() for 'lars', details: call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], error: subscript out of bounds Error: package/namespace load failed for ?lars? ### Session info: ### > sessionInfo() R version 2.14.0 (2011-10-31) Platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] rpart_3.1-50 tools_2.14.0 ### I get the same error message when I try to load it on another machine: ### > library("lars",lib.loc = "~/R/i686-pc-linux-gnu-library/2.12") Error : .onLoad failed in loadNamespace() for 'lars', details: call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], error: subscript out of bounds Error: package/namespace load failed for 'lars' ### Session info: ### > sessionInfo() R version 2.13.1 (2011-07-08) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.13.1 ### Is there at least a way to circumvent the problem? Thank you for your help, Luc Villandre From michael.weylandt at gmail.com Tue Dec 6 06:03:41 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Tue, 6 Dec 2011 00:03:41 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From elisacarli21 at gmail.com Tue Dec 6 06:58:14 2011 From: elisacarli21 at gmail.com (elisacarli21) Date: Mon, 5 Dec 2011 21:58:14 -0800 (PST) Subject: [R] Problem with clusplot Message-ID: <1323151094047-4163621.post@n4.nabble.com> Dear all I'm trying to run a cluster analysis with R Here are the commands: mydata <- na.omit(matrix) # listwise deletion of missing mydata <- scale(matrix) # standardize variables fit <- kmeans(mydata, 8) # 8 cluster solution # get cluster means aggregate(mydata,by=list(fit$cluster),FUN=mean) # append cluster assignment mydata <- data.frame(mydata, fit$cluster) library(cluster) clusplot(mydata, fit$cluster, color=TRUE, shade=TRUE, labels=2, lines=0) I get the following error Error in princomp.default(x, scores = TRUE, cor = ncol(x) != 2) : 'princomp' can only be used with more units than variables How can I fix it? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-clusplot-tp4163621p4163621.html Sent from the R help mailing list archive at Nabble.com. From landronimirc at gmail.com Tue Dec 6 08:12:26 2011 From: landronimirc at gmail.com (Liviu Andronic) Date: Tue, 6 Dec 2011 08:12:26 +0100 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: <20CD0A34-701A-4EED-B098-A27314D48068@gmail.com> Message-ID: On Tue, Dec 6, 2011 at 4:42 AM, Michael wrote: > I didn't mean the speed of saving the file is slow... I meant the manual > procedures of exporting and then opening Excel, etc. is slow and > inconvenient and unproductive... > You may want to use RExcel then. Liviu > On Mon, Dec 5, 2011 at 9:38 PM, R. Michael Weylandt < > michael.weylandt at gmail.com> wrote: > >> I think what most everyone is getting at is that the visual identification >> of numeric outliers is an exceedingly difficult task and one we humans are >> not well evolved for. Rather they are all suggesting you use visual >> techniques to spot and fix outliers individually. This practice has a long >> and reputable history in statistics and has been shown to be far more >> efficient than simply scanning pages of numbers for a single misplaced >> decimal. In conjunction, I'd also recommend use of the identify() function, >> which serves just this purpose. >> >> If you have so much data that the csv export is unbearably slow it seems >> unlikely you can check it all by hand. >> >> Another, more general, methodology if you are worried about data >> corruption is to use robust statistics when applicable. >> >> Michael >> >> On Dec 5, 2011, at 10:27 PM, Michael wrote: >> >> > In R-Studio, "edit" gives non-grid based format which is similar to >> "fix"... >> > >> > But exporting to Excel is time-consuming... >> > >> > On Mon, Dec 5, 2011 at 9:17 PM, jim holtman wrote: >> > >> >> 'edit' does allow you to change it. ?If all else fails, export to >> >> Excel, split the screen and then synchronize the two displays. >> >> >> >> On Mon, Dec 5, 2011 at 9:52 PM, Michael wrote: >> >>> View doesn't allow editing? And not multi-window so I cannot put >> >> variables >> >>> side-by-side for comparsion? Thanks! >> >>> >> >>> On Mon, Dec 5, 2011 at 7:37 PM, jim holtman >> wrote: >> >>>> >> >>>> Have you tried >> >>>> >> >>>> ?View >> >>>> ?edit >> >>>> >> >>>> On Mon, Dec 5, 2011 at 8:12 PM, Bert Gunter >> >>>> wrote: >> >>>>> ... and do you really think perusing thousands of numbers by eye is >> >>>>> any way to edit/check data?! >> >>>>> >> >>>>> Personal viewpoint: I would say that this is a large area of >> >>>>> statistics and data analysis that the discipline fails to address in >> >>>>> any systematic way ... perhaps because there is no way to address it >> >>>>> systematically? Contrary views and corrections -- especially >> >>>>> references! -- would be very welcome. >> >>>>> >> >>>>> My advice would be: graphics! -- but I can't provide anything more >> >>>>> useful without the specifics of the problem. >> >>>>> >> >>>>> Some packages may provide the interactivity you seek -- check the >> CRAN >> >>>>> GUI task view, R Commander, etc. >> >>>>> >> >>>>> -- Bert >> >>>>> >> >>>>> On Mon, Dec 5, 2011 at 5:01 PM, Michael >> >> wrote: >> >>>>>> head, tail and fix commands don't really work well if I have large >> >>>>>> matrix/array for which I would like to be able to scroll up and dow, >> >>>>>> left >> >>>>>> and right ... >> >>>>>> >> >>>>>> Could anybody please help me? >> >>>>>> >> >>>>>> Thanks >> >>>>>> >> >>>>>> ? ? ? [[alternative HTML version deleted]] >> >>>>>> >> >>>>>> ______________________________________________ >> >>>>>> R-help at 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 code. >> >>>>> >> >>>>> >> >>>>> >> >>>>> -- >> >>>>> >> >>>>> Bert Gunter >> >>>>> Genentech Nonclinical Biostatistics >> >>>>> >> >>>>> Internal Contact Info: >> >>>>> Phone: 467-7374 >> >>>>> Website: >> >>>>> >> >>>>> >> >> >> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm >> >>>>> >> >>>>> ______________________________________________ >> >>>>> R-help at 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 code. >> >>>> >> >>>> >> >>>> >> >>>> -- >> >>>> Jim Holtman >> >>>> Data Munger Guru >> >>>> >> >>>> What is the problem that you are trying to solve? >> >>>> Tell me what you want to do, not how you want to do it. >> >>> >> >>> >> >> >> >> >> >> >> >> -- >> >> Jim Holtman >> >> Data Munger Guru >> >> >> >> What is the problem that you are trying to solve? >> >> Tell me what you want to do, not how you want to do it. >> >> >> > >> ?> ? ?[[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail From r.m.krug at gmail.com Tue Dec 6 09:24:55 2011 From: r.m.krug at gmail.com (Rainer M Krug) Date: Tue, 06 Dec 2011 09:24:55 +0100 Subject: [R] spatial analysis In-Reply-To: <4EDD78AF.9030106@xtra.co.nz> References: <4EDD78AF.9030106@xtra.co.nz> Message-ID: <4EDDD157.9090508@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/12/11 03:06, Rolf Turner wrote: > On 06/12/11 01:44, Marianne.ZEYRINGER at ec.europa.eu wrote: >> Dear all, >> >> I am a PhD student in energy modelling. I am completely stuck >> with the following problem and would be very grateful for any >> kind of help. I have cells > Don't we all? We're made of them. :-) > > What do you mean by ``I have''? I.e. be a bit more explicit about > the nature of your data. >> and each cell is assigned a number. I would like to form clusters >> of cells where the sum of the cell numbers in each cluster must >> not exceed 250. One restriction is that only neighbouring cells > Define "neighbouring". >> can be formed into clusters. In the end I would like to have a >> list with all possible cell combinations. > Do you mean all possible ways in which your ``collection of > cells'' can be subdivided into such clusters? My guess is that the > number of such ways could be extremely large. (Depending of course > on how many cells there are in the collection.) >> Is it possible to do this with R If yes, I would very much >> appreciate all possible hints how to solve it. > Install the "fortunes" package. Then type > > fortune("Yoda") > > But if you want useful help you'll have to make your question much > clearer. Agreed - but as it is a spatial question, you should post it at r-sig-geo at r-project.org, the list of the special interest group spatial analysis. I would also look into e.g. GRASS and SAGA, which might be faster with these kind of spatial calculations. In general, if I understand you correctly, you can start with each cell and then "grow outwards" until you hit your stop criteria (sum <= 250), and then you should have your clusters: one solution per starting cell (assuming symmetric clusters - if the clusters can be a-symmetric, many many more). Cheers, Rainer > > cheers, > > Rolf Turner > > ______________________________________________ R-help at 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 code. - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7d0VYACgkQoYgNqgF2egqOsACfc6CKV1tY/0xbxR41AfwoBMtA bWsAnRivgAdiuF3MKErvl1l8I+twrOf+ =k9v+ -----END PGP SIGNATURE----- From pomchip at free.fr Tue Dec 6 09:29:03 2011 From: pomchip at free.fr (=?ISO-8859-1?Q?S=E9bastien_Bihorel?=) Date: Tue, 6 Dec 2011 03:29:03 -0500 Subject: [R] How to automate the detection of break points for use in cut Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From pomchip at free.fr Tue Dec 6 09:34:54 2011 From: pomchip at free.fr (=?ISO-8859-1?Q?S=E9bastien_Bihorel?=) Date: Tue, 6 Dec 2011 03:34:54 -0500 Subject: [R] How to automate the detection of break points for use in cut In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From agnieszka.e.konopka at gmail.com Tue Dec 6 10:53:29 2011 From: agnieszka.e.konopka at gmail.com (Agnieszka Konopka) Date: Tue, 6 Dec 2011 10:53:29 +0100 Subject: [R] factors with multiple levels Message-ID: Hi R-experts, I'm running into some trouble with a multi-level factor. My apologies if this is a basic question, but I have been told there are different ways to do this and would like to see what you think. In the dataset I'm looking at, subjects named pictures multiple times (e.g., they named each picture 8 times), so Repetition is a multi-level factor. How would you enter it into a model? As a factor? Or a numeric predictor? I understand the pros and cons of both approaches, but there seems to be some debate about this. I am not interested in the individual contrasts between different levels of the Repetition factor, but only need the equivalent of an F value in a standard ANOVA for that factor. And what about dependencies between levels? Many thanks in advance, Agnieszka From nalimilan at club.fr Tue Dec 6 11:03:27 2011 From: nalimilan at club.fr (Milan Bouchet-Valat) Date: Tue, 6 Dec 2011 11:03:27 +0100 Subject: [R] how to view/edit large matrix/array in R? In-Reply-To: References: Message-ID: <1323165808.17508.24.camel@milan> Le lundi 05 d?cembre 2011 ? 19:01 -0600, Michael a ?crit : > head, tail and fix commands don't really work well if I have large > matrix/array for which I would like to be able to scroll up and dow, left > and right ... > > Could anybody please help me? RKWard has a good data editor, and you can open several objects at the same time in tabs. But it will not probably work if your data set is really huge (here it works very well with a few thousand rows, though). If you need to see a selection of variables in parallel, ordering the variables so that they're next to each other is probably a good solution. Cheers From JRadinger at gmx.at Tue Dec 6 12:41:45 2011 From: JRadinger at gmx.at (Johannes Radinger) Date: Tue, 06 Dec 2011 12:41:45 +0100 Subject: [R] Argument validation within functions Message-ID: <20111206114145.143490@gmx.net> Hi, I just started with writing functions in R and so some questions popped up. I provide some values as argument to my function such as: function(a,b,c){} Now i want that the function first checks if the arguments are valid for the function. E.g argument "a" has to be a number in the range 0-1. How can that easily done? So far I have: a <- as.numeric(a) if(0 <= a && a <= 1) to first check if a is a number...if not the function stops and gives an error message. If it is a number it just continues... But how to check the range? Above there is the if-approach but then the rest of the function is exectued as part of if (or else). Is there a simpler way without having the if-brackets around the remaining code? Just a check if the value is between 0 and 1 and if yes continue with the next line if no abort the function with a error message? How can such an error message be created? thank you and best regards, /Johannes -- From michael.weylandt at gmail.com Tue Dec 6 12:52:49 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 06:52:49 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: So I just ran your code verbatim with this one change and it finished in less than 10 seconds. However, even without the change it doesn't take more than 15 seconds: what exactly lead you to believe this was an infinite loop? Michael On Tue, Dec 6, 2011 at 12:03 AM, R. Michael Weylandt wrote: > Off the bat I'd suggest you vectorize loglikelihood as a simple one liner: > > sum(log(b^2 + (x-a)^2)) > > That alone will speed up your function many times over: I'll look at the big > function in more detail tomorrow. > > Michael > > On Dec 5, 2011, at 10:37 PM, Gyanendra Pokharel > wrote: > > Thanks Michael > Lets figure out the problem by using the following function. I found the > same problem in this code too. > > > loglikehood <- function(a, b = 0.1, x = c(-4.2, -2.85, -2.3, -1.02, 0.7, > 0.98, 2.72, 3.5)) > > { > > s <- 0 > > for(i in 1:length(x)){ > > s <- s + log(b^2 + (x[i] - a)^2) > > } > > s > > } > > loglikelihood(0.1) > > simann <- function(T0 = 1, N = 500, rho = 0.9, x0 = 0, eps = 0.1, f){ > > moving <- 1 > > count <- 0 > > Temp <- T0 > > x <- x0 > > while(moving > 0){ > > moving <- 0 > > for(i in 1:N){ > > y <- x + runif(1,-eps,eps) > > alpha <- min(1,exp((f(x) -f(y))/Temp)) > > if(runif(1) > moving <- moving +1 > > x <- y > > } > > } > > Temp <- Temp*rho > > count <- count + 1 > > } > > fmin <- f(x) > > return(c(x,fmin,count)) > > } > > simann(f = loglikelihood) > > I hope we can analyze every problems from this function > > On Mon, Dec 5, 2011 at 10:27 PM, R. Michael Weylandt > wrote: >> >> It's not necessarily equivalent to your "loglikelihood" function but since >> that function wasn't provided I couldn't test it. >> >> My broader point is this: you said the problem was that the loop ran >> endlessly: I showed it does not run endlessly for at least one input so at >> least part of the problem lies in loglikelihood, which, being unprovided, I >> have trouble replicating. >> >> My original guess still stands: it's either 1) a case of you getting stuck >> at probaccept = 1 or 2) so slow it just feels endless. ?Either way, my >> prescription is the same: print() >> >> Michael >> >> >> On Dec 5, 2011, at 9:30 PM, Gyanendra Pokharel >> wrote: >> >> Yes, your function out<- epiann(f = function(a,b) log(dnorm(a)*dnorm(b))), >> N = 10) works well. >> >> But?why you are changing the loglikelihood function to f = function(a,b) >> log(dnorm(a)*dnorm(b))? how it is equivalent to loglikelihood? is there any >> mathematical relation? ?I also want to see the plot of aout and bout versus >> loglikelihood, and see the cooling rate in different temperature. how is >> this possible? >> >> On Mon, Dec 5, 2011 at 6:07 PM, R. Michael Weylandt >> wrote: >>> >>> If you run >>> >>> out<- epiann(f = function(a,b) log(dnorm(a)*dnorm(b))), N = 10) >>> >>> It takes less than 0.5 seconds so there's no problem I can see: >>> perhaps you want to look elsewhere to get better speed (like Rcpp or >>> general vectorization), or maybe your loglikihood is not what's >>> desired, but there's no problem with the loop. >>> >>> Michael >>> >>> On Mon, Dec 5, 2011 at 5:29 PM, Gyanendra Pokharel >>> wrote: >>> > Yes, I checked the acceptprob, it is very high but in my view, the >>> > while >>> > loop is not stopping, so there is some thing wrong in the use of while >>> > loop. >>> > When I removed the while loop, it returned some thing but not the >>> > result >>> > what I want. When i run the while loop separately, it never stops. >>> > >>> > >>> > >>> > On Mon, Dec 5, 2011 at 5:18 PM, R. Michael Weylandt >>> > wrote: >>> >> >>> >> Your code is not reproducible nor minimal, but why don't you put a >>> >> command print(acceptprob) in and see if you are getting reasonable >>> >> values. If these values are extremely low it shouldn't surprise you >>> >> that your loop takes a long time to run. >>> >> >>> >> More generally, read up on the use of print() and browser() as >>> >> debugging >>> >> tools. >>> >> >>> >> Michael >>> >> >>> >> On Mon, Dec 5, 2011 at 3:47 PM, Gyanendra Pokharel >>> >> wrote: >>> >> > I forgot to upload the R-code in last email, so heare is one >>> >> > >>> >> > epiann <- function(T0 = 1, N=1000, ainit=1, binit=1,rho = 0.99, >>> >> > amean = >>> >> > 3, >>> >> > bmean=1.6, avar =.1, bvar=.1, f){ >>> >> > >>> >> > ? ? ? ?moving <- 1 >>> >> > ? ? ? ?count <- 0 >>> >> > ? ? ? ?Temp <- T0 >>> >> > ? ? ? ?aout <- ainit >>> >> > ? ? ? ?bout <- binit >>> >> > ? ? ? ?while(moving > 0){ >>> >> > ? ? ? ? ? ? ? ?moving <- 0 >>> >> > ? ? ? ? ? ? ? ?for (i in 1:N) { >>> >> > ? ? ? ? ? ? ? ?aprop <- rnorm (1,amean, avar) >>> >> > ? ? ? ? ? ? ? ?bprop <- rnorm (1,bmean, bvar) >>> >> > ? ? ? ? ? ? ? ?if (aprop > 0 & bprop > 0){ >>> >> > ? ? ? ? ? ? ? ?acceptprob <- min(1,exp((f(aout, bout) - >>> >> > f(aprop,bprop))/Temp)) >>> >> > ? ? ? ? ? ? ? ?u <- runif(1) >>> >> > ? ? ? ? ? ? ? ?if(u>> >> > ? ? ? ? ? ? ? ? ? ?moving <- moving +1 >>> >> > ? ? ? ? ? ? ? ? ? ?aout <- aprop >>> >> > ? ? ? ? ? ? ? ? ? ?bout <- bprop >>> >> > ? ? ? ? ? ? ? ? ? ?} >>> >> > ? ? ? ? ? ? ? ? ? ?else{aprob <- aout >>> >> > ? ? ? ? ? ? ? ? ? ? ? ?bprob <- bout} >>> >> > ? ? ? ? ? ? ? ?} >>> >> > ? ? ? ? ? ?} >>> >> > ? ? ? ?Temp <- Temp*rho >>> >> > ? ? ? ? ? ?count <- count +1 >>> >> > >>> >> > ? ?} >>> >> > ? ?fmin <- f(aout,bout) >>> >> > ? ?return(c(aout, bout,fmin, count) ) >>> >> > >>> >> > } >>> >> > out<- epiann(f = loglikelihood) >>> >> > >>> >> > On Mon, Dec 5, 2011 at 3:46 PM, Gyanendra Pokharel < >>> >> > gyanendra.pokharel at gmail.com> wrote: >>> >> > >>> >> >> Hi all, >>> >> >> I have the following code, >>> >> >> When I run the code, it never terminate this is because of the >>> >> >> while >>> >> >> loop >>> >> >> i am using. In general, if you need a loop for which you don't know >>> >> >> in >>> >> >> advance how many iterations there will be, you can use the `while' >>> >> >> statement so here too i don't know the number how many iterations >>> >> >> are >>> >> >> there. So Can some one suggest me whats going on? >>> >> >> I am using the Metropolis simulated annealing algorithm >>> >> >> Best >>> >> >> >>> >> > >>> >> > ? ? ? ?[[alternative HTML version deleted]] >>> >> > >>> >> > ______________________________________________ >>> >> > R-help at 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 code. >>> > >>> > >> >> > From michael.weylandt at gmail.com Tue Dec 6 13:04:59 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 07:04:59 -0500 Subject: [R] Argument validation within functions In-Reply-To: <20111206114145.143490@gmx.net> References: <20111206114145.143490@gmx.net> Message-ID: The quick and dirty way to do so is to use: stopifnot() in conjunction (if necessary with all() and any()). You can replace that first condition with a simple is.numeric() as well. A more helpful way (if this is production code) is to use if statement with the stop() function directly which lets you provide specific error messages. Michael On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger wrote: > Hi, > > I just started with writing functions in R and so some questions popped up. > I provide some values as argument to my function such as: > > function(a,b,c){} > > Now i want that the function first checks if the arguments are valid for the function. E.g argument "a" has to be a number in the range 0-1. How can that easily done? > > So far I have: > > ? ? ? ?a <- as.numeric(a) > ? ? ? ?if(0 <= a && a <= 1) > > to first check if a is a number...if not the function stops and gives an error message. If it is a number it just continues... > > But how to check the range? > Above there is the if-approach but then the rest of the function is exectued as part of if (or else). Is there a simpler way without having the if-brackets around the remaining code? > Just a check if the value is between 0 and 1 and if yes continue with the next line if no abort the function with a error message? How can such an error message be created? > > thank you and best regards, > > /Johannes > -- > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Tue Dec 6 13:12:04 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 07:12:04 -0500 Subject: [R] a question on autocorrelation acf In-Reply-To: <1323135157369-4163021.post@n4.nabble.com> References: <4BDA115C.9040504@gmail.com> <1323113081359-4161818.post@n4.nabble.com> <1323135157369-4163021.post@n4.nabble.com> Message-ID: The code provided was the hard-to-find C part: there's also some R code involved that you can get in your console by typing acf without parentheses. I'm inclined to believe V&R over any Excel implementation (and I don't know what "pc" is) but perhaps you can provide a (small) data-set using the dput() function and say what you are expecting to get from acf() instead. Michael On Mon, Dec 5, 2011 at 8:32 PM, Bazman76 wrote: > Hi there, > > I have now cheked the results against pc give and the excel add-in poptools. > > Poptools and pc give get the same answer but R is quite different especially > for the acf and pacf()? > > I looked at the book you recommended on p390 itshows the formulas and they > look pretty standard. > > However looking at the code that you sent the acf function does not seem to > be being calculated as shown in the book? > > At no point is the series mean calculated? unless the variable x is already > demeaned in some way ie. there is some preprocessing that I need to see to > fully understand? > > > > -- > View this message in context: http://r.789695.n4.nabble.com/a-question-on-autocorrelation-acf-tp2076280p4163021.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Tue Dec 6 13:17:48 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 07:17:48 -0500 Subject: [R] rugarch package: is this forecast correct? In-Reply-To: References: Message-ID: The calculation is numerically stable on my machine: I'd mark it up as computational/floating-point error and not worry about it. Michael On Mon, Dec 5, 2011 at 11:13 PM, Ivan Popivanov wrote: > Let me start with the code: > > library(quantmod) > library(rugarch) > getSymbols("SPY", from="1900-01-01") > rets=na.trim(diff(log(Cl(SPY)))) > tt = tail(rets["/2004-10-29"], 1000) > spec = ugarchspec(variance.model=list(garchOrder=c(1,1)), > mean.model=list(armaOrder=c(2,5)), distribution.model="sged") > for(ii in 1:10) > { > ? ttFit = ugarchfit( spec=spec, data=as.vector(tt), out.sample=0, > solver.control=list(trace=F) ) > ? ttFore = ugarchforecast( ttFit, n.ahead=1, n.roll=0 ) > ? print( as.array(ttFore)[,2,] ) > } > > Produces two different results: -0.001087313 and -0.001092084, each > repeated a few times. > > What is the explanation for that? Since they are based on previous data, I > was expecting single step forecasts to produce the same result. > > Thanks in advance! > Ivan > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From pomchip at free.fr Tue Dec 6 13:19:05 2011 From: pomchip at free.fr (=?ISO-8859-1?Q?S=E9bastien_Bihorel?=) Date: Tue, 6 Dec 2011 07:19:05 -0500 Subject: [R] Argument validation within functions Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Tue Dec 6 13:22:06 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 07:22:06 -0500 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: References: Message-ID: <4EDE08EE.6040407@gmail.com> On 11-12-05 10:32 PM, Michael wrote: > Hi all, > > I am in the middle of debugging which is stopped using "browser()"... in > myfile.R at around line #25. > > I was then stuck in a big loop which I want to escape and stop the program > at the line after the big loop. > > In the debugging mode, I used > > Browse[2]> setBreakpoint("myfile.R#38") What did it print? > > I then typed "c" and "ENTER", thinking that it will continue to execute > until when it comes across line #38 and then stop there... > > But it didn't work - it continued the execution until the end of the > function, right at the line "return(results)"... > > What happened? How to solve this problem? One of the complications in R is that you can have multiple copies of a function in memory. You may (or may not, what did it print??) have set a breakpoint in one copy, then run another. Or you may have edited that function after originally sourcing it, and lost the source reference. An alternative to using setBreakpoint is just to edit a call to browser() into the function. It's less convenient, but more robust. Duncan Murdoch > Thanks a lot! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From murdoch.duncan at gmail.com Tue Dec 6 13:28:53 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 07:28:53 -0500 Subject: [R] How to automate the detection of break points for use in cut In-Reply-To: References: Message-ID: <4EDE0A85.7070904@gmail.com> On 11-12-06 3:34 AM, S?bastien Bihorel wrote: > Obviously, cut would do the job if one knows the number of intervals in > advance, which I assume I won't. I guess what I'm looking for is a function > that figures out the number of intervals and their boundaries. That's not really a simple problem, but there are functions that do clustering and fit mixture models to data, which might be close enough. See the Cluster task view at http://cran.r-project.org/web/views/Cluster.html. Duncan Murdoch > > Sebastien > > On Tue, Dec 6, 2011 at 3:29 AM, S?bastien Bihorel wrote: > >> Dear R-users, >> >> I would like to know if there is a function (in base R or the extension >> packages) that would automatically detect the break points in a vector x >> for later use in the cut function. The idea is to determine the boundaries >> of the n intervals (n>=1) delimiting clusters of data points which could be >> considered "reasonably" close, given a numerical vector x with unknown >> content and unknown multimodal distribution. >> >> For instance, given for the vector x defined by set.seed(1234); x<- >> sort(c(rnorm(20,-1,0.1),rnorm( >> 10,5,0.1),rnorm(10,100,0.1))), this function would return a vector of 4 >> points: min(x), one value between 20 and 5, one value between 5 and 100, >> and max(x). >> >> Thank you in advance for your suggestions. >> >> Sebastien >> > > [[alternative HTML version deleted]] > > > > > ______________________________________________ > R-help at 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 code. From JRadinger at gmx.at Tue Dec 6 13:46:14 2011 From: JRadinger at gmx.at (Johannes Radinger) Date: Tue, 06 Dec 2011 13:46:14 +0100 Subject: [R] Argument validation within functions In-Reply-To: References: <20111206114145.143490@gmx.net> Message-ID: <20111206124614.162280@gmx.net> Hi, thank you... I think I will go for the if-stop approach as the stop() stops the total function... So there is just one little other question: What is the opposite of is.numeric? Is ther isnot.numeric? How can that be implemented in following function: f <- function(a){ if(is.numeric(a)) stop("a is not numeric") if(0 > a && a > 1) stop("a must be a value between 0 and 1") a } /Johannes -------- Original-Nachricht -------- > Datum: Tue, 6 Dec 2011 07:04:59 -0500 > Von: "R. Michael Weylandt" > An: Johannes Radinger > CC: r-help at r-project.org > Betreff: Re: [R] Argument validation within functions > The quick and dirty way to do so is to use: stopifnot() in conjunction > (if necessary with all() and any()). You can replace that first > condition with a simple is.numeric() as well. A more helpful way (if > this is production code) is to use if statement with the stop() > function directly which lets you provide specific error messages. > > Michael > > On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger > wrote: > > Hi, > > > > I just started with writing functions in R and so some questions popped > up. > > I provide some values as argument to my function such as: > > > > function(a,b,c){} > > > > Now i want that the function first checks if the arguments are valid for > the function. E.g argument "a" has to be a number in the range 0-1. How > can that easily done? > > > > So far I have: > > > > ? ? ? ?a <- as.numeric(a) > > ? ? ? ?if(0 <= a && a <= 1) > > > > to first check if a is a number...if not the function stops and gives an > error message. If it is a number it just continues... > > > > But how to check the range? > > Above there is the if-approach but then the rest of the function is > exectued as part of if (or else). Is there a simpler way without having the > if-brackets around the remaining code? > > Just a check if the value is between 0 and 1 and if yes continue with > the next line if no abort the function with a error message? How can such an > error message be created? > > > > thank you and best regards, > > > > /Johannes > > -- > > > > ______________________________________________ > > R-help at 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 code. -- From stan.gaj at maastrichtuniversity.nl Tue Dec 6 13:53:02 2011 From: stan.gaj at maastrichtuniversity.nl (Gaj Stan (BIGCAT)) Date: Tue, 6 Dec 2011 13:53:02 +0100 Subject: [R] Paste() - Get all possible combinations from multiple vectors Message-ID: <2D1C3C74C8DE6C48B602E679AB37211C0AA947527E@UM-MAIL4112.unimaas.nl> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Tue Dec 6 13:57:43 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 06 Dec 2011 13:57:43 +0100 Subject: [R] Argument validation within functions In-Reply-To: <20111206124614.162280@gmx.net> References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> Message-ID: <4EDE1147.2060203@statistik.tu-dortmund.de> On 06.12.2011 13:46, Johannes Radinger wrote: > Hi, > > thank you... I think I will go for the if-stop approach > as the stop() stops the total function... So there is just > one little other question: What is the opposite of is.numeric? > Is ther isnot.numeric? Yes, see: ?"!" Uwe Ligges > How can that be implemented in following function: > > f<- function(a){ > if(is.numeric(a)) stop("a is not numeric") > if(0> a&& a> 1) stop("a must be a value between 0 and 1") > a > } > > /Johannes > > -------- Original-Nachricht -------- >> Datum: Tue, 6 Dec 2011 07:04:59 -0500 >> Von: "R. Michael Weylandt" >> An: Johannes Radinger >> CC: r-help at r-project.org >> Betreff: Re: [R] Argument validation within functions > >> The quick and dirty way to do so is to use: stopifnot() in conjunction >> (if necessary with all() and any()). You can replace that first >> condition with a simple is.numeric() as well. A more helpful way (if >> this is production code) is to use if statement with the stop() >> function directly which lets you provide specific error messages. >> >> Michael >> >> On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger >> wrote: >>> Hi, >>> >>> I just started with writing functions in R and so some questions popped >> up. >>> I provide some values as argument to my function such as: >>> >>> function(a,b,c){} >>> >>> Now i want that the function first checks if the arguments are valid for >> the function. E.g argument "a" has to be a number in the range 0-1. How >> can that easily done? >>> >>> So far I have: >>> >>> a<- as.numeric(a) >>> if(0<= a&& a<= 1) >>> >>> to first check if a is a number...if not the function stops and gives an >> error message. If it is a number it just continues... >>> >>> But how to check the range? >>> Above there is the if-approach but then the rest of the function is >> exectued as part of if (or else). Is there a simpler way without having the >> if-brackets around the remaining code? >>> Just a check if the value is between 0 and 1 and if yes continue with >> the next line if no abort the function with a error message? How can such an >> error message be created? >>> >>> thank you and best regards, >>> >>> /Johannes >>> -- >>> >>> ______________________________________________ >>> R-help at 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 code. > > -- > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Tue Dec 6 13:57:44 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 07:57:44 -0500 Subject: [R] Argument validation within functions In-Reply-To: References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> Message-ID: Use the ! (not) operator. Not sure what you mean by " as the stop() stops the total function": try the following f <- function(a){ ? ?stopifnot(a > 3) ? ?return(a^2) } f(2) f(4) Michael (PS -- It's usually asked to cc the list so that this all gets threaded properly in folks' mailboxes) On Tue, Dec 6, 2011 at 7:46 AM, Johannes Radinger wrote: > Hi, > > thank you... I think I will go for the if-stop approach > as the stop() stops the total function... So there is just > one little other question: What is the opposite of is.numeric? > Is ther isnot.numeric? How ?can that be implemented in following > function: > > f <- function(a){ > ? ? ? ?if(is.numeric(a)) stop("a is not numeric") > ? ? ? ?if(0 > a && a > 1) stop("a must be a value between 0 and 1") > ? ? ? ?a > } > > /Johannes > > -------- Original-Nachricht -------- >> Datum: Tue, 6 Dec 2011 07:04:59 -0500 >> Von: "R. Michael Weylandt" >> An: Johannes Radinger >> CC: r-help at r-project.org >> Betreff: Re: [R] Argument validation within functions > >> The quick and dirty way to do so is to use: stopifnot() in conjunction >> (if necessary with all() and any()). You can replace that first >> condition with a simple is.numeric() as well. A more helpful way (if >> this is production code) is to use if statement with the stop() >> function directly which lets you provide specific error messages. >> >> Michael >> >> On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger >> wrote: >> > Hi, >> > >> > I just started with writing functions in R and so some questions popped >> up. >> > I provide some values as argument to my function such as: >> > >> > function(a,b,c){} >> > >> > Now i want that the function first checks if the arguments are valid for >> the function. E.g argument "a" has to be a number in the range 0-1. How >> can that easily done? >> > >> > So far I have: >> > >> > ? ? ? ?a <- as.numeric(a) >> > ? ? ? ?if(0 <= a && a <= 1) >> > >> > to first check if a is a number...if not the function stops and gives an >> error message. If it is a number it just continues... >> > >> > But how to check the range? >> > Above there is the if-approach but then the rest of the function is >> exectued as part of if (or else). Is there a simpler way without having the >> if-brackets around the remaining code? >> > Just a check if the value is between 0 and 1 and if yes continue with >> the next line if no abort the function with a error message? How can such an >> error message be created? >> > >> > thank you and best regards, >> > >> > /Johannes >> > -- >> > >> > ______________________________________________ >> > R-help at 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 code. > > -- > NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! > Jetzt informieren: http://www.gmx.net/de/go/freephone From michael.weylandt at gmail.com Tue Dec 6 13:58:27 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 07:58:27 -0500 Subject: [R] Paste() - Get all possible combinations from multiple vectors In-Reply-To: <2D1C3C74C8DE6C48B602E679AB37211C0AA947527E@UM-MAIL4112.unimaas.nl> References: <2D1C3C74C8DE6C48B602E679AB37211C0AA947527E@UM-MAIL4112.unimaas.nl> Message-ID: outer(outer(x, y, paste), z, paste) Michael On Tue, Dec 6, 2011 at 7:53 AM, Gaj Stan (BIGCAT) wrote: > Hello fellow R-users, > > Given are three vectors and the outcome would be all possible combinations in combination with the paste() function. > For example: > > x <- c(1:3) > y <- letters[1:3] > z <- LETTERS[1:3] > > My result would thus be 18 names based on all possible combinations between these vectors: > "1 a A" "1 a B", "1 a C", "1 b A", "1 b B", "1 b C", "1 c A", "1 c B", "1 c C", etc. > > To solve the issue above I would use: > > paste(rep(x, each=9), rep(y, each=6), z) > > This is a very straightforward example, but when I have vectors of different sizes, it will be much more difficult (for me) to create this. Is there an easier way to do this? > > Many thanks in advance, > > ?-- Stan > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Tue Dec 6 14:01:26 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 6 Dec 2011 14:01:26 +0100 Subject: [R] Can't load package 'lars' In-Reply-To: <4EDD7EDE.6090809@mail.mcgill.ca> References: <4EDD7EDE.6090809@mail.mcgill.ca> Message-ID: <4EDE1226.1010708@statistik.tu-dortmund.de> On 06.12.2011 03:33, Luc Villandre wrote: > Hi, > > I installed package 'lars' earlier tonight and did not get any sort of > error message. > > ### > ** building package indices ... > ** testing if installed package can be loaded > Loaded lars 0.9-8 > > * DONE (lars) > ### > > However, when I try to load it, I get > ### > > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") Are you sure it is installed at the location you specified? Uwe Ligges > Error : .onLoad failed in loadNamespace() for 'lars', details: > call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], > error: subscript out of bounds > Error: package/namespace load failed for ?lars? > ### > > Session info: > > ### > > sessionInfo() > R version 2.14.0 (2011-10-31) > Platform: x86_64-redhat-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] rpart_3.1-50 tools_2.14.0 > ### > > I get the same error message when I try to load it on another machine: > > ### > > > library("lars",lib.loc = "~/R/i686-pc-linux-gnu-library/2.12") > Error : .onLoad failed in loadNamespace() for 'lars', details: > call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], > error: subscript out of bounds > Error: package/namespace load failed for 'lars' > ### > > Session info: > > ### > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: i686-pc-linux-gnu (32-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_2.13.1 > ### > > Is there at least a way to circumvent the problem? > > Thank you for your help, > > Luc Villandre > > ______________________________________________ > R-help at 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 code. From djandrija at gmail.com Tue Dec 6 14:01:20 2011 From: djandrija at gmail.com (andrija djurovic) Date: Tue, 6 Dec 2011 14:01:20 +0100 Subject: [R] Paste() - Get all possible combinations from multiple vectors In-Reply-To: <2D1C3C74C8DE6C48B602E679AB37211C0AA947527E@UM-MAIL4112.unimaas.nl> References: <2D1C3C74C8DE6C48B602E679AB37211C0AA947527E@UM-MAIL4112.unimaas.nl> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From haenlein at escpeurope.eu Tue Dec 6 14:08:34 2011 From: haenlein at escpeurope.eu (Michael Haenlein) Date: Tue, 6 Dec 2011 14:08:34 +0100 Subject: [R] Regression model when dependent variable can only take positive values Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Tue Dec 6 14:15:08 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 06 Dec 2011 14:15:08 +0100 Subject: [R] Summary coefficients give NA values because of singularities In-Reply-To: <1323118654603-4162113.post@n4.nabble.com> References: <1323118654603-4162113.post@n4.nabble.com> Message-ID: <4EDE155C.7060100@statistik.tu-dortmund.de> On 05.12.2011 21:57, Gathurst wrote: > Hello, > > I have a data set which I am using to find a model with the most significant > parameters included and most importantly, the p-values. The full model is > of the form: > sad[,1]~b_1 sad[,2]+b_2 sad[,3]+b_3 sad[,4]+b_4 sad[,5]+b_5 sad[,6]+b_6 > sad[,7]+b_7 sad[,8]+b_8 sad[,9]+b_9 sad[,10], > where the 9 variables on the right hand side are all indicator variables. > The thing I don't understand is the line ' sad[, 10] NA NA > NA NA ' as a result of 'Coefficients: (1 not defined because of > singularities)'. > > I think the output is taking sad[,10] as the intercept, based on previous > attempts at figuring my issue out, which I find a bit wierd considering > sad[,10] is either 0 or 1. How do I produce the correct output showing all > p-values? You cannot: sad[,10] is either collinear to one or more of the other variables or is constant. Uwe Ligges > > My code and output is as follows: > > sad<-matrix(1,ncol=11,nrow=486) > sad[,c(1:10)]<-d[,2][-357] > sad[,1]<-d[,29][-357] > sad[,2][sad[,2]!=1]<-0 > sad[,3][sad[,3]!=2]<-0 > sad[,4][sad[,4]!=3]<-0 > sad[,5][sad[,5]!=4]<-0 > sad[,6][sad[,6]!=5]<-0 > sad[,7][sad[,7]!=6]<-0 > sad[,8][sad[,8]!=7]<-0 > sad[,9][sad[,9]!=8]<-0 > sad[,10][sad[,10]!=9]<-0 > sad[,2][sad[,2]==1]<-1 > sad[,3][sad[,3]==2]<-1 > sad[,4][sad[,4]==3]<-1 > sad[,5][sad[,5]==4]<-1 > sad[,6][sad[,6]==5]<-1 > sad[,7][sad[,7]==6]<-1 > sad[,8][sad[,8]==7]<-1 > sad[,9][sad[,9]==8]<-1 > sad[,10][sad[,10]==9]<-1 > sad > > summary(lm(sad[,1]~sad[,2]+sad[,3] > +sad[,4]+sad[,5]+sad[,6] > +sad[,7]+sad[,8]+sad[,9]+sad[,10])) > > Call: > lm(formula = sad[, 1] ~ sad[, 2] + sad[, 3] + sad[, 4] + sad[, > 5] + sad[, 6] + sad[, 7] + sad[, 8] + sad[, 9] + sad[, 10]) > > Residuals: > Min 1Q Median 3Q Max > -3.3191 -0.3893 0.0519 0.7436 1.0519 > > Coefficients: (1 not defined because of singularities) > Estimate Std. Error t value Pr(>|t|) > (Intercept) 4.34091 0.14495 29.947<2e-16 *** > sad[, 2] -0.16142 0.18128 -0.890 0.3737 > sad[, 3] -0.23221 0.20275 -1.145 0.2527 > sad[, 4] 0.17832 0.19695 0.905 0.3657 > sad[, 5] 0.06450 0.21447 0.301 0.7638 > sad[, 6] -0.15909 0.18713 -0.850 0.3957 > sad[, 7] -0.39286 0.18171 -2.162 0.0311 * > sad[, 8] -0.08450 0.21146 -0.400 0.6896 > sad[, 9] -0.02176 0.20170 -0.108 0.9141 > sad[, 10] NA NA NA NA > --- > Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > > Residual standard error: 0.9615 on 477 degrees of freedom > Multiple R-squared: 0.02984, Adjusted R-squared: 0.01357 > F-statistic: 1.834 on 8 and 477 DF, p-value: 0.06869 > > Thanks in advance. > > -- > View this message in context: http://r.789695.n4.nabble.com/Summary-coefficients-give-NA-values-because-of-singularities-tp4162113p4162113.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Tue Dec 6 14:19:12 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 06 Dec 2011 14:19:12 +0100 Subject: [R] Plot numeric and categorical variable In-Reply-To: <1323123760.89219.YahooMailClassic@web161204.mail.bf1.yahoo.com> References: <1323123760.89219.YahooMailClassic@web161204.mail.bf1.yahoo.com> Message-ID: <4EDE1650.8090601@statistik.tu-dortmund.de> On 05.12.2011 23:22, Juliet Ndukum wrote: > My data consists of numeric (yy) and categorical (xx) variables, as shown below. >> xx = c(rep("C", 5), rep("D",5))> xx [1] "C" "C" "C" "C" "C" "D" "D" "D" "D" "D"> yy = rnorm(10, 0, 4)> yy [1] 2.7219346 -3.7142481 6.8716534 -0.9352463 0.4901249 3.8113247 [7] -2.6602041 1.7714471 4.7298233 0.8848188 >> xx1 = as.integer(as.factor(xx))> plot(xx1, yy, ylim = c(-13.5, 4), col="blue") > I have attached the plot above as plot1 > I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis (see plot1 attached). > How could I possibly go about this, let me know. Any help will be greatly appreciated. > Thanks in advance for your help,JN Sounds like homework?! Anyway, see ?par and ?axis to answer your question directly or ?boxplot more implicitly... Best, Uwe Ligges > > > > > > > > > > > > > > > ______________________________________________ > R-help at 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 code. From Thierry.ONKELINX at inbo.be Tue Dec 6 14:15:54 2011 From: Thierry.ONKELINX at inbo.be (ONKELINX, Thierry) Date: Tue, 6 Dec 2011 13:15:54 +0000 Subject: [R] Regression model when dependent variable can only take positive values In-Reply-To: References: Message-ID: Dear Michael, Did you measure newborns? If not center age to a value that makes sense in relation with the range of age in your dataset. Then the intercept will be the height at the reference age. And most likeli non-negative. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -----Oorspronkelijk bericht----- Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Namens Michael Haenlein Verzonden: dinsdag 6 december 2011 14:09 Aan: r-help at r-project.org Onderwerp: [R] Regression model when dependent variable can only take positive values Dear all, I would like to run a regression of the form lm(y ~ x1+x2) where the dependent variable y can only take positive values. Assume, for example, that y is the height of a person (measured in cm), x1 is the gender (measured as a binary indicator with 0=male and 1=female) and x2 is the age of the person (measured in years). When I run a simple lm(y ~ x1+x2), I obtain an intercept value that is negative. I interpret that in a way that a person who is male (x1=0) and just born (x2=0), has a negative height. This evidently does not make sense. I therefore assume that my estimates might be biased and that I need to use some other form of estimation that takes account of the fact that y>0 for all observations. Could anybody please tell me which type of regression would be most recommendable for this type of analysis? Thanks very much in advance, Michael [[alternative HTML version deleted]] ______________________________________________ R-help at 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 code. From sarah.goslee at gmail.com Tue Dec 6 14:27:26 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Tue, 6 Dec 2011 08:27:26 -0500 Subject: [R] frequency table? In-Reply-To: <1323139200476-4163192.post@n4.nabble.com> References: <1322990509062-4156422.post@n4.nabble.com> <1323139200476-4163192.post@n4.nabble.com> Message-ID: After that, you might consult the source code for distance() in ecodist. That function was specifically written to make it easy for people to add new dissimilarity/similarity metrics, and I think you'll find it helpful (even if you just extract the bit you need rather than expand the whole function). Sarah On Mon, Dec 5, 2011 at 9:40 PM, B77S wrote: > Set, > > This is the same post as your "Similarity Matrix" post. > > I'm not trying to be a smart ass here, but ... ?Can you fit a square peg in > a round hole?... yes, but it doesn't mean it belongs there. > > I suggest you get a piece of paper and a pencil and figure out 1) what you > are trying to do and why, and 2) how you would do that by hand. ?After you > do that, you should be able to figure this out on your own or formulate a > question to post that someone will be able to answer. ?Reading might help as > well. > > > > set wrote >> >> Hello R-users, >> >> I've got a file with individuals as colums and the clusters where they >> occur in as rows. And I wanted a table which tells me how many times each >> individual occurs with another. I don't really know how such a table is >> called...it is not a frequency table....My eventual goal is to make >> Venn-diagrams from the occurence of my individuals. >> >> So I've this: >> >> cluster ? ind1 ind2 ind3 etc. >> 1 ? ? ? ? ? ?0 ? ? ?1 ? ? 2 >> 2 ? ? ? ? ? ?3 ? ? ? 0 ? ?1 >> 3 ? ? ? ? ? ?1 ? ? ? 1 ? ? 1 >> >> And I want to go to this: >> ? ? ? ? ? ? ind1 ? ? ?ind2 ? ? ?ind3 >> ind1 ? ? ?0 ? ? ? ? ?4 ? ? ? ? ? ?2 >> ind2 ? ? ?4 ? ? ? ? ?0 ? ? ? ? ? ?4 >> ind3 ? ? ?2 ? ? ? ? ? 4 ? ? ? ? ? 1 >> >> is there a way to do this? >> Thank you for your help >> -- Sarah Goslee http://www.functionaldiversity.org From sarah.goslee at gmail.com Tue Dec 6 14:33:41 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Tue, 6 Dec 2011 08:33:41 -0500 Subject: [R] Problem with clusplot In-Reply-To: <1323151094047-4163621.post@n4.nabble.com> References: <1323151094047-4163621.post@n4.nabble.com> Message-ID: Well, if I had to guess (and I do, since we have no idea what your data look like, and calling your data matrix is a very bad idea): you have more variables than units, so clusplot() can't use princomp() to create a reduced- dimension plot. You could roll your own using a different ordination method, or you could remove some variables from your data, or you could think about whether the data you have are appropriate for what you're trying to do with them. Sarah On Tue, Dec 6, 2011 at 12:58 AM, elisacarli21 wrote: > Dear all > I'm trying to run a cluster analysis with R > Here are the commands: > > mydata <- na.omit(matrix) # listwise deletion of missing > mydata <- scale(matrix) # standardize variables > > ?fit <- kmeans(mydata, 8) # 8 cluster solution > ?# get cluster means > aggregate(mydata,by=list(fit$cluster),FUN=mean) > ?# append cluster assignment > ?mydata <- data.frame(mydata, fit$cluster) > > ?library(cluster) > clusplot(mydata, fit$cluster, color=TRUE, shade=TRUE, ?labels=2, lines=0) > > > I get the following error > Error in princomp.default(x, scores = TRUE, cor = ncol(x) != 2) : > ?'princomp' can only be used with more units than variables > > How can I fix it? > > Thanks > -- Sarah Goslee http://www.functionaldiversity.org From jverzani at gmail.com Tue Dec 6 14:34:42 2011 From: jverzani at gmail.com (j verzani) Date: Tue, 6 Dec 2011 13:34:42 +0000 Subject: [R] how to view/edit large matrix/array in R? References: Message-ID: Michael gmail.com> writes: > > head, tail and fix commands don't really work well if I have large > matrix/array for which I would like to be able to scroll up and dow, left > and right ... > > Could anybody please help me? > > Thanks > > [[alternative HTML version deleted]] > > You might look into the RGtk2Extras package and find the dfedit. You could also embed that in some custom GUI to show variables, as you want. The package requires RGtk2, and hence the Gtk libraries to be installed. The data frame editor there can gracefully handle large data sets. From sarah.goslee at gmail.com Tue Dec 6 14:35:20 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Tue, 6 Dec 2011 08:35:20 -0500 Subject: [R] Plot numeric and categorical variable In-Reply-To: <4EDE1650.8090601@statistik.tu-dortmund.de> References: <1323123760.89219.YahooMailClassic@web161204.mail.bf1.yahoo.com> <4EDE1650.8090601@statistik.tu-dortmund.de> Message-ID: Not to mention that I answered this exact question only yesterday. 2011/12/6 Uwe Ligges : > On 05.12.2011 23:22, Juliet Ndukum wrote: >> >> My data consists of numeric (yy) and categorical (xx) variables, as shown >> below. >>> >>> xx = c(rep("C", 5), rep("D",5))> ?xx [1] "C" "C" "C" "C" "C" "D" "D" "D" >>> "D" "D"> ?yy = rnorm(10, 0, 4)> ?yy [1] ?2.7219346 -3.7142481 ?6.8716534 >>> -0.9352463 ?0.4901249 ?3.8113247 [7] -2.6602041 ?1.7714471 ?4.7298233 >>> ?0.8848188 >>> xx1 = as.integer(as.factor(xx))> ?plot(xx1, yy, ylim = c(-13.5, 4), >>> col="blue") >> >> I have attached the plot above ?as plot1 >> I wish to generate a scatter plot of the data such that instead of 1 it >> prints C, and instead of 2, it prints D on the x- axis (see plot1 attached). >> How could I possibly go about this, let me know. Any help will be greatly >> appreciated. >> Thanks in advance for your help,JN > > > Sounds like homework?! > Anyway, see ?par and ?axis to answer your question directly or ?boxplot more > implicitly... > > Best, > Uwe Ligges > > > >> -- Sarah Goslee http://www.functionaldiversity.org From comtech.usa at gmail.com Tue Dec 6 15:47:31 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 08:47:31 -0600 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: <4EDE08EE.6040407@gmail.com> References: <4EDE08EE.6040407@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Tue Dec 6 15:57:21 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 09:57:21 -0500 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: References: <4EDE08EE.6040407@gmail.com> Message-ID: <4EDE2D51.6040607@gmail.com> On 06/12/2011 9:47 AM, Michael wrote: > It printed: > > c:\R\myproject1\myfile.R#38: > myfunc1 step 6,4,9 in > > What do you think? So that set a breakpoint in the copy of the function in the global environment. Are you sure you were executing the same function after you hit c? If you were working on code in a package, you may have been executing the function in the namespace of the package, not the one in the global environment. If that's not the case, then are you sure you ever got to that line? You can see where the breakpoint was set using body(myfunc1)[[c(6,4,9)]] (Watch the parens and brackets!) Duncan Murdoch > Thank you! > > On Tue, Dec 6, 2011 at 6:22 AM, Duncan Murdochwrote: > > > On 11-12-05 10:32 PM, Michael wrote: > > > >> Hi all, > >> > >> I am in the middle of debugging which is stopped using "browser()"... in > >> myfile.R at around line #25. > >> > >> I was then stuck in a big loop which I want to escape and stop the program > >> at the line after the big loop. > >> > >> In the debugging mode, I used > >> > >> Browse[2]> setBreakpoint("myfile.R#38") > >> > > > > What did it print? > > > > > > > >> I then typed "c" and "ENTER", thinking that it will continue to execute > >> until when it comes across line #38 and then stop there... > >> > >> But it didn't work - it continued the execution until the end of the > >> function, right at the line "return(results)"... > >> > >> What happened? How to solve this problem? > >> > > > > One of the complications in R is that you can have multiple copies of a > > function in memory. You may (or may not, what did it print??) have set a > > breakpoint in one copy, then run another. Or you may have edited that > > function after originally sourcing it, and lost the source reference. > > > > An alternative to using setBreakpoint is just to edit a call to browser() > > into the function. It's less convenient, but more robust. > > > > Duncan Murdoch > > > > > > Thanks a lot! > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________**________________ > >> R-help at 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 code. > >> > > > > > From chesney.alt at gmail.com Tue Dec 6 10:18:05 2011 From: chesney.alt at gmail.com (Thomas) Date: Tue, 6 Dec 2011 09:18:05 +0000 Subject: [R] Writing out in loops Message-ID: <25F43847-81F3-4231-8D4F-DE54B85E6084@gmail.com> I would like to write some data to different files. I can create the filename Day1.txt like this: filen <- paste("Day", l, ".txt", sep="") and then I'm using a For loop to write out one row of a matrix, something like this: For (j in 1:10) { cat(mat[1,j], ",", file=filen, append=TRUE) } cat("\n", file=filen, append=TRUE) but is there a better way to do this? Thank you, Thomas From jefferis at mrc-lmb.cam.ac.uk Tue Dec 6 10:20:24 2011 From: jefferis at mrc-lmb.cam.ac.uk (Dr Gregory Jefferis) Date: Tue, 6 Dec 2011 09:20:24 +0000 Subject: [R] Read Windows BMP format images Message-ID: <7DB1296C-D2B5-4B8B-825F-C53C8C66212C@mrc-lmb.cam.ac.uk> Hello, Does anyone know of an R package that can read Windows BMP format images? Many thanks, Greg Jefferis. -- Gregory Jefferis, PhD Division of Neurobiology MRC Laboratory of Molecular Biology, Hills Road, Cambridge, CB2 0QH, UK. http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2 http://flybrain.stanford.edu From Bauermartin at gmx.at Tue Dec 6 10:37:47 2011 From: Bauermartin at gmx.at (Martin Bauer) Date: Tue, 06 Dec 2011 10:37:47 +0100 Subject: [R] MAC Problem with http in R while not problem on Win machine Message-ID: <20111206093747.201670@gmx.net> Hello, thanks to (http://timelyportfolio.blogspot.com/) and also (http://systematicinvestor.wordpress.com) the following code was published and it is running smoothly on my Windows enviroment but it is failing to perform on my MAC. #get MAImp code from GIST #thanks to http://systematicinvestor.wordpress.com #for showing me how to do this con=url("https://raw.github.com/gist/1405187/92e7c24ff2459a0830c45b828f1dba41143e9436/MAImp.r") source(con) the error code is the following Error in source(con) : cannot open the connection In addition: Warning message: In source(con) : unsupported URL scheme How can I amend the code that it will also work on my MAC ? many thanks martin -- From yumik091186 at gmail.com Tue Dec 6 11:02:12 2011 From: yumik091186 at gmail.com (stat999) Date: Tue, 6 Dec 2011 02:02:12 -0800 (PST) Subject: [R] the estimated random effects for each level of grouping Message-ID: <1323165732784-4164111.post@n4.nabble.com> Hi, I am a quite beginner of random effect modelling. Sorry for my ignorant question. My question is about the values of lme function. It returns coefficients which is a list with two components. The R-help file says that it returns the estimated random effects for each level of grouping. What is the estimator of this random effects in R? Since the random effects are random variables so this "estimate" should be something like mean or mode of the density of the random effect given data, f_i(b_i|y_i).... -- View this message in context: http://r.789695.n4.nabble.com/the-estimated-random-effects-for-each-level-of-grouping-tp4164111p4164111.html Sent from the R help mailing list archive at Nabble.com. From r.kozarski at gmail.com Tue Dec 6 11:38:43 2011 From: r.kozarski at gmail.com (threshold) Date: Tue, 6 Dec 2011 02:38:43 -0800 (PST) Subject: [R] split date nad time Message-ID: <1323167923173-4164191.post@n4.nabble.com> Dear R Users, given that: > AggDateTime[960:962] [1] "2011-08-25 23:59:00 BST" "2011-08-26 00:00:00 BST" [3] "2011-08-26 00:01:00 BST" > unlist(strsplit(as.character(AggDateTime[960])," ", fixed=TRUE)) [1] "2011-08-25" "23:59:00" > unlist(strsplit(as.character(AggDateTime[962])," ", fixed=TRUE)) [1] "2011-08-26" "00:01:00" Why no time here? > unlist(strsplit(as.character(AggDateTime[961])," ", fixed=TRUE)) [1] "2011-08-26" best, robert -- View this message in context: http://r.789695.n4.nabble.com/split-date-nad-time-tp4164191p4164191.html Sent from the R help mailing list archive at Nabble.com. From vioravis at gmail.com Tue Dec 6 12:52:56 2011 From: vioravis at gmail.com (vioravis) Date: Tue, 6 Dec 2011 03:52:56 -0800 (PST) Subject: [R] HTML Forms to R Message-ID: <1323172376189-4164360.post@n4.nabble.com> I have currently a R function that reads a csv file, does some computations, produces some plots and writes a csv file as output. I would like to use HTML forms to make a user interface for calling appropriate parts of the functions (reading csv file, doing computations, displaying plots and writing csv files). Are there are tutorials available that would help me get started?? Thank you. Ravi -- View this message in context: http://r.789695.n4.nabble.com/HTML-Forms-to-R-tp4164360p4164360.html Sent from the R help mailing list archive at Nabble.com. From surfprjab at hotmail.com Tue Dec 6 13:21:02 2011 From: surfprjab at hotmail.com (jose Bartolomei) Date: Tue, 6 Dec 2011 12:21:02 +0000 Subject: [R] LaTeX output for summary.lm object - while displaying the information outside the table In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From h_a_patience at hotmail.com Tue Dec 6 14:17:00 2011 From: h_a_patience at hotmail.com (Bazman76) Date: Tue, 6 Dec 2011 05:17:00 -0800 (PST) Subject: [R] a question on autocorrelation acf In-Reply-To: References: <4BDA115C.9040504@gmail.com> <1323113081359-4161818.post@n4.nabble.com> <1323135157369-4163021.post@n4.nabble.com> Message-ID: <1323177420061-4164630.post@n4.nabble.com> http://r.789695.n4.nabble.com/file/n4164630/R_example.xlsx R_example.xlsx Hi there, I attach an excel file which I use to produce the data. It simulates a simple AR(1) process y_t=0.5y_{t-1}+z_t. In column E I have cut and paste values so that we can compare like with like. When I run the acf() on these values, it shows 3 significant lags. When I run the pacf() it shows one very strong correlation of 0.3 at lag 1, and a smaller one at lag 2 of around 0.05. Now according to the theory the pacf() results should give the correct exponents for the lags. This is a pure AR(1) process so the results should be 0.5 on lag 1 and statistically insignificant else where? I have tried if for several realisations of the white noise term and the results are qualatively similar and is disagreement with the theory. Kind Regards Baz -- View this message in context: http://r.789695.n4.nabble.com/a-question-on-autocorrelation-acf-tp2076280p4164630.html Sent from the R help mailing list archive at Nabble.com. From pls at mevik.net Tue Dec 6 15:21:11 2011 From: pls at mevik.net (=?utf-8?Q?Bj=C3=B8rn-Helge_Mevik?=) Date: Tue, 6 Dec 2011 15:21:11 +0100 Subject: [R] [R-pkgs] pls 2.3.0 released Message-ID: Version 2.3.0 of the pls package has been released. The pls package implements Partial Least Squares Regression and Principal Component Regression. The major changes are: - New analysis method Canonical Powered PLS (CPPLS) implmemented. See ?cppls.fit. - coefplot() can now plot whiskers at +/-1 SE (since 2.2.0). See ?coefplot - The package now has a name space (since 2.2.0). -- Regards, Bj?rn-Helge Mevik _______________________________________________ R-packages mailing list R-packages at r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages From sarah.goslee at gmail.com Tue Dec 6 16:07:23 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Tue, 6 Dec 2011 10:07:23 -0500 Subject: [R] Writing out in loops In-Reply-To: <25F43847-81F3-4231-8D4F-DE54B85E6084@gmail.com> References: <25F43847-81F3-4231-8D4F-DE54B85E6084@gmail.com> Message-ID: Is there some reason you can't create the entire file in R and then write it out in a single step? It looks like you're writing out mat[1, 1:10] so you could just use write.table(mat[1, 1:10], filen) Can you expand on what you're trying to do? Sarah On Tue, Dec 6, 2011 at 4:18 AM, Thomas wrote: > I would like to write some data to different files. I can create the > filename Day1.txt like this: > > filen <- paste("Day", l, ".txt", sep="") > > and then I'm using a For loop to write out one row of a matrix, something > like this: > > For (j in 1:10) > { > cat(mat[1,j], ",", file=filen, append=TRUE) > } > cat("\n", file=filen, append=TRUE) > > but is there a better way to do this? > > Thank you, > > Thomas > -- Sarah Goslee http://www.functionaldiversity.org From JRadinger at gmx.at Tue Dec 6 16:15:21 2011 From: JRadinger at gmx.at (Johannes Radinger) Date: Tue, 06 Dec 2011 16:15:21 +0100 Subject: [R] Argument validation within functions In-Reply-To: References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> Message-ID: <20111206151521.286940@gmx.net> Thank you, i didn't know that the !operator is also working for is.numeric etc. Anyway I want to test if an argument is set in the function call and if not a code is executed... So far I tried: f <-function(a,b){ if(!exists("b")) print("exists: b is not set") if(is.null("b")) print("is.null : b is not set") } f(a=1,b=2) f(a=1) f(b=2) I don't really know how to do it...e.g: for f(a=1) b is not set so it also can't be NULL (thats why is.null is not working). I just want to "test" if it is set with the function call not outside the function or before etc. /Johannes -------- Original-Nachricht -------- > Datum: Tue, 6 Dec 2011 07:57:44 -0500 > Von: "R. Michael Weylandt" > An: r-help , Johannes Radinger > Betreff: Re: [R] Argument validation within functions > Use the ! (not) operator. > > Not sure what you mean by " as the stop() stops the total function": > try the following > > f <- function(a){ > ? ?stopifnot(a > 3) > ? ?return(a^2) > } > > f(2) > f(4) > > Michael > > (PS -- It's usually asked to cc the list so that this all gets > threaded properly in folks' mailboxes) > > On Tue, Dec 6, 2011 at 7:46 AM, Johannes Radinger > wrote: > > Hi, > > > > thank you... I think I will go for the if-stop approach > > as the stop() stops the total function... So there is just > > one little other question: What is the opposite of is.numeric? > > Is ther isnot.numeric? How ?can that be implemented in following > > function: > > > > f <- function(a){ > > ? ? ? ?if(is.numeric(a)) stop("a is not numeric") > > ? ? ? ?if(0 > a && a > 1) stop("a must be a value between 0 and 1") > > ? ? ? ?a > > } > > > > /Johannes > > > > -------- Original-Nachricht -------- > >> Datum: Tue, 6 Dec 2011 07:04:59 -0500 > >> Von: "R. Michael Weylandt" > >> An: Johannes Radinger > >> CC: r-help at r-project.org > >> Betreff: Re: [R] Argument validation within functions > > > >> The quick and dirty way to do so is to use: stopifnot() in conjunction > >> (if necessary with all() and any()). You can replace that first > >> condition with a simple is.numeric() as well. A more helpful way (if > >> this is production code) is to use if statement with the stop() > >> function directly which lets you provide specific error messages. > >> > >> Michael > >> > >> On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger > >> wrote: > >> > Hi, > >> > > >> > I just started with writing functions in R and so some questions > popped > >> up. > >> > I provide some values as argument to my function such as: > >> > > >> > function(a,b,c){} > >> > > >> > Now i want that the function first checks if the arguments are valid > for > >> the function. E.g argument "a" has to be a number in the range 0-1. How > >> can that easily done? > >> > > >> > So far I have: > >> > > >> > ? ? ? ?a <- as.numeric(a) > >> > ? ? ? ?if(0 <= a && a <= 1) > >> > > >> > to first check if a is a number...if not the function stops and gives > an > >> error message. If it is a number it just continues... > >> > > >> > But how to check the range? > >> > Above there is the if-approach but then the rest of the function is > >> exectued as part of if (or else). Is there a simpler way without having > the > >> if-brackets around the remaining code? > >> > Just a check if the value is between 0 and 1 and if yes continue with > >> the next line if no abort the function with a error message? How can > such an > >> error message be created? > >> > > >> > thank you and best regards, > >> > > >> > /Johannes > >> > -- > >> > > >> > ______________________________________________ > >> > R-help at 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 code. > > > > -- > > NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! > > Jetzt informieren: http://www.gmx.net/de/go/freephone -- From pomchip at free.fr Tue Dec 6 16:15:13 2011 From: pomchip at free.fr (=?ISO-8859-1?Q?S=E9bastien_Bihorel?=) Date: Tue, 6 Dec 2011 10:15:13 -0500 Subject: [R] How to automate the detection of break points for use in cut In-Reply-To: References: <4EDE0A85.7070904@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From Berwin.Turlach at gmail.com Tue Dec 6 16:36:46 2011 From: Berwin.Turlach at gmail.com (Berwin A Turlach) Date: Tue, 6 Dec 2011 23:36:46 +0800 Subject: [R] Argument validation within functions In-Reply-To: <20111206151521.286940@gmx.net> References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> <20111206151521.286940@gmx.net> Message-ID: <20111206233646.1fdebd37@absentia> G'day Johannes, On Tue, 06 Dec 2011 16:15:21 +0100 "Johannes Radinger" wrote: > Thank you, i didn't know that the !operator is > also working for is.numeric etc. > > Anyway I want to test if an argument is set in the > function call and if not a code is executed... So > far I tried: > > f <-function(a,b){ > if(!exists("b")) print("exists: b is not set") > if(is.null("b")) print("is.null : b is not set") > } > > f(a=1,b=2) > f(a=1) > f(b=2) > > I don't really know how to do it...e.g: for f(a=1) b is not set > so it also can't be NULL (thats why is.null is not working). I > just want to "test" if it is set with the function call not outside > the function or before etc. ?missing Cheers, Berwin ========================== Full address ============================ A/Prof Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Maths and Stats (M019) +61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 Stirling Highway Crawley WA 6009 e-mail: Berwin.Turlach at gmail.com Australia http://www.maths.uwa.edu.au/~berwin From enricoschumann at yahoo.de Tue Dec 6 16:39:44 2011 From: enricoschumann at yahoo.de (Enrico Schumann) Date: Tue, 06 Dec 2011 16:39:44 +0100 Subject: [R] Argument validation within functions In-Reply-To: <20111206151521.286940@gmx.net> References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> <20111206151521.286940@gmx.net> Message-ID: <4EDE3740.3090609@yahoo.de> you may be looking for ?missing f <- function(a,b) { if (missing(b)) print("b is missing") } f(a=1, b=2) f(a=1) f(b=2) Regards, Enrico Am 06.12.2011 16:15, schrieb Johannes Radinger: > Thank you, i didn't know that the !operator is > also working for is.numeric etc. > > Anyway I want to test if an argument is set in the > function call and if not a code is executed... So > far I tried: > > f<-function(a,b){ > if(!exists("b")) print("exists: b is not set") > if(is.null("b")) print("is.null : b is not set") > } > > f(a=1,b=2) > f(a=1) > f(b=2) > > I don't really know how to do it...e.g: for f(a=1) b is not set > so it also can't be NULL (thats why is.null is not working). I > just want to "test" if it is set with the function call not outside > the function or before etc. > > /Johannes > > -------- Original-Nachricht -------- >> Datum: Tue, 6 Dec 2011 07:57:44 -0500 >> Von: "R. Michael Weylandt" >> An: r-help, Johannes Radinger >> Betreff: Re: [R] Argument validation within functions > >> Use the ! (not) operator. >> >> Not sure what you mean by " as the stop() stops the total function": >> try the following >> >> f<- function(a){ >> stopifnot(a> 3) >> return(a^2) >> } >> >> f(2) >> f(4) >> >> Michael >> >> (PS -- It's usually asked to cc the list so that this all gets >> threaded properly in folks' mailboxes) >> >> On Tue, Dec 6, 2011 at 7:46 AM, Johannes Radinger >> wrote: >>> Hi, >>> >>> thank you... I think I will go for the if-stop approach >>> as the stop() stops the total function... So there is just >>> one little other question: What is the opposite of is.numeric? >>> Is ther isnot.numeric? How can that be implemented in following >>> function: >>> >>> f<- function(a){ >>> if(is.numeric(a)) stop("a is not numeric") >>> if(0> a&& a> 1) stop("a must be a value between 0 and 1") >>> a >>> } >>> >>> /Johannes >>> >>> -------- Original-Nachricht -------- >>>> Datum: Tue, 6 Dec 2011 07:04:59 -0500 >>>> Von: "R. Michael Weylandt" >>>> An: Johannes Radinger >>>> CC: r-help at r-project.org >>>> Betreff: Re: [R] Argument validation within functions >>> >>>> The quick and dirty way to do so is to use: stopifnot() in conjunction >>>> (if necessary with all() and any()). You can replace that first >>>> condition with a simple is.numeric() as well. A more helpful way (if >>>> this is production code) is to use if statement with the stop() >>>> function directly which lets you provide specific error messages. >>>> >>>> Michael >>>> >>>> On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger >>>> wrote: >>>>> Hi, >>>>> >>>>> I just started with writing functions in R and so some questions >> popped >>>> up. >>>>> I provide some values as argument to my function such as: >>>>> >>>>> function(a,b,c){} >>>>> >>>>> Now i want that the function first checks if the arguments are valid >> for >>>> the function. E.g argument "a" has to be a number in the range 0-1. How >>>> can that easily done? >>>>> >>>>> So far I have: >>>>> >>>>> a<- as.numeric(a) >>>>> if(0<= a&& a<= 1) >>>>> >>>>> to first check if a is a number...if not the function stops and gives >> an >>>> error message. If it is a number it just continues... >>>>> >>>>> But how to check the range? >>>>> Above there is the if-approach but then the rest of the function is >>>> exectued as part of if (or else). Is there a simpler way without having >> the >>>> if-brackets around the remaining code? >>>>> Just a check if the value is between 0 and 1 and if yes continue with >>>> the next line if no abort the function with a error message? How can >> such an >>>> error message be created? >>>>> >>>>> thank you and best regards, >>>>> >>>>> /Johannes >>>>> -- >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>> >>> -- >>> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! >>> Jetzt informieren: http://www.gmx.net/de/go/freephone > > -- > > ______________________________________________ > R-help at 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 code. -- Enrico Schumann Lucerne, Switzerland http://nmof.net/ From gyanendra.pokharel at gmail.com Tue Dec 6 16:40:29 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Tue, 6 Dec 2011 10:40:29 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gunter.berton at gene.com Tue Dec 6 17:05:37 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Tue, 6 Dec 2011 08:05:37 -0800 Subject: [R] Argument validation within functions In-Reply-To: <20111206151521.286940@gmx.net> References: <20111206114145.143490@gmx.net> <20111206124614.162280@gmx.net> <20111206151521.286940@gmx.net> Message-ID: On Tue, Dec 6, 2011 at 7:15 AM, Johannes Radinger wrote: > Thank you, i didn't know that the !operator is > also working for is.numeric etc. Read (more carefully?) R docs, please. ! is a unary function that takes a logical argument(and will coerce to logical nonlogical arguments if it can); is.numeric() returns a logical, so of course it should "work". Ergo your failure to understand indicates a fundamental hole in your understanding of how R works. -- Bert > > Anyway I want to test if an argument is set in the > function call and if not a code is executed... So > far I tried: > > f <-function(a,b){ > ? ? ? ?if(!exists("b")) print("exists: b is not set") > ? ? ? ?if(is.null("b")) print("is.null : b is not set") > } > > f(a=1,b=2) > f(a=1) > f(b=2) > > I don't really know how to do it...e.g: for f(a=1) b is not set > so it also can't be NULL (thats why is.null is not working). I > just want to "test" if it is set with the function call not outside > the function or before etc. > > /Johannes > > -------- Original-Nachricht -------- >> Datum: Tue, 6 Dec 2011 07:57:44 -0500 >> Von: "R. Michael Weylandt" >> An: r-help , Johannes Radinger >> Betreff: Re: [R] Argument validation within functions > >> Use the ! (not) operator. >> >> Not sure what you mean by " as the stop() stops the total function": >> try the following >> >> f <- function(a){ >> ? ?stopifnot(a > 3) >> ? ?return(a^2) >> } >> >> f(2) >> f(4) >> >> Michael >> >> (PS -- It's usually asked to cc the list so that this all gets >> threaded properly in folks' mailboxes) >> >> On Tue, Dec 6, 2011 at 7:46 AM, Johannes Radinger >> wrote: >> > Hi, >> > >> > thank you... I think I will go for the if-stop approach >> > as the stop() stops the total function... So there is just >> > one little other question: What is the opposite of is.numeric? >> > Is ther isnot.numeric? How ?can that be implemented in following >> > function: >> > >> > f <- function(a){ >> > ? ? ? ?if(is.numeric(a)) stop("a is not numeric") >> > ? ? ? ?if(0 > a && a > 1) stop("a must be a value between 0 and 1") >> > ? ? ? ?a >> > } >> > >> > /Johannes >> > >> > -------- Original-Nachricht -------- >> >> Datum: Tue, 6 Dec 2011 07:04:59 -0500 >> >> Von: "R. Michael Weylandt" >> >> An: Johannes Radinger >> >> CC: r-help at r-project.org >> >> Betreff: Re: [R] Argument validation within functions >> > >> >> The quick and dirty way to do so is to use: stopifnot() in conjunction >> >> (if necessary with all() and any()). You can replace that first >> >> condition with a simple is.numeric() as well. A more helpful way (if >> >> this is production code) is to use if statement with the stop() >> >> function directly which lets you provide specific error messages. >> >> >> >> Michael >> >> >> >> On Tue, Dec 6, 2011 at 6:41 AM, Johannes Radinger >> >> wrote: >> >> > Hi, >> >> > >> >> > I just started with writing functions in R and so some questions >> popped >> >> up. >> >> > I provide some values as argument to my function such as: >> >> > >> >> > function(a,b,c){} >> >> > >> >> > Now i want that the function first checks if the arguments are valid >> for >> >> the function. E.g argument "a" has to be a number in the range 0-1. How >> >> can that easily done? >> >> > >> >> > So far I have: >> >> > >> >> > ? ? ? ?a <- as.numeric(a) >> >> > ? ? ? ?if(0 <= a && a <= 1) >> >> > >> >> > to first check if a is a number...if not the function stops and gives >> an >> >> error message. If it is a number it just continues... >> >> > >> >> > But how to check the range? >> >> > Above there is the if-approach but then the rest of the function is >> >> exectued as part of if (or else). Is there a simpler way without having >> the >> >> if-brackets around the remaining code? >> >> > Just a check if the value is between 0 and 1 and if yes continue with >> >> the next line if no abort the function with a error message? How can >> such an >> >> error message be created? >> >> > >> >> > thank you and best regards, >> >> > >> >> > /Johannes >> >> > -- >> >> > >> >> > ______________________________________________ >> >> > R-help at 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 code. >> > >> > -- >> > NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur?ck-Garantie! >> > Jetzt informieren: http://www.gmx.net/de/go/freephone > > -- > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From ofwagner at gmail.com Tue Dec 6 16:28:52 2011 From: ofwagner at gmail.com (Otto F. Wagner) Date: Tue, 6 Dec 2011 16:28:52 +0100 Subject: [R] About summary in linear models Message-ID: An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: From comtech.usa at gmail.com Tue Dec 6 17:11:21 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 10:11:21 -0600 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: <4EDE2D51.6040607@gmail.com> References: <4EDE08EE.6040407@gmail.com> <4EDE2D51.6040607@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dwinsemius at comcast.net Tue Dec 6 17:12:32 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Tue, 6 Dec 2011 11:12:32 -0500 Subject: [R] split date nad time In-Reply-To: <1323167923173-4164191.post@n4.nabble.com> References: <1323167923173-4164191.post@n4.nabble.com> Message-ID: <310852B4-4BD9-4F3D-B13B-D173A77A7AA9@comcast.net> On Dec 6, 2011, at 5:38 AM, threshold wrote: > Dear R Users, > > given that: > >> AggDateTime[960:962] > [1] "2011-08-25 23:59:00 BST" "2011-08-26 00:00:00 BST" > [3] "2011-08-26 00:01:00 BST" > > >> unlist(strsplit(as.character(AggDateTime[960])," ", fixed=TRUE)) > [1] "2011-08-25" "23:59:00" >> unlist(strsplit(as.character(AggDateTime[962])," ", fixed=TRUE)) > [1] "2011-08-26" "00:01:00" > > Why no time here? >> unlist(strsplit(as.character(AggDateTime[961])," ", fixed=TRUE)) > [1] "2011-08-26" The real question should be: why you didn't post the results of : dput(AggDateTime[960:962]) -- David Winsemius, MD West Hartford, CT From e.rapsomaniki at ucl.ac.uk Tue Dec 6 17:06:45 2011 From: e.rapsomaniki at ucl.ac.uk (Eleni Rapsomaniki) Date: Tue, 6 Dec 2011 16:06:45 -0000 Subject: [R] mfp package - can I exclude some powers? Message-ID: <78b6ff2618301e74c1715c3e9a599865.squirrel@www.squirrelmail.ucl.ac.uk> Hi, The mfp package suggests fractional polynomial transformations for non-linear predictors. For continuous variables that take negative values the suggested transformations tend to look ugly, e.g. if x1 is the original variable it is transformed to something like: (x1+5.67)^1 * log(x1+5.67), where 5.67 is the shift to make it positive. Can I somehow modify the mfp function to exclude some powers among those tried (e.g. those involving log and 0.5). I am willing to sacrifice some precision for a more interpretable transformation. Or is there another package to do something similar? Any suggestions very much appreciated! Eleni Medical Statistician Epidemiology & Public Health University College London, UK From alexandre.chausson at unil.ch Tue Dec 6 17:35:26 2011 From: alexandre.chausson at unil.ch (AlexC) Date: Tue, 6 Dec 2011 08:35:26 -0800 (PST) Subject: [R] axis thickness in plot() Message-ID: <1323189326756-4165430.post@n4.nabble.com> Hello, I am trying to increase the thickness of the axis in plot() without reverting to the use of paint programs i see posts on that topic for the xyplot function but want to see if i can do it with plot() because i've already setup my graph script using that i thought i could use axis() function and specify lwd="thickness" or lwd.axis= but that does not work like it does for lwd.ticks If anyone has an idea, sincerely heres the script windows(width=7,height=7) plot(data$Winter,data$NbFirstBroods,ylab="number of breeding pairs",xlab="winter harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE) points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19) abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4) i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example also when adding the y axis axis(2...) x and y axes are disconnected Thank you for your kind help in advance, Alexandre -- View this message in context: http://r.789695.n4.nabble.com/axis-thickness-in-plot-tp4165430p4165430.html Sent from the R help mailing list archive at Nabble.com. From r.kozarski at gmail.com Tue Dec 6 17:23:34 2011 From: r.kozarski at gmail.com (threshold) Date: Tue, 6 Dec 2011 08:23:34 -0800 (PST) Subject: [R] split date nad time In-Reply-To: <310852B4-4BD9-4F3D-B13B-D173A77A7AA9@comcast.net> References: <1323167923173-4164191.post@n4.nabble.com> <310852B4-4BD9-4F3D-B13B-D173A77A7AA9@comcast.net> Message-ID: <1323188614142-4165378.post@n4.nabble.com> ok, > dput(AggDateTime[960:962]) structure(c(1314313140L, 1314313200L, 1314313260L), class = c("POSIXct", "POSIXt"), tzone = "") -- View this message in context: http://r.789695.n4.nabble.com/split-date-nad-time-tp4164191p4165378.html Sent from the R help mailing list archive at Nabble.com. From searl at vt.edu Tue Dec 6 17:43:52 2011 From: searl at vt.edu (Steve E.) Date: Tue, 6 Dec 2011 08:43:52 -0800 (PST) Subject: [R] help wrapping findInterval into a function Message-ID: <1323189832120-4165464.post@n4.nabble.com> Dear R Community, I hope you might be able to assist with a small problem creating a function. I am working with water-quality data sets that contain the concentration of many different elements in water samples. I need to assign quality-control flags to values that fall into various concentration ranges. Rather than a web of nested if statements, I am employing the findInterval function to identify values that need to be flagged and to assign the appropriate flag. The data consist of a sample identifier, the analysis, and corresponding value. The findInterval function works well; however, I would like to incorporate it into a function so that I can run multiple findInterval functions for many different water-quality analyses (and I have to do this for many dataset) but it seems to fall apart when incorporated into a function. Run straighforward, the findInterval function works as desired, e.g. below, creating the new CalciumFlag column with the appropriate flag for, in this case, levels of calcium in the water: WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", (flags <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) However, it does not worked when wrapped in a function (no error messages are thrown, it simply does not seem to do anything): WQfunc <- function() { WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", (flags <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) } Calling the function WQfunc() does not produce an error but also does not produce the expected CalciumFlag, it seems to not do anything. Ultimately, what I need to get to is something like below where multiple findInterval functions for different analyses are included in a single function, then I can concatenate the results into a single column containing all flags for all analyses, e.g.: WQfunc <- function() { WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", (flags <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) WQdata$SodiumFlag <- with(WQdata, ifelse(analysis == "Sodium", (flags <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.050, 0.125, 125, Inf))]),"")) WQdata$MagnesiumFlag <- with(WQdata, ifelse(analysis == "Magnesium", (flags <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.065, 0.15, 75, Inf))]),"")) .....etc for additional water-quality analyses... } As an aside, I started working with the findInterval tool from an example that I found online but am not clear as to how the multi-component configuration incorporating brackets actually works, can anyone suggest a good resource that explains this? I thank you very much for any assistance you may be able to provide. Regards, Steve -- View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4165464.html Sent from the R help mailing list archive at Nabble.com. From frainj at gmail.com Tue Dec 6 17:55:04 2011 From: frainj at gmail.com (John C Frain) Date: Tue, 6 Dec 2011 16:55:04 +0000 Subject: [R] About summary in linear models In-Reply-To: References: Message-ID: Your email has become a bit distorted during transmission. If you have used the summary command you should be getting some more summary statistics. The lm function in R returns an object of class "lm" which is a list containing at least the components listed in the help files for lm. The objects in the list are used to produce the summary statistics. If you are doing more elaborate work this approach (like the use of internal functions in gretl) is very convenient. Best Regards John On 6 December 2011 15:28, Otto F. Wagner wrote: > Hello!!, for linear models fit I use Gretl, but now I'm starting to use R, > I would like to know if is there some function to obtain a extended summary > like in Gretl. > > I will write a example in Gretl > > > Modelo 1: MCO, usando las observaciones 1968-1982 (T = 15) > > Variable dependiente: Invest > > > Coeficient > > St error > > t-ratio > > p-value > > > > const > > 377,631 > > 35,0955 > > 10,7601 > > <0,00001 > > *** > > GNP > > 0,63612 > > 0,055015 > > 11,5627 > > <0,00001 > > *** > > CPI > > -9,70228 > > 0,913737 > > -10,6182 > > <0,00001 > > *** > > Interest > > -0,941363 > > 2,21077 > > -0,4258 > > 0,67927 > > > > time > > 8,49182 > > 3,18142 > > 2,6692 > > 0,02353 > > ** > > > > Average of Dep Var. > > ?276,0067 > > > St Error Dep. Var > > ?117,5827 > > Squared Sum of remainders > > ?818,6362 > > > > Regression standar error > > ?9,047852 > > R^2 > > ?0,995771 > > > > R^2 adj > > ?0,994079 > > F(4, 10) > > ?588,6040 > > > > p-value (de F) > > ?8,09e-12 > > Log-likelihood > > -51,28100 > > > > Akaike > > ?112,5620 > > Schwarz > > ?116,1023 > > > > Hannan-Quinn > > ?112,5243 > > rho > > -0,440663 > > > > Durbin-Watson > > ?2,757428 > > > Like you can see Gretl shows more statisticas. > > The same model in R: > > Call: > lm(formula = Invest ~ CPI + GNP + Interest + Year, data = Tabla6_3) > > Residuals: > ? ?Min ? ? ?1Q ?Median ? ? ?3Q ? ? Max > -16.397 ?-3.864 ? 1.391 ? 4.219 ?15.779 > > Coefficients: > ? ? ? ? ? ? ?Estimate Std. Error t value Pr(>|t|) > (Intercept) -1.633e+04 ?6.250e+03 ?-2.612 ? 0.0260 * > CPI ? ? ? ? -9.702e+00 ?9.137e-01 -10.618 9.15e-07 *** > GNP ? ? ? ? ?6.361e-01 ?5.502e-02 ?11.563 4.14e-07 *** > Interest ? ?-9.414e-01 ?2.211e+00 ?-0.426 ? 0.6793 > Year ? ? ? ? 8.492e+00 ?3.181e+00 ? 2.669 ? 0.0235 * > --- > Signif. codes: ?0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > Thanks so much, > > Otto > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- John C Frain Economics Department Trinity College Dublin Dublin 2 Ireland www.tcd.ie/Economics/staff/frainj/home.html mailto:frainj at tcd.ie mailto:frainj at gmail.com From comtech.usa at gmail.com Tue Dec 6 18:06:00 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 11:06:00 -0600 Subject: [R] help! "browser()" does not get stopped... Message-ID: It's weird! I am sure that I have inserted "browser()" in a sub-routine where I wanted to stop and debug... But when I start running the main function from the separate main file, it doesn't stop within the target sub-routine at all. Please help me! Thanks! From ligges at statistik.tu-dortmund.de Tue Dec 6 18:12:31 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 6 Dec 2011 18:12:31 +0100 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: References: Message-ID: <4EDE4CFF.3000601@statistik.tu-dortmund.de> On 06.12.2011 18:06, Michael wrote: > It's weird! > > I am sure that I have inserted "browser()" in a sub-routine where I > wanted to stop and debug... > > But when I start running the main function from the separate main file, > > it doesn't stop within the target sub-routine at all. Probably you are using some package and call the "subroutine" within the NAMESPACE of the package rather than the one in .GlobalEnv. Uwe Ligges > Please help me! > > Thanks! > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Tue Dec 6 18:31:56 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 6 Dec 2011 18:31:56 +0100 Subject: [R] Can't load package 'lars' In-Reply-To: References: <4EDD7EDE.6090809@mail.mcgill.ca>, <4EDE1226.1010708@statistik.tu-dortmund.de> Message-ID: <4EDE518C.1010808@statistik.tu-dortmund.de> On 06.12.2011 18:27, Luc Villandre wrote: > Hello, > > I do think so. > > ### > [villandre at stat04 lars]$ pwd > /home/villandre/R/x86_64-redhat-linux-gnu-library/2.11/lars > [villandre at stat04 lars]$ ls > data DESCRIPTION help html INDEX libs Meta NAMESPACE R > ### > > I re-installed it and I still get the same error message. > > #### > >> install.packages("lars", lib = "~/R/x86_64-redhat-linux-gnu-library/2.11") > > trying URL 'http://software.rc.fas.harvard.edu/mirrors/R/src/contrib/lars_0.9-8.tar.gz' > Content type 'application/x-gzip' length 172011 bytes (167 Kb) > opened URL > ================================================== > downloaded 167 Kb > > * installing *source* package ?lars? ... > ** libs > gfortran -m64 -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c delcol.f -o delcol.o > gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o lars.so delcol.o -lgfortran -lm -L/usr/lib64/R/lib -lR > installing to /mnt/prism/s20/villandre/R/x86_64-redhat-linux-gnu-library/2.11/lars/libs > ** R > ** data > ** preparing package for lazy loading > ** help > *** installing help indices > converting help for package ?lars? > finding HTML links ... done > cv.lars html > diabetes html > lars-internal html > lars html > plot.lars html > predict.lars html > summary.lars html > ** building package indices ... > ** testing if installed package can be loaded > Loaded lars 0.9-8 > > * DONE (lars) > > The downloaded packages are in > ?/tmp/RtmphxCj4j/downloaded_packages? >> library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") > Error : .onLoad failed in loadNamespace() for 'lars', details: > call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], > error: subscript out of bounds I haven't looked closely enough before: The culprit is in lars which has: cat("Loaded lars", utils::installed.packages()["lars", "Version"], and hence only looks at the default search path to report its version while you supplied a different one. Thus, it is a bug in the package you should report to its maintainer. I the meantime as a workaround (and maybe more convenient anyway): set the location of your library using .libPaths() before loading the package. Uwe Ligges > Error: package/namespace load failed for ?lars? > #### > > It is the first time I get such an error message when trying to load a package. It would seem that the problem is with > > ### > cat("Loaded lars", utils::installed.packages()["lars", "Version"] > ### > > Is there a way to circumvent this problem (e.g. attribute an arbitrary value to utils::installed.packages()["lars", "Version"])? > > Thanks for your help, > > Luc > ________________________________________ > From: Uwe Ligges [ligges at statistik.tu-dortmund.de] > Sent: Tuesday, December 06, 2011 8:01 AM > To: Luc Villandre > Cc: r-help > Subject: Re: [R] Can't load package 'lars' > > On 06.12.2011 03:33, Luc Villandre wrote: >> Hi, >> >> I installed package 'lars' earlier tonight and did not get any sort of >> error message. >> >> ### >> ** building package indices ... >> ** testing if installed package can be loaded >> Loaded lars 0.9-8 >> >> * DONE (lars) >> ### >> >> However, when I try to load it, I get >> ### >> > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") > > Are you sure it is installed at the location you specified? > > Uwe Ligges > > > >> Error : .onLoad failed in loadNamespace() for 'lars', details: >> call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], >> error: subscript out of bounds >> Error: package/namespace load failed for ?lars? >> ### >> >> Session info: >> >> ### >> > sessionInfo() >> R version 2.14.0 (2011-10-31) >> Platform: x86_64-redhat-linux-gnu (64-bit) >> >> locale: >> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 >> [7] LC_PAPER=C LC_NAME=C >> [9] LC_ADDRESS=C LC_TELEPHONE=C >> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> loaded via a namespace (and not attached): >> [1] rpart_3.1-50 tools_2.14.0 >> ### >> >> I get the same error message when I try to load it on another machine: >> >> ### >> >> > library("lars",lib.loc = "~/R/i686-pc-linux-gnu-library/2.12") >> Error : .onLoad failed in loadNamespace() for 'lars', details: >> call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], >> error: subscript out of bounds >> Error: package/namespace load failed for 'lars' >> ### >> >> Session info: >> >> ### >> > sessionInfo() >> R version 2.13.1 (2011-07-08) >> Platform: i686-pc-linux-gnu (32-bit) >> >> locale: >> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 >> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C >> [9] LC_ADDRESS=C LC_TELEPHONE=C >> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> loaded via a namespace (and not attached): >> [1] tools_2.13.1 >> ### >> >> Is there at least a way to circumvent the problem? >> >> Thank you for your help, >> >> Luc Villandre >> >> ______________________________________________ >> R-help at 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 code. From murdoch.duncan at gmail.com Tue Dec 6 18:39:28 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 12:39:28 -0500 Subject: [R] help! what's wrong with setBreakpoint In-Reply-To: References: <4EDE08EE.6040407@gmail.com> <4EDE2D51.6040607@gmail.com> Message-ID: <4EDE5350.4000504@gmail.com> On 06/12/2011 11:11 AM, Michael wrote: > I am not sure... > > How do I make sure about that? > > esp " Are you sure you were executing the same function after you hit c?"? From a later one of your messages (adding a call to browser() didn't do anything), I think you weren't. Now you know how to check. Debugging code in packages can be tricky. There are several strategies that I've used in different circumstances: 1. source() the original source files from the command line. Then you're not in a namespace, so you don't have that to confuse you. (But if you don't source everything, you may find the source'd functions can't see the ones you skipped.) 2. Set the environment variable R_KEEP_PKG_SOURCE to yes, then install the package; do all my debugging via things like setBreakpoint("srcfile.R#30", env=somefunction) where somefunction is in the package being debugged. You can't make permanent changes to the functions this way, but you can add debugging code in the setBreakpoint call. 3. Edit the source and re-install the package. This is a bit of a pain, but it's the best way to reproduce the real execution environment. Duncan Murdoch > Thanks again! > > On Tue, Dec 6, 2011 at 8:57 AM, Duncan Murdochwrote: > > > On 06/12/2011 9:47 AM, Michael wrote: > > > >> It printed: > >> > >> c:\R\myproject1\myfile.R#38: > >> myfunc1 step 6,4,9 in > >> > >> What do you think? > >> > > > > So that set a breakpoint in the copy of the function in the global > > environment. Are you sure you were executing the same function after you > > hit c? If you were working on code in a package, you may have been > > executing the function in the namespace of the package, not the one in the > > global environment. > > > > If that's not the case, then are you sure you ever got to that line? You > > can see where the breakpoint was set using > > > > body(myfunc1)[[c(6,4,9)]] > > > > (Watch the parens and brackets!) > > > > Duncan Murdoch > > > > Thank you! > >> > >> On Tue, Dec 6, 2011 at 6:22 AM, Duncan Murdoch > >> >wrote: > >> > >> > On 11-12-05 10:32 PM, Michael wrote: > >> > > >> >> Hi all, > >> >> > >> >> I am in the middle of debugging which is stopped using "browser()"... > >> in > >> >> myfile.R at around line #25. > >> >> > >> >> I was then stuck in a big loop which I want to escape and stop the > >> program > >> >> at the line after the big loop. > >> >> > >> >> In the debugging mode, I used > >> >> > >> >> Browse[2]> setBreakpoint("myfile.R#38") > >> >> > >> > > >> > What did it print? > >> > > >> > > >> > > >> >> I then typed "c" and "ENTER", thinking that it will continue to > >> execute > >> >> until when it comes across line #38 and then stop there... > >> >> > >> >> But it didn't work - it continued the execution until the end of the > >> >> function, right at the line "return(results)"... > >> >> > >> >> What happened? How to solve this problem? > >> >> > >> > > >> > One of the complications in R is that you can have multiple copies of a > >> > function in memory. You may (or may not, what did it print??) have > >> set a > >> > breakpoint in one copy, then run another. Or you may have edited that > >> > function after originally sourcing it, and lost the source reference. > >> > > >> > An alternative to using setBreakpoint is just to edit a call to > >> browser() > >> > into the function. It's less convenient, but more robust. > >> > > >> > Duncan Murdoch > >> > > >> > > >> > Thanks a lot! > >> >> > >> >> [[alternative HTML version deleted]] > >> >> > >> >> ______________________________****________________ > >> >> R-help at 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 code. > >> >> > >> > > >> > > >> > >> > > > From ehlers at ucalgary.ca Tue Dec 6 18:44:03 2011 From: ehlers at ucalgary.ca (Peter Ehlers) Date: Tue, 06 Dec 2011 09:44:03 -0800 Subject: [R] axis thickness in plot() In-Reply-To: <1323189326756-4165430.post@n4.nabble.com> References: <1323189326756-4165430.post@n4.nabble.com> Message-ID: <4EDE5463.1080304@ucalgary.ca> On 2011-12-06 08:35, AlexC wrote: > Hello, > > I am trying to increase the thickness of the axis in plot() without > reverting to the use of paint programs > > i see posts on that topic for the xyplot function but want to see if i can > do it with plot() because i've already setup my graph script using that > > i thought i could use axis() function and specify lwd="thickness" or > lwd.axis= but that does not work like it does for lwd.ticks > > If anyone has an idea, sincerely > > heres the script > > windows(width=7,height=7) > plot(data$Winter,data$NbFirstBroods,ylab="number of breeding > pairs",xlab="winter > harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE) > points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19) > abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4) Only you have the object you call 'data'. Why not provide a simple example (reproducible and minus the obviously unnecessary annotation) that illustrates your problem? > > i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example Presumably this gave a warning: "lwd.axis" is not a graphical parameter. The best thing at that point (if not sooner), is to type ?axis to see what the arguments for that function are. This would immediately show that 'lwd' is the argument you want. > > also when adding the y axis axis(2...) x and y axes are disconnected Use box() with your choice of bty and lwd. If you want different linewidths for the x and y axes, then retrieve the coordinates of par("usr") and use either abline() or lines(). Peter Ehlers > > Thank you for your kind help in advance, > > Alexandre > > -- > View this message in context: http://r.789695.n4.nabble.com/axis-thickness-in-plot-tp4165430p4165430.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From bastian.offermann at googlemail.com Tue Dec 6 18:17:29 2011 From: bastian.offermann at googlemail.com (Bastian Offermann) Date: Tue, 06 Dec 2011 12:17:29 -0500 Subject: [R] Bootstrapping Message-ID: <4EDE4E29.5010409@gmail.com> Hello, I am having some trouble setting up a bootstrapping prodecure. I create artificial data and would like to use these to bootstrap a t-test statistic from these. Especially I do not really get how boot uses the indices variable or i variable. Can anybody help out? Thanks!! b0 <- 1/2 # intercept as given b1 <- 1 # slope as given n <- 20 # of rand. numbers u <- rnorm(n, mean=0, sd=1) # generate data x <- rnorm(n, mean=0, sd=1) # y <- b0 + b1*x + u # model mu <- 1 data1 <- matrix(, n, 2) # Data from original draw tval <- function(data1, i) { data1[i,1] <- y data1[i,2] <- x m <- lm(data1[,1]~data1[,2]) p <- coef(m)[2] t <- (coef(m)[2]-mu)/sqrt(vcov(m)[2,2]) # t-test t } bs <- boot(data = data1, statistic = tval, R = 500, sim = "ordinary") bs ba <- boot.array(bs)[1:5,1:10] ci <- boot.ci(bs, conf=0.95, index=1, type="all") ci.bca <- ci$bca[4:5] plot(bs, index=1) From jroll at lcog.org Tue Dec 6 18:11:16 2011 From: jroll at lcog.org (LCOG1) Date: Tue, 6 Dec 2011 09:11:16 -0800 (PST) Subject: [R] To Try or to TryCatch, I have tried to long Message-ID: <1323191476006-4165578.post@n4.nabble.com> So after about 4 hours struggling with Try and TryCatch I am throwing in the towel. I have a more complicated function that used logspline through iterative distributions and at some point the logspline doesnt function correctly for some subsets but is fine with others so I need to be able to identify when the error occurs and stop curtailing the distribution and I think this Try or TryCatch should do the trick but I think I am missing something here. A simple example result_<-list() for(i in 1:10){ if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ #If sqrt fails result_[[i]]<-0 } else { #If sqrt succeeds result_[[i]] <- 1 } } I would expect this to fail only when i > 9 but succeeds each time. DO i need to specify something different where "try-error" resides? Thanks guys Cheers, Josh -- View this message in context: http://r.789695.n4.nabble.com/To-Try-or-to-TryCatch-I-have-tried-to-long-tp4165578p4165578.html Sent from the R help mailing list archive at Nabble.com. From luc.villandre at mail.mcgill.ca Tue Dec 6 18:27:16 2011 From: luc.villandre at mail.mcgill.ca (Luc Villandre) Date: Tue, 6 Dec 2011 17:27:16 +0000 Subject: [R] Can't load package 'lars' In-Reply-To: <4EDE1226.1010708@statistik.tu-dortmund.de> References: <4EDD7EDE.6090809@mail.mcgill.ca>, <4EDE1226.1010708@statistik.tu-dortmund.de> Message-ID: Hello, I do think so. ### [villandre at stat04 lars]$ pwd /home/villandre/R/x86_64-redhat-linux-gnu-library/2.11/lars [villandre at stat04 lars]$ ls data DESCRIPTION help html INDEX libs Meta NAMESPACE R ### I re-installed it and I still get the same error message. #### > install.packages("lars", lib = "~/R/x86_64-redhat-linux-gnu-library/2.11") trying URL 'http://software.rc.fas.harvard.edu/mirrors/R/src/contrib/lars_0.9-8.tar.gz' Content type 'application/x-gzip' length 172011 bytes (167 Kb) opened URL ================================================== downloaded 167 Kb * installing *source* package ?lars? ... ** libs gfortran -m64 -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c delcol.f -o delcol.o gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o lars.so delcol.o -lgfortran -lm -L/usr/lib64/R/lib -lR installing to /mnt/prism/s20/villandre/R/x86_64-redhat-linux-gnu-library/2.11/lars/libs ** R ** data ** preparing package for lazy loading ** help *** installing help indices converting help for package ?lars? finding HTML links ... done cv.lars html diabetes html lars-internal html lars html plot.lars html predict.lars html summary.lars html ** building package indices ... ** testing if installed package can be loaded Loaded lars 0.9-8 * DONE (lars) The downloaded packages are in ?/tmp/RtmphxCj4j/downloaded_packages? > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") Error : .onLoad failed in loadNamespace() for 'lars', details: call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], error: subscript out of bounds Error: package/namespace load failed for ?lars? #### It is the first time I get such an error message when trying to load a package. It would seem that the problem is with ### cat("Loaded lars", utils::installed.packages()["lars", "Version"] ### Is there a way to circumvent this problem (e.g. attribute an arbitrary value to utils::installed.packages()["lars", "Version"])? Thanks for your help, Luc ________________________________________ From: Uwe Ligges [ligges at statistik.tu-dortmund.de] Sent: Tuesday, December 06, 2011 8:01 AM To: Luc Villandre Cc: r-help Subject: Re: [R] Can't load package 'lars' On 06.12.2011 03:33, Luc Villandre wrote: > Hi, > > I installed package 'lars' earlier tonight and did not get any sort of > error message. > > ### > ** building package indices ... > ** testing if installed package can be loaded > Loaded lars 0.9-8 > > * DONE (lars) > ### > > However, when I try to load it, I get > ### > > library(lars, lib.loc = "~/R/x86_64-redhat-linux-gnu-library/2.11") Are you sure it is installed at the location you specified? Uwe Ligges > Error : .onLoad failed in loadNamespace() for 'lars', details: > call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], > error: subscript out of bounds > Error: package/namespace load failed for ?lars? > ### > > Session info: > > ### > > sessionInfo() > R version 2.14.0 (2011-10-31) > Platform: x86_64-redhat-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] rpart_3.1-50 tools_2.14.0 > ### > > I get the same error message when I try to load it on another machine: > > ### > > > library("lars",lib.loc = "~/R/i686-pc-linux-gnu-library/2.12") > Error : .onLoad failed in loadNamespace() for 'lars', details: > call: cat("Loaded lars", utils::installed.packages()["lars", "Version"], > error: subscript out of bounds > Error: package/namespace load failed for 'lars' > ### > > Session info: > > ### > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: i686-pc-linux-gnu (32-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_2.13.1 > ### > > Is there at least a way to circumvent the problem? > > Thank you for your help, > > Luc Villandre > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Tue Dec 6 18:45:45 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 11:45:45 -0600 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: <4EDE51CD.50904@statistik.tu-dortmund.de> References: <4EDE4CFF.3000601@statistik.tu-dortmund.de> <4EDE51CD.50904@statistik.tu-dortmund.de> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Tue Dec 6 18:57:13 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Tue, 6 Dec 2011 18:57:13 +0100 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: References: <4EDE4CFF.3000601@statistik.tu-dortmund.de> <4EDE51CD.50904@statistik.tu-dortmund.de> Message-ID: <4EDE5779.6000709@statistik.tu-dortmund.de> On 06.12.2011 18:45, Michael wrote: > yeah, any one line command of checking which function is currently in the > memory? Which memory? You have to think about namespaces and environments in such a case, and then, we need to know what you are actually doing. > so if I find any function not in the .GlobalEnv. > then I know what the problem is? Err, no. So are you working on package and may NAMESPACES be involved or not? If not, my initial guess may be wrong. I think you have to provide more information what you are actually doing and how you did define all your functions that are involved. best, uwe Ligges > > 2011/12/6 Uwe Ligges > >> >> >> On 06.12.2011 18:29, Michael wrote: >> >>> how do I check and make sure? thx >>> >> >> E.g. insert cat("Hello World!\n") in the first line of your function you >> called "subroutine". >> >> Best, >> Uwe Ligges >> >> >> >> >> >> >> >> >> >>> On 12/6/11, Uwe Ligges> >>> wrote: >>> >>>> >>>> >>>> On 06.12.2011 18:06, Michael wrote: >>>> >>>>> It's weird! >>>>> >>>>> I am sure that I have inserted "browser()" in a sub-routine where I >>>>> wanted to stop and debug... >>>>> >>>>> But when I start running the main function from the separate main file, >>>>> >>>>> it doesn't stop within the target sub-routine at all. >>>>> >>>> >>>> Probably you are using some package and call the "subroutine" within the >>>> NAMESPACE of the package rather than the one in .GlobalEnv. >>>> >>>> Uwe Ligges >>>> >>>> >>>> Please help me! >>>>> >>>>> Thanks! >>>>> >>>>> ______________________________**________________ >>>>> R-help at 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 code. >>>>> >>>> >>>> > From murdoch.duncan at gmail.com Tue Dec 6 19:04:30 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 13:04:30 -0500 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: References: <4EDE4CFF.3000601@statistik.tu-dortmund.de> <4EDE51CD.50904@statistik.tu-dortmund.de> Message-ID: <4EDE592E.4080003@gmail.com> On 06/12/2011 12:45 PM, Michael wrote: > yeah, any one line command of checking which function is currently in the > memory? As Uwe said, that's not a very useful thing to do. But if you know the name you're looking for, find() is useful. For example, Browse[1]> find("mean") [1] "package:base" You might also want find("mean", mode="function"), in case you've also got a non-function named "mean". Duncan Murdoch > so if I find any function not in the .GlobalEnv. > then I know what the problem is? > > 2011/12/6 Uwe Ligges > > > > > > > On 06.12.2011 18:29, Michael wrote: > > > >> how do I check and make sure? thx > >> > > > > E.g. insert cat("Hello World!\n") in the first line of your function you > > called "subroutine". > > > > Best, > > Uwe Ligges > > > > > > > > > > > > > > > > > > > >> On 12/6/11, Uwe Ligges> > >> wrote: > >> > >>> > >>> > >>> On 06.12.2011 18:06, Michael wrote: > >>> > >>>> It's weird! > >>>> > >>>> I am sure that I have inserted "browser()" in a sub-routine where I > >>>> wanted to stop and debug... > >>>> > >>>> But when I start running the main function from the separate main file, > >>>> > >>>> it doesn't stop within the target sub-routine at all. > >>>> > >>> > >>> Probably you are using some package and call the "subroutine" within the > >>> NAMESPACE of the package rather than the one in .GlobalEnv. > >>> > >>> Uwe Ligges > >>> > >>> > >>> Please help me! > >>>> > >>>> Thanks! > >>>> > >>>> ______________________________**________________ > >>>> R-help at 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 code. > >>>> > >>> > >>> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Tue Dec 6 19:07:54 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 12:07:54 -0600 Subject: [R] RStudio: copied line is always not the same as the line that I highlighted Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 19:10:19 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 12:10:19 -0600 Subject: [R] How to de-source and re-source a file? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Tue Dec 6 19:17:04 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 13:17:04 -0500 Subject: [R] How to de-source and re-source a file? In-Reply-To: References: Message-ID: <4EDE5C20.8090305@gmail.com> On 06/12/2011 1:10 PM, Michael wrote: > i.e. how to make sure the function that was loaded into workspace/memory is > the version that I edited latest... not some stale version... > > This might solve some of my breakpoint and browser/debug problem, even the > RStudio problem that I've met.... You can use rm() to remove a function. You can also quit and restart R, making sure that it *does not* load an existing workspace (by deleting the .Rdata file if it exists, and never answering "yes" to the question to save it.) This gives you a nice clean slate. Duncan Murdoch From comtech.usa at gmail.com Tue Dec 6 19:17:37 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 12:17:37 -0600 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: <4EDE592E.4080003@gmail.com> References: <4EDE4CFF.3000601@statistik.tu-dortmund.de> <4EDE51CD.50904@statistik.tu-dortmund.de> <4EDE592E.4080003@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 19:19:14 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 12:19:14 -0600 Subject: [R] How to de-source and re-source a file? In-Reply-To: <4EDE5C20.8090305@gmail.com> References: <4EDE5C20.8090305@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Tue Dec 6 19:21:13 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 13:21:13 -0500 Subject: [R] help! "browser()" does not get stopped... In-Reply-To: References: <4EDE4CFF.3000601@statistik.tu-dortmund.de> <4EDE51CD.50904@statistik.tu-dortmund.de> <4EDE592E.4080003@gmail.com> Message-ID: <4EDE5D19.9030807@gmail.com> On 06/12/2011 1:17 PM, Michael wrote: > Thanks a lot! > > What I was wondering is: > > if we use "find", are the results for locally installed packages, or > "search_paths", or the functions that are loaded into memory? It finds what get() would find, so that starts with the current evaluation frame, and follows the chain back to the base environment. If you haven't used library() or require() to load a package, it won't be found. > I am looking for some command to tell me which functions are currently in > the memory. ls() will do that for the current evaluation frame. See its args if you want to search back through the chain. > My understanding is that after the first-run of a function, the function is > loaded into memory and stays there until being unloaded. That's true, but not relevant. If it hasn't been loaded, a stub is there, and find() will see the stub. > If I don't unload the function, then any newly edited version will not be > loaded and the one in memory is the stale version... That's not true. As soon as you assign a new value to the name, it will be replaced. But you need to do the assignment in the right place in the chain. Duncan Murdoch > This might explain a few of my weird problems... > > Thanks a lot! > > On Tue, Dec 6, 2011 at 12:04 PM, Duncan Murdochwrote: > > > On 06/12/2011 12:45 PM, Michael wrote: > > > >> yeah, any one line command of checking which function is currently in the > >> memory? > >> > > > > As Uwe said, that's not a very useful thing to do. But if you know the > > name you're looking for, find() is useful. For example, > > > > Browse[1]> find("mean") > > [1] "package:base" > > > > You might also want find("mean", mode="function"), in case you've also got > > a non-function named "mean". > > > > Duncan Murdoch > > > > so if I find any function not in the .GlobalEnv. > >> then I know what the problem is? > >> > >> 2011/12/6 Uwe Ligges > >> > > >> > >> > > >> > > >> > On 06.12.2011 18:29, Michael wrote: > >> > > >> >> how do I check and make sure? thx > >> >> > >> > > >> > E.g. insert cat("Hello World!\n") in the first line of your function > >> you > >> > called "subroutine". > >> > > >> > Best, > >> > Uwe Ligges > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> >> On 12/6/11, Uwe Ligges > >> >> > >> > >> >> wrote: > >> >> > >> >>> > >> >>> > >> >>> On 06.12.2011 18:06, Michael wrote: > >> >>> > >> >>>> It's weird! > >> >>>> > >> >>>> I am sure that I have inserted "browser()" in a sub-routine where I > >> >>>> wanted to stop and debug... > >> >>>> > >> >>>> But when I start running the main function from the separate main > >> file, > >> >>>> > >> >>>> it doesn't stop within the target sub-routine at all. > >> >>>> > >> >>> > >> >>> Probably you are using some package and call the "subroutine" within > >> the > >> >>> NAMESPACE of the package rather than the one in .GlobalEnv. > >> >>> > >> >>> Uwe Ligges > >> >>> > >> >>> > >> >>> Please help me! > >> >>>> > >> >>>> Thanks! > >> >>>> > >> >>>> ______________________________****________________ > >> >>>> R-help at 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 code. > >> >>>> > >> >>> > >> >>> > >> > >> [[alternative HTML version deleted]] > >> > >> > >> ______________________________**________________ > >> R-help at 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 code. > >> > > > > > From murdoch.duncan at gmail.com Tue Dec 6 19:23:01 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 6 Dec 2011 13:23:01 -0500 Subject: [R] How to de-source and re-source a file? In-Reply-To: References: <4EDE5C20.8090305@gmail.com> Message-ID: <4EDE5D85.8040702@gmail.com> On 06/12/2011 1:19 PM, Michael wrote: > Thanks a lot! > > But how about removing "all the functions" in the whole "myprogram1.R" > source file? There's no way for R to know what you did with those functions, so no general way to do that. But if you just source it again, it will overwrite the ones in the current evaluation frame. Duncan Murdoch > The reason for asking this is of course, after I made some changes, I saved > it, and then I wanted the functions to be reloaded into memory so that I > can do "mtrace", or "browser" etc. > > Thank you! > > On Tue, Dec 6, 2011 at 12:17 PM, Duncan Murdochwrote: > > > On 06/12/2011 1:10 PM, Michael wrote: > > > >> i.e. how to make sure the function that was loaded into workspace/memory > >> is > >> the version that I edited latest... not some stale version... > >> > >> This might solve some of my breakpoint and browser/debug problem, even the > >> RStudio problem that I've met.... > >> > > > > You can use rm() to remove a function. > > > > You can also quit and restart R, making sure that it *does not* load an > > existing workspace (by deleting the .Rdata file if it exists, and never > > answering "yes" to the question to save it.) This gives you a nice clean > > slate. > > > > Duncan Murdoch > > > From gleynes+r at gmail.com Tue Dec 6 19:26:57 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Tue, 6 Dec 2011 12:26:57 -0600 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: <1323191476006-4165578.post@n4.nabble.com> References: <1323191476006-4165578.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From amidou.ndiaye at mhi-humangenetics.org Tue Dec 6 19:27:25 2011 From: amidou.ndiaye at mhi-humangenetics.org (Amidou N'Diaye) Date: Tue, 06 Dec 2011 13:27:25 -0500 Subject: [R] convert p-values into z-scores Message-ID: <4EDE5E8D.1020009@mhi-humangenetics.org> Is there a program to convert p-values into z-scores for meta-analysis purpose? Thanks From gleynes at gmail.com Tue Dec 6 19:15:33 2011 From: gleynes at gmail.com (Gene Leynes) Date: Tue, 6 Dec 2011 12:15:33 -0600 Subject: [R] read.table performance Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From pavan.namd at gmail.com Tue Dec 6 19:42:19 2011 From: pavan.namd at gmail.com (Pavan G) Date: Tue, 6 Dec 2011 13:42:19 -0500 Subject: [R] Find x value of density plots Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Tue Dec 6 19:44:39 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 12:44:39 -0600 Subject: [R] How to de-source and re-source a file? In-Reply-To: <4EDE5C20.8090305@gmail.com> References: <4EDE5C20.8090305@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gunter.berton at gene.com Tue Dec 6 19:47:42 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Tue, 6 Dec 2011 10:47:42 -0800 Subject: [R] Find x value of density plots In-Reply-To: References: Message-ID: ?density ... and pay attention to the "Value" details. -- Bert On Tue, Dec 6, 2011 at 10:42 AM, Pavan G wrote: > Hello All, > > How do I find the x value at max density for say, this plot > plot(density(rnorm(1000))) > > > Thank you, > P > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From murdoch.duncan at gmail.com Tue Dec 6 19:48:39 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Tue, 06 Dec 2011 13:48:39 -0500 Subject: [R] Find x value of density plots In-Reply-To: References: Message-ID: <4EDE6387.3020509@gmail.com> On 06/12/2011 1:42 PM, Pavan G wrote: > Hello All, > > How do I find the x value at max density for say, this plot > plot(density(rnorm(1000))) d <- density(rnorm(1000)) plot(d) abline(v=d$x[which.max(d$y)]) Duncan Murdoch From jvadams at usgs.gov Tue Dec 6 19:53:05 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Tue, 6 Dec 2011 12:53:05 -0600 Subject: [R] convert p-values into z-scores In-Reply-To: <4EDE5E8D.1020009@mhi-humangenetics.org> References: <4EDE5E8D.1020009@mhi-humangenetics.org> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Tue Dec 6 19:58:51 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 13:58:51 -0500 Subject: [R] split date nad time In-Reply-To: <1323188614142-4165378.post@n4.nabble.com> References: <1323167923173-4164191.post@n4.nabble.com> <310852B4-4BD9-4F3D-B13B-D173A77A7AA9@comcast.net> <1323188614142-4165378.post@n4.nabble.com> Message-ID: I can't replicate this: does it occur in a fresh R session (no GUI, just straight --vanilla)? If so, sessionInfo()? On Tue, Dec 6, 2011 at 11:23 AM, threshold wrote: > > ok, > >> dput(AggDateTime[960:962]) > structure(c(1314313140L, 1314313200L, 1314313260L), class = c("POSIXct", > "POSIXt"), tzone = "") > > -- > View this message in context: http://r.789695.n4.nabble.com/split-date-nad-time-tp4164191p4165378.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From vioravis at gmail.com Tue Dec 6 19:42:35 2011 From: vioravis at gmail.com (vioravis) Date: Tue, 6 Dec 2011 10:42:35 -0800 (PST) Subject: [R] Sequential Sum in R Message-ID: <1323196955659-4165916.post@n4.nabble.com> I am trying to code the following excel formula in R. a b c Result Formula 1 10 0.1 #N/A IF(B2<20,NA(),C2+IF(ISERROR(D1),0,D1)) 2 20 0.2 0.2 IF(B3<20,NA(),C3+IF(ISERROR(D2),0,D2)) 3 30 0.3 0.5 IF(B4<20,NA(),C4+IF(ISERROR(D3),0,D3)) 4 40 0.4 0.9 IF(B5<20,NA(),C5+IF(ISERROR(D4),0,D4)) 5 50 0.5 1.4 IF(B6<20,NA(),C6+IF(ISERROR(D5),0,D5)) 6 60 0.6 2 IF(B7<20,NA(),C7+IF(ISERROR(D6),0,D6)) 7 70 0.7 2.7 IF(B8<20,NA(),C8+IF(ISERROR(D7),0,D7)) 8 80 0.8 3.5 IF(B9<20,NA(),C9+IF(ISERROR(D8),0,D8)) 9 90 0.9 4.4 IF(B10<20,NA(),C10+IF(ISERROR(D9),0,D9)) 10 100 1 5.4 IF(B11<20,NA(),C11+IF(ISERROR(D10),0,D10)) The variable "Result" is obtained using the excel formula shown next to it. Column D contains the Result. dataFrame <- data.frame(a = seq(1:10),b = seq(10,100,by = 10),c = seq(0.1,1,by = 0.1)) Can someone please help me as how to calculate the sequential sum in R given by the excel formula?? Thank you. Ravi -- View this message in context: http://r.789695.n4.nabble.com/Sequential-Sum-in-R-tp4165916p4165916.html Sent from the R help mailing list archive at Nabble.com. From gleynes+r at gmail.com Tue Dec 6 19:58:00 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Tue, 6 Dec 2011 12:58:00 -0600 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> References: <1323191476006-4165578.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ggrothendieck at gmail.com Tue Dec 6 20:06:58 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Tue, 6 Dec 2011 14:06:58 -0500 Subject: [R] read.table performance In-Reply-To: References: Message-ID: On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes wrote: > ** Disclaimer: I'm looking for general suggestions ** > I'm sorry, but can't send out the file I'm using, so there is no > reproducible example. > > I'm using read.table and it's taking over 30 seconds to read a tiny file. > The strange thing is that it takes roughly the same amount of time if the > file is 100 times larger. > > After re-reviewing the data Import / Export manual I think the best > approach would be to use Python, or perhaps the readLines function, but I > was hoping to understand why the simple read.table approach wasn't working > as expected. > > Some relevant facts: > > ? 1. There are about 3700 columns. ?Maybe this is the problem? ?Still the > ? file size is not very large. > ? 2. The file encoding is ANSI, but I'm not specifying that in the > ? function. ?Setting fileEncoding="ANSI" produces an "unsupported conversion" > ? error > ? 3. readLines imports the lines quickly > ? 4. scan imports the file quickly also > > Obviously, scan and readLines would require more coding to identify > columns, etc. > > my code: > system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', > header=TRUE)) > > It's taking 33.4 seconds and the file size is only 315 kb! > You could also try read.csv.sql in the sqldf package and see whether or not that is any faster. Be sure you are using RSQLite 0.11.0 (and not an earlier version) with that since earlier versions were compiled to work with only a maximum of 999 columns. library(sqldf) DF <- read.csv.sql("C:\\test.txt", header = TRUE, sep = "\t") You may or may not have to use the eol= argument to specify line endings. See ?read.csv.sql -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From jvadams at usgs.gov Tue Dec 6 20:11:54 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Tue, 6 Dec 2011 13:11:54 -0600 Subject: [R] Sequential Sum in R In-Reply-To: <1323196955659-4165916.post@n4.nabble.com> References: <1323196955659-4165916.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wdunlap at tibco.com Tue Dec 6 20:38:25 2011 From: wdunlap at tibco.com (William Dunlap) Date: Tue, 6 Dec 2011 19:38:25 +0000 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: References: <1323191476006-4165578.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> Message-ID: Look at the archives of this mailing list for a discussion entitled 'Stack trace?' on Nov 9-10 of this year. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Gene Leynes > Sent: Tuesday, December 06, 2011 10:58 AM > To: ROLL Josh F > Cc: r-help at r-project.org > Subject: Re: [R] To Try or to TryCatch, I have tried to long > > I've had the same problem in other cases. > > Does anyone know how to catch warnings as well as errors? > > On Tue, Dec 6, 2011 at 12:34 PM, ROLL Josh F wrote: > > > ** > > Agreed. But what I am trying to control is when I get a warning. I want > > to do something different if a warning OR an error pop up? Any ideas? > > > > Cheers > > > > ------------------------------ > > *From:* gleynes at gmail.com [mailto:gleynes at gmail.com] *On Behalf Of *Gene > > Leynes > > *Sent:* Tuesday, December 06, 2011 10:27 AM > > *To:* ROLL Josh F > > *Cc:* r-help at r-project.org > > *Subject:* Re: [R] To Try or to TryCatch, I have tried to long > > > > I think the problem is that it's only a warning and not an error. > > > > result_<-list() > > for(i in 1:10){ > > if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > > #If sqrt fails > > cat('fail',i,'\n') > > result_[[i]]<-0 } else { > > #If sqrt succeeds > > cat('succeed',i,'\n') > > result_[[i]] <- 1 } > > } > > result_ > > > > On Tue, Dec 6, 2011 at 11:11 AM, LCOG1 wrote: > > > >> So after about 4 hours struggling with Try and TryCatch I am throwing in > >> the > >> towel. I have a more complicated function that used logspline through > >> iterative distributions and at some point the logspline doesnt function > >> correctly for some subsets but is fine with others so I need to be able to > >> identify when the error occurs and stop curtailing the distribution and I > >> think this Try or TryCatch should do the trick but I think I am missing > >> something here. A simple example > >> > >> > >> result_<-list() > >> for(i in 1:10){ > >> if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > >> #If sqrt fails > >> result_[[i]]<-0 } else { > >> #If sqrt succeeds > >> result_[[i]] <- 1 } > >> } > >> > >> > >> I would expect this to fail only when i > 9 but succeeds each time. DO i > >> need to specify something different where "try-error" resides? Thanks > >> guys > >> > >> Cheers, > >> Josh > >> > >> > >> -- > >> View this message in context: > >> http://r.789695.n4.nabble.com/To-Try-or-to-TryCatch-I-have-tried-to-long-tp4165578p4165578.html > >> Sent from the R help mailing list archive at Nabble.com. > >> > >> ______________________________________________ > >> R-help at 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 code. > >> > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From wdunlap at tibco.com Tue Dec 6 20:42:08 2011 From: wdunlap at tibco.com (William Dunlap) Date: Tue, 6 Dec 2011 19:42:08 +0000 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: References: <1323191476006-4165578.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> Message-ID: Or, Google for 'R catching warnings' and third entry is the excellent http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/ Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of William Dunlap > Sent: Tuesday, December 06, 2011 11:38 AM > To: gleynes+r at gmail.com; ROLL Josh F > Cc: r-help at r-project.org > Subject: Re: [R] To Try or to TryCatch, I have tried to long > > Look at the archives of this mailing list for a discussion > entitled 'Stack trace?' on Nov 9-10 of this year. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -----Original Message----- > > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Gene Leynes > > Sent: Tuesday, December 06, 2011 10:58 AM > > To: ROLL Josh F > > Cc: r-help at r-project.org > > Subject: Re: [R] To Try or to TryCatch, I have tried to long > > > > I've had the same problem in other cases. > > > > Does anyone know how to catch warnings as well as errors? > > > > On Tue, Dec 6, 2011 at 12:34 PM, ROLL Josh F wrote: > > > > > ** > > > Agreed. But what I am trying to control is when I get a warning. I want > > > to do something different if a warning OR an error pop up? Any ideas? > > > > > > Cheers > > > > > > ------------------------------ > > > *From:* gleynes at gmail.com [mailto:gleynes at gmail.com] *On Behalf Of *Gene > > > Leynes > > > *Sent:* Tuesday, December 06, 2011 10:27 AM > > > *To:* ROLL Josh F > > > *Cc:* r-help at r-project.org > > > *Subject:* Re: [R] To Try or to TryCatch, I have tried to long > > > > > > I think the problem is that it's only a warning and not an error. > > > > > > result_<-list() > > > for(i in 1:10){ > > > if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > > > #If sqrt fails > > > cat('fail',i,'\n') > > > result_[[i]]<-0 } else { > > > #If sqrt succeeds > > > cat('succeed',i,'\n') > > > result_[[i]] <- 1 } > > > } > > > result_ > > > > > > On Tue, Dec 6, 2011 at 11:11 AM, LCOG1 wrote: > > > > > >> So after about 4 hours struggling with Try and TryCatch I am throwing in > > >> the > > >> towel. I have a more complicated function that used logspline through > > >> iterative distributions and at some point the logspline doesnt function > > >> correctly for some subsets but is fine with others so I need to be able to > > >> identify when the error occurs and stop curtailing the distribution and I > > >> think this Try or TryCatch should do the trick but I think I am missing > > >> something here. A simple example > > >> > > >> > > >> result_<-list() > > >> for(i in 1:10){ > > >> if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > > >> #If sqrt fails > > >> result_[[i]]<-0 } else { > > >> #If sqrt succeeds > > >> result_[[i]] <- 1 } > > >> } > > >> > > >> > > >> I would expect this to fail only when i > 9 but succeeds each time. DO i > > >> need to specify something different where "try-error" resides? Thanks > > >> guys > > >> > > >> Cheers, > > >> Josh > > >> > > >> > > >> -- > > >> View this message in context: > > >> http://r.789695.n4.nabble.com/To-Try-or-to-TryCatch-I-have-tried-to-long-tp4165578p4165578.html > > >> Sent from the R help mailing list archive at Nabble.com. > > >> > > >> ______________________________________________ > > >> R-help at 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 code. > > >> > > > > > > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From dwinsemius at comcast.net Tue Dec 6 21:04:58 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Tue, 6 Dec 2011 15:04:58 -0500 Subject: [R] help wrapping findInterval into a function In-Reply-To: <1323189832120-4165464.post@n4.nabble.com> References: <1323189832120-4165464.post@n4.nabble.com> Message-ID: <485A5566-BB90-4001-922E-928D1203465B@comcast.net> On Dec 6, 2011, at 11:43 AM, Steve E. wrote: > Dear R Community, > > I hope you might be able to assist with a small problem creating a > function. > I am working with water-quality data sets that contain the > concentration of > many different elements in water samples. I need to assign quality- > control > flags to values that fall into various concentration ranges. Rather > than a > web of nested if statements, I am employing the findInterval > function to > identify values that need to be flagged and to assign the > appropriate flag. It's probably your use of "with" rather than findInterval. The 'with' function sets up an environment and is used mostly in interactive session. If you have not passed a dataframe into the function then you should use the name of the dataframe and '['. > The data consist of a sample identifier, the analysis, and > corresponding > value. The findInterval function works well; however, I would like to > incorporate it into a function so that I can run multiple findInterval > functions for many different water-quality analyses (and I have to > do this > for many dataset) but it seems to fall apart when incorporated into a > function. > > Run straighforward, the findInterval function works as desired, e.g. > below, > creating the new CalciumFlag column with the appropriate flag for, > in this > case, levels of calcium in the water: > > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > (flags <- > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > 100, > Inf))]),"")) > > However, it does not worked when wrapped in a function (no error > messages > are thrown, it simply does not seem to do anything): > > WQfunc <- function() { > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > (flags <- > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > 100, > Inf))]),"")) > } > > Calling the function WQfunc() does not produce an error but also > does not > produce the expected CalciumFlag, it seems to not do anything. > > Ultimately, what I need to get to is something like below where > multiple > findInterval functions for different analyses are included in a single > function, then I can concatenate the results into a single column > containing > all flags for all analyses, e.g.: > > WQfunc <- function() { > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > (flags <- > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > 100, > Inf))]),"")) > > WQdata$SodiumFlag <- with(WQdata, ifelse(analysis == "Sodium", > (flags <- > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.050, > 0.125, 125, > Inf))]),"")) > > WQdata$MagnesiumFlag <- with(WQdata, ifelse(analysis == > "Magnesium", (flags > <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.065, > 0.15, 75, > Inf))]),"")) > > .....etc for additional water-quality analyses... > > } > > As an aside, I started working with the findInterval tool from an > example > that I found online but am not clear as to how the multi-component > configuration incorporating brackets actually works, can anyone > suggest a > good resource that explains this? > > > I thank you very much for any assistance you may be able to provide. > > > Regards, > Steve > > -- > View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4165464.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From antonio.punzon at st.ieo.es Tue Dec 6 21:05:03 2011 From: antonio.punzon at st.ieo.es (Antonio Punzon Merino) Date: Tue, 6 Dec 2011 21:05:03 +0100 Subject: [R] varaince explined of a regression tree using ctree Message-ID: An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: From jdnewmil at dcn.davis.ca.us Tue Dec 6 21:21:37 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Tue, 6 Dec 2011 15:21:37 -0500 Subject: [R] =?utf-8?q?RStudio=3A_copied_line_is_always_not_the_same_as_th?= =?utf-8?q?e_line_that_I=09highlighted?= In-Reply-To: References: Message-ID: RStudio is not R. Go ask the RStudio support people at www.rstudio.org. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Michael wrote: >Hi all, > >I am using RStudio. I wanted to copy and past an expression/line. > >I highlighted it, and then copied and pasted: > >The result was not the line that I wanted, instead, it was the line >above... > >For example: > >I have three lines: > > > >aaaaa >bbbbb >ccccc >.... > >I highlighted "bbbbb" and copied, but the pasted outcome was "aaaaa"... > >What happened? > >Thanks al ot! > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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 code. From kirpich at gmail.com Tue Dec 6 20:35:52 2011 From: kirpich at gmail.com (Yev) Date: Tue, 6 Dec 2011 14:35:52 -0500 Subject: [R] making changes to global variables in functions Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From JRoll at lcog.org Tue Dec 6 21:02:37 2011 From: JRoll at lcog.org (ROLL Josh F) Date: Tue, 6 Dec 2011 12:02:37 -0800 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: References: <1323191476006-4165578.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> Message-ID: <506F591A54F21D4480EE337F77369C056B10086B@LCEXG03.lc100.net> Thank for the links. I reread one I found yesterday about changing the options parameter to options(warn = 2) and that allows the try() function to see a warning the same way as an error so problem solved using the existing code. Cheers, Josh -----Original Message----- From: William Dunlap [mailto:wdunlap at tibco.com] Sent: Tuesday, December 06, 2011 11:42 AM To: gleynes+r at gmail.com; ROLL Josh F Cc: r-help at r-project.org Subject: RE: [R] To Try or to TryCatch, I have tried to long Or, Google for 'R catching warnings' and third entry is the excellent http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/ Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of William Dunlap > Sent: Tuesday, December 06, 2011 11:38 AM > To: gleynes+r at gmail.com; ROLL Josh F > Cc: r-help at r-project.org > Subject: Re: [R] To Try or to TryCatch, I have tried to long > > Look at the archives of this mailing list for a discussion entitled > 'Stack trace?' on Nov 9-10 of this year. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -----Original Message----- > > From: r-help-bounces at r-project.org > > [mailto:r-help-bounces at r-project.org] On Behalf Of Gene Leynes > > Sent: Tuesday, December 06, 2011 10:58 AM > > To: ROLL Josh F > > Cc: r-help at r-project.org > > Subject: Re: [R] To Try or to TryCatch, I have tried to long > > > > I've had the same problem in other cases. > > > > Does anyone know how to catch warnings as well as errors? > > > > On Tue, Dec 6, 2011 at 12:34 PM, ROLL Josh F wrote: > > > > > ** > > > Agreed. But what I am trying to control is when I get a warning. > > > I want to do something different if a warning OR an error pop up? Any ideas? > > > > > > Cheers > > > > > > ------------------------------ > > > *From:* gleynes at gmail.com [mailto:gleynes at gmail.com] *On Behalf Of > > > *Gene Leynes > > > *Sent:* Tuesday, December 06, 2011 10:27 AM > > > *To:* ROLL Josh F > > > *Cc:* r-help at r-project.org > > > *Subject:* Re: [R] To Try or to TryCatch, I have tried to long > > > > > > I think the problem is that it's only a warning and not an error. > > > > > > result_<-list() > > > for(i in 1:10){ > > > if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > > > #If sqrt fails > > > cat('fail',i,'\n') > > > result_[[i]]<-0 } else { > > > #If sqrt succeeds > > > cat('succeed',i,'\n') > > > result_[[i]] <- 1 } > > > } > > > result_ > > > > > > On Tue, Dec 6, 2011 at 11:11 AM, LCOG1 wrote: > > > > > >> So after about 4 hours struggling with Try and TryCatch I am > > >> throwing in the towel. I have a more complicated function that > > >> used logspline through iterative distributions and at some point > > >> the logspline doesnt function correctly for some subsets but is > > >> fine with others so I need to be able to identify when the error > > >> occurs and stop curtailing the distribution and I think this Try > > >> or TryCatch should do the trick but I think I am missing > > >> something here. A simple example > > >> > > >> > > >> result_<-list() > > >> for(i in 1:10){ > > >> if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ > > >> #If sqrt fails > > >> result_[[i]]<-0 } else { > > >> #If sqrt succeeds > > >> result_[[i]] <- 1 } } > > >> > > >> > > >> I would expect this to fail only when i > 9 but succeeds each time. DO i > > >> need to specify something different where "try-error" resides? Thanks > > >> guys > > >> > > >> Cheers, > > >> Josh > > >> > > >> > > >> -- > > >> View this message in context: > > >> http://r.789695.n4.nabble.com/To-Try-or-to-TryCatch-I-have-tried-to-long-tp4165578p4165578.html > > >> Sent from the R help mailing list archive at Nabble.com. > > >> > > >> ______________________________________________ > > >> R-help at 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 code. > > >> > > > > > > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From chesney.alt at gmail.com Tue Dec 6 21:02:49 2011 From: chesney.alt at gmail.com (Thomas) Date: Tue, 6 Dec 2011 20:02:49 +0000 Subject: [R] Writing out in loops In-Reply-To: References: <25F43847-81F3-4231-8D4F-DE54B85E6084@gmail.com> Message-ID: <96D29C75-093F-4084-BAF5-B925CD4B2AF2@gmail.com> Thanks for the reply. I'm writing data out as it is generated into a number of different files and not saving it as I go (although I could - not sure which would be quicker). In fact I tried this today and the approach with the loop seems to run reasonably fast. Thomas On 6 Dec 2011, at 15:07, Sarah Goslee wrote: > Is there some reason you can't create the entire file in R and then write it > out in a single step? > > It looks like you're writing out > mat[1, 1:10] > so you could just use > write.table(mat[1, 1:10], filen) > > Can you expand on what you're trying to do? > > Sarah > > On Tue, Dec 6, 2011 at 4:18 AM, Thomas wrote: >> I would like to write some data to different files. I can create the >> filename Day1.txt like this: >> >> filen <- paste("Day", l, ".txt", sep="") >> >> and then I'm using a For loop to write out one row of a matrix, something >> like this: >> >> For (j in 1:10) >> { >> cat(mat[1,j], ",", file=filen, append=TRUE) >> } >> cat("\n", file=filen, append=TRUE) >> >> but is there a better way to do this? >> >> Thank you, >> >> Thomas >> > > > -- > Sarah Goslee > http://www.functionaldiversity.org From wdunlap at tibco.com Tue Dec 6 21:46:26 2011 From: wdunlap at tibco.com (William Dunlap) Date: Tue, 6 Dec 2011 20:46:26 +0000 Subject: [R] help wrapping findInterval into a function In-Reply-To: <485A5566-BB90-4001-922E-928D1203465B@comcast.net> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> Message-ID: No, the problem is not with "with" but is that the OP's did not return the modified data.frame. He didn't show how the function was called, but I suspect the usage was like f0 <- function() globalDataFrame$newCol <- ... f0() where it should have been f1 <- function(dataFrame) { dataFrame$newCol <- ... dataFrame # return modified dataFrame } globalDataFrame <- f1(globalDataFrame) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of David Winsemius > Sent: Tuesday, December 06, 2011 12:05 PM > To: Steve E. > Cc: r-help at r-project.org > Subject: Re: [R] help wrapping findInterval into a function > > > On Dec 6, 2011, at 11:43 AM, Steve E. wrote: > > > Dear R Community, > > > > I hope you might be able to assist with a small problem creating a > > function. > > I am working with water-quality data sets that contain the > > concentration of > > many different elements in water samples. I need to assign quality- > > control > > flags to values that fall into various concentration ranges. Rather > > than a > > web of nested if statements, I am employing the findInterval > > function to > > identify values that need to be flagged and to assign the > > appropriate flag. > > It's probably your use of "with" rather than findInterval. The 'with' > function sets up an environment and is used mostly in interactive > session. If you have not passed a dataframe into the function then you > should use the name of the dataframe and '['. > > > > The data consist of a sample identifier, the analysis, and > > corresponding > > value. The findInterval function works well; however, I would like to > > incorporate it into a function so that I can run multiple findInterval > > functions for many different water-quality analyses (and I have to > > do this > > for many dataset) but it seems to fall apart when incorporated into a > > function. > > > > Run straighforward, the findInterval function works as desired, e.g. > > below, > > creating the new CalciumFlag column with the appropriate flag for, > > in this > > case, levels of calcium in the water: > > > > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > > (flags <- > > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > > 100, > > Inf))]),"")) > > > > However, it does not worked when wrapped in a function (no error > > messages > > are thrown, it simply does not seem to do anything): > > > > WQfunc <- function() { > > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > > (flags <- > > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > > 100, > > Inf))]),"")) > > } > > > > Calling the function WQfunc() does not produce an error but also > > does not > > produce the expected CalciumFlag, it seems to not do anything. > > > > Ultimately, what I need to get to is something like below where > > multiple > > findInterval functions for different analyses are included in a single > > function, then I can concatenate the results into a single column > > containing > > all flags for all analyses, e.g.: > > > > WQfunc <- function() { > > WQdata$CalciumFlag <- with(WQdata, ifelse(analysis == "Calcium", > > (flags <- > > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.027, 0.1, > > 100, > > Inf))]),"")) > > > > WQdata$SodiumFlag <- with(WQdata, ifelse(analysis == "Sodium", > > (flags <- > > c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.050, > > 0.125, 125, > > Inf))]),"")) > > > > WQdata$MagnesiumFlag <- with(WQdata, ifelse(analysis == > > "Magnesium", (flags > > <- c("Y", 'Q', "", "A") [findInterval(WQdata$value, c(-Inf, 0.065, > > 0.15, 75, > > Inf))]),"")) > > > > .....etc for additional water-quality analyses... > > > > } > > > > As an aside, I started working with the findInterval tool from an > > example > > that I found online but am not clear as to how the multi-component > > configuration incorporating brackets actually works, can anyone > > suggest a > > good resource that explains this? > > > > > > I thank you very much for any assistance you may be able to provide. > > > > > > Regards, > > Steve > > > > -- > > View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a- > function-tp4165464p4165464.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help at 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 code. > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at 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 code. From patrick.breheny at uky.edu Tue Dec 6 21:51:46 2011 From: patrick.breheny at uky.edu (Patrick Breheny) Date: Tue, 6 Dec 2011 15:51:46 -0500 Subject: [R] varaince explined of a regression tree using ctree In-Reply-To: References: Message-ID: <4EDE8062.50602@uky.edu> On 12/06/2011 03:05 PM, Antonio Punzon Merino wrote: > I would like know the way to calculate the variance explained of a > regression tree. I use the function "ctree" from library "party" ctree does not provide this information by default, but it is not difficult to calculate: X <- matrix(rnorm(100*10),ncol=10) y <- X%*%c(rep(2,5),rep(0,5))+rnorm(100) fit <- ctree(y~.,data=as.data.frame(X)) r <- y - predict(fit) 1-var(r)/var(y) -- Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky From matteo.richiardi at gmail.com Tue Dec 6 22:04:51 2011 From: matteo.richiardi at gmail.com (Matteo Richiardi) Date: Tue, 6 Dec 2011 22:04:51 +0100 Subject: [R] using StatEt IDE for Eclipse In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Tue Dec 6 22:06:06 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 16:06:06 -0500 Subject: [R] making changes to global variables in functions In-Reply-To: References: Message-ID: No pointer functionality in R (that I know of), but if you want to return two objects as one the standard way is to put them in a list and to return that list. Michael On Tue, Dec 6, 2011 at 2:35 PM, Yev wrote: > I'm trying to write a function that takes several objects with many > different attributes and then changes their attributes. So what I wanted to > happen in the simplified example below is for the function to change the > attributes of the objects state1 and state2 that are passed to it. But > because stateA and stateB are local, this isn't working. Are there any easy > solutions? > > e.g., if I could combine the two objects stateA and stateB into a single > object, I could return it and then assign it back to objects state1 and > state2. Or if I could pass a pointer to the original object.. But I cannot > find an easy way of doing either. ?Thanks in advance.. > > state1 <- list(n=100, won=0) > state2 <- list(n=100, won=0) > > fight2 <- function(stateA, stateB){ > ? stateA$n <- 50 > ? stateB$n <-50 > } > > fight2(state1,state2) > > state1$n > state2$n > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From millerlp at gmail.com Tue Dec 6 22:11:24 2011 From: millerlp at gmail.com (Luke Miller) Date: Tue, 6 Dec 2011 16:11:24 -0500 Subject: [R] using StatEt IDE for Eclipse In-Reply-To: References: Message-ID: You will likely find more help on the StatEt mailing list, since the author of the package monitors it: http://lists.r-forge.r-project.org/mailman/listinfo/statet-user On Tue, Dec 6, 2011 at 4:04 PM, Matteo Richiardi wrote: > > Hi, > I'm trying to use StatEt IDE for Eclipse as my R editor, but I'm completely > lost. I've read all I could find online, made apparently all I had to do > (installing rj, configuraing StatEt, etc.) but still cannot make R running. > Below is the error log file. > Thank you so much for assistance. > Matteo > > > !ENTRY de.walware.statet.r.console.ui 1 0 2011-12-05 16:21:51.355 > !MESSAGE Launching the R Console was cancelled, because it seems starting > the R engine failed. > Please make sure that R package 'rj' (1.0.0 or compatible) is installed and > that the R library paths are set correctly for the R environment > configuration 'R-2.14.0'. > !SESSION 2011-12-05 16:23:23.552 > ----------------------------------------------- > eclipse.buildId=M20110909-1335 > java.version=1.6.0_21 > java.vendor=Sun Microsystems Inc. > BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT > Command-line arguments: ?-os win32 -ws win32 -arch x86_64 > > !ENTRY org.eclipse.osgi 2 1 2011-12-05 16:23:29.901 > !MESSAGE NLS unused message: FindReplaceAction_label in: > de.walware.ecommons.ui.SharedMessages > > !ENTRY org.eclipse.ui 4 4 2011-12-05 16:23:30.712 > !MESSAGE Class load Failure: > 'org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem' > > !ENTRY org.eclipse.ui 4 0 2011-12-05 16:23:30.714 > !MESSAGE Class load Failure: > 'org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem' > !STACK 1 > org.eclipse.core.runtime.CoreException: Plug-in de.walware.ecommons.ltk.ui > was unable to load class > org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem. > ?at > org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194) > at > org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176) > ?at > org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905) > at > org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) > ?at > org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55) > at > org.eclipse.ui.internal.util.Util.safeLoadExecutableExtension(Util.java:879) > ?at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.createContributionItem(DynamicMenuContributionItem.java:222) > at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.getContributionItem(DynamicMenuContributionItem.java:215) > ?at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:195) > at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:741) > ?at org.eclipse.jface.action.MenuManager.update(MenuManager.java:822) > at org.eclipse.jface.action.MenuManager.update(MenuManager.java:682) > ?at > org.eclipse.ui.internal.menus.WorkbenchMenuService.updateManagers(WorkbenchMenuService.java:330) > at > org.eclipse.ui.internal.menus.WorkbenchMenuService$4.propertyChange(WorkbenchMenuService.java:316) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority$1.run(EvaluationAuthority.java:252) > at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority.fireServiceChange(EvaluationAuthority.java:246) > at > org.eclipse.ui.internal.services.EvaluationAuthority.endSourceChange(EvaluationAuthority.java:197) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:135) > at > org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311) > ?at > org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290) > at > org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:401) > at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:300) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.handleCheck(WorkbenchSourceProvider.java:286) > at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkOtherSources(WorkbenchSourceProvider.java:855) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:839) > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ?at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) > ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058) > ?at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1647) > at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2137) > ?at org.eclipse.swt.widgets.Control.windowProc(Control.java:4525) > at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) > ?at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1610) > at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2061) > ?at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972) > at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method) > ?at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:230) > at org.eclipse.swt.widgets.Shell.open(Shell.java:1217) > ?at org.eclipse.jface.window.Window.open(Window.java:797) > at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:818) > ?at > org.eclipse.ui.internal.Workbench$70.runWithException(Workbench.java:3719) > at > org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) > ?at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > at > org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) > ?at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140) > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) > ?at > org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) > at > org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1595) > ?at > org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) > at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > ?at > org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) > at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140) > ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) > at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) > ?at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) > at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) > ?at > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) > at > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) > ?at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > at > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) > ?at > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) > at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > ?at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) > ?at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ?at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > ?at java.lang.reflect.Method.invoke(Unknown Source) > at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) > ?at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) > at org.eclipse.equinox.launcher.Main.run(Main.java:1410) > ?at org.eclipse.equinox.launcher.Main.main(Main.java:1386) > Caused by: java.lang.ClassNotFoundException: > org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem > ?at > org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) > ?at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) > at > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) > ?at java.lang.ClassLoader.loadClass(Unknown Source) > at > org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345) > ?at > org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229) > at > org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207) > ?at > org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174) > ... 75 more > !SUBENTRY 1 org.eclipse.equinox.registry 4 1 2011-12-05 16:23:30.715 > !MESSAGE Plug-in de.walware.ecommons.ltk.ui was unable to load class > org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem. > !STACK 0 > java.lang.ClassNotFoundException: > org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem > at > org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) > ?at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) > ?at > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) > at java.lang.ClassLoader.loadClass(Unknown Source) > ?at > org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345) > at > org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229) > ?at > org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207) > at > org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174) > ?at > org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905) > at > org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) > ?at > org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55) > at > org.eclipse.ui.internal.util.Util.safeLoadExecutableExtension(Util.java:879) > ?at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.createContributionItem(DynamicMenuContributionItem.java:222) > at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.getContributionItem(DynamicMenuContributionItem.java:215) > ?at > org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:195) > at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:741) > ?at org.eclipse.jface.action.MenuManager.update(MenuManager.java:822) > at org.eclipse.jface.action.MenuManager.update(MenuManager.java:682) > ?at > org.eclipse.ui.internal.menus.WorkbenchMenuService.updateManagers(WorkbenchMenuService.java:330) > at > org.eclipse.ui.internal.menus.WorkbenchMenuService$4.propertyChange(WorkbenchMenuService.java:316) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority$1.run(EvaluationAuthority.java:252) > at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority.fireServiceChange(EvaluationAuthority.java:246) > at > org.eclipse.ui.internal.services.EvaluationAuthority.endSourceChange(EvaluationAuthority.java:197) > ?at > org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:135) > at > org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:311) > ?at > org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:290) > at > org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:401) > at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(WorkbenchSourceProvider.java:300) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.handleCheck(WorkbenchSourceProvider.java:286) > at > org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkOtherSources(WorkbenchSourceProvider.java:855) > ?at > org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:839) > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ?at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) > ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) > at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058) > ?at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1647) > at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2137) > ?at org.eclipse.swt.widgets.Control.windowProc(Control.java:4525) > at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) > ?at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1610) > at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2061) > ?at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972) > at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method) > ?at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:230) > at org.eclipse.swt.widgets.Shell.open(Shell.java:1217) > ?at org.eclipse.jface.window.Window.open(Window.java:797) > at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:818) > ?at > org.eclipse.ui.internal.Workbench$70.runWithException(Workbench.java:3719) > at > org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) > ?at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > at > org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) > ?at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140) > at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) > ?at > org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) > at > org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1595) > ?at > org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) > at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > ?at > org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) > at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140) > ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) > at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) > ?at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) > at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) > ?at > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) > at > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) > ?at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > at > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) > ?at > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) > at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > ?at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) > ?at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ?at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > ?at java.lang.reflect.Method.invoke(Unknown Source) > at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) > ?at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) > at org.eclipse.equinox.launcher.Main.run(Main.java:1410) > ?at org.eclipse.equinox.launcher.Main.main(Main.java:1386) > > !ENTRY de.walware.statet.r.ui 4 20100 2011-12-05 16:24:58.654 > !MESSAGE An error occurred while submitting R-Script to R. > !STACK 1 > org.eclipse.core.runtime.CoreException: No session of R is active in the > current workbench window. > at de.walware.statet.nico.ui.NicoUITools.accessTool(NicoUITools.java:137) > ?at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:178) > at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:166) > ?at > de.walware.statet.r.internal.debug.ui.RControllerCodeLaunchConnector.submit(RControllerCodeLaunchConnector.java:68) > at > de.walware.statet.r.launching.RCodeLaunching.runFileUsingCommand(RCodeLaunching.java:332) > ?at > de.walware.statet.r.internal.debug.ui.launcher.RunFileViaCommandHandler.execute(RunFileViaCommandHandler.java:175) > at > org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) > ?at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) > at > org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) > ?at > org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) > at > org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) > ?at > org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) > at > org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) > ?at > org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) > ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) > ?at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) > at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) > ?at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) > at > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) > ?at > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) > at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > ?at > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) > at > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) > ?at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > ?at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) > at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > ?at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) > at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) > ?at org.eclipse.equinox.launcher.Main.run(Main.java:1410) > at org.eclipse.equinox.launcher.Main.main(Main.java:1386) > !SUBENTRY 1 de.walware.statet.nico.ui 4 -1 2011-12-05 16:24:58.655 > !MESSAGE No session of R is active in the current workbench window. > > !ENTRY de.walware.statet.r.ui 4 20100 2011-12-05 16:25:01.268 > !MESSAGE An error occurred while submitting R-Script to R. > !STACK 1 > org.eclipse.core.runtime.CoreException: No session of R is active in the > current workbench window. > at de.walware.statet.nico.ui.NicoUITools.accessTool(NicoUITools.java:137) > ?at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:178) > at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:166) > ?at > de.walware.statet.r.internal.debug.ui.RControllerCodeLaunchConnector.submit(RControllerCodeLaunchConnector.java:68) > at > de.walware.statet.r.launching.RCodeLaunching.runFileUsingCommand(RCodeLaunching.java:332) > ?at > de.walware.statet.r.internal.debug.ui.launcher.RunFileViaCommandHandler.execute(RunFileViaCommandHandler.java:175) > at > org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) > ?at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) > at > org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) > ?at > org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) > at > org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) > ?at > org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) > at > org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) > ?at > org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) > ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) > ?at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) > at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) > ?at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) > at > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) > ?at > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) > at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > ?at > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) > at > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) > ?at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > ?at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) > at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > ?at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) > at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) > ?at org.eclipse.equinox.launcher.Main.run(Main.java:1410) > at org.eclipse.equinox.launcher.Main.main(Main.java:1386) > !SUBENTRY 1 de.walware.statet.nico.ui 4 -1 2011-12-05 16:25:01.268 > !MESSAGE No session of R is active in the current workbench window. > > !ENTRY de.walware.statet.r.ui 4 20100 2011-12-05 16:25:02.175 > !MESSAGE An error occurred while submitting selected R-code to R. > !STACK 1 > org.eclipse.core.runtime.CoreException: No session of R is active in the > current workbench window. > at de.walware.statet.nico.ui.NicoUITools.accessTool(NicoUITools.java:137) > ?at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:178) > at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:166) > ?at > de.walware.statet.r.internal.debug.ui.RControllerCodeLaunchConnector.submit(RControllerCodeLaunchConnector.java:68) > at > de.walware.statet.r.internal.debug.ui.RControllerCodeLaunchConnector.submit(RControllerCodeLaunchConnector.java:53) > ?at > de.walware.statet.r.launching.RCodeLaunching.runRCodeDirect(RCodeLaunching.java:417) > at > de.walware.statet.r.launching.RCodeLaunching.runRCodeDirect(RCodeLaunching.java:423) > ?at > de.walware.statet.r.internal.debug.ui.launcher.RunSelectionHandler.execute(RunSelectionHandler.java:76) > at > org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) > ?at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) > at > org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) > ?at > org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) > at > org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) > ?at > org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) > at > org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) > ?at > org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) > at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) > ?at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) > at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) > ?at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) > at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) > ?at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) > at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) > ?at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) > at > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) > ?at > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) > at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) > ?at > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) > at > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) > ?at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) > at > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) > ?at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) > at > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) > ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > ?at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) > at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) > ?at org.eclipse.equinox.launcher.Main.run(Main.java:1410) > at org.eclipse.equinox.launcher.Main.main(Main.java:1386) > !SUBENTRY 1 de.walware.statet.nico.ui 4 -1 2011-12-05 16:25:02.175 > !MESSAGE No session of R is active in the current workbench window. > > !ENTRY de.walware.statet.r.ui 4 20100 2011-12-05 16:25:02.666 > !MESSAGE An error occurred while submitting command to R. > !STACK 1 > org.eclipse.core.runtime.CoreException: No session of R is active in the > current workbench window. > at de.walware.statet.nico.ui.NicoUITools.accessTool(NicoUITools.java:137) > ?at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:178) > at > de.walware.statet.nico.ui.NicoUITools.accessController(NicoUITools.java:166) > ?at > de.walware.statet.r.internal.debug.ui.RControllerCodeLaunchConnector.submit(RControllerCodeLaunchConnector.java:68) > at > de.walware.statet.r.launching.RCodeLaunching.runRCodeDirect(RCodeLaunching.java:430) > ?at > de.walware.statet.r.internal.debug.ui.launcher.RunEntireCommandHandler.doLaunch(RunEntireCommandHandler.java:179) > at > de.walware.statet.r.internal.debug.ui.launcher.RunEntireCommandHandler$1.run(RunEntireCommandHandler.java:107) > ?at > org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) > !SUBENTRY 1 de.walware.statet.nico.ui 4 -1 2011-12-05 16:25:02.667 > !MESSAGE No session of R is active in the current workbench window. > > !ENTRY de.walware.statet.r.console.ui 1 0 2011-12-05 16:27:22.157 > !MESSAGE Launching the R Console was cancelled, because it seems starting > the R engine failed. > Please make sure that R package 'rj' (1.0.0 or compatible) is installed and > that the R library paths are set correctly for the R environment > configuration 'R-2.14.0'. > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- ___________________________ Luke Miller Postdoctoral Researcher Marine Science Center Northeastern University Nahant, MA (781) 581-7370 x318 From Greg.Snow at imail.org Tue Dec 6 22:17:29 2011 From: Greg.Snow at imail.org (Greg Snow) Date: Tue, 6 Dec 2011 14:17:29 -0700 Subject: [R] Change the limits of a plot "a posteriori" In-Reply-To: <1322763123687-4129750.post@n4.nabble.com> References: <1322763123687-4129750.post@n4.nabble.com> Message-ID: The zoomplot function in the TeachingDemos package can be used for this (it actually redoes the entire plot, but with new limits). This will generally work for a quick exploration, but for quality plots it is suggested to create the 1st plot with the correct range to begin with. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111 > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of jcano > Sent: Thursday, December 01, 2011 11:12 AM > To: r-help at r-project.org > Subject: [R] Change the limits of a plot "a posteriori" > > Hi all > > How can I change the limits (xlim or ylim) in a plot that has been > already > created? > > For example, consider this naive example > curve(dbeta(x,2,4)) > curve(dbeta(x,8,13),add=T,col=2) > > When adding the second curve, it goes off the original limits computed > by R > for the first graph, which are roughly, c(0,2.1) > > I know two obvious solutions for this, which are: > 1) passing a sufficiently large parameter e.g. ylim=c(0,4) to the first > graphic > curve(dbeta(x,2,4),ylim=c(0,4)) > curve(dbeta(x,8,13),add=T,col=2) > > or > > 2) switch the order in which I plot the curves > curve(dbeta(x,8,13),col=2) > curve(dbeta(x,2,4),add=T) > > but I guess if there is any way of adjusting the limits of the graphic > "a > posteriori", once you have a plot with the undesired limits, forcing R > to > redraw it with the new limits, but without having to execute again the > "curve" commands > > Hope I made myself clear > > Best regards and thank you very much in advance > > > -- > View this message in context: http://r.789695.n4.nabble.com/Change-the- > limits-of-a-plot-a-posteriori-tp4129750p4129750.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Tue Dec 6 23:14:52 2011 From: comtech.usa at gmail.com (Michael) Date: Tue, 6 Dec 2011 16:14:52 -0600 Subject: [R] any R-Revolution users here? How to make Revolution portable? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From memerrill at gmail.com Tue Dec 6 22:09:48 2011 From: memerrill at gmail.com (M. Emily Merrill) Date: Tue, 6 Dec 2011 16:09:48 -0500 Subject: [R] R 2.14 png X11 Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gleynes at gmail.com Tue Dec 6 22:33:36 2011 From: gleynes at gmail.com (Gene Leynes) Date: Tue, 6 Dec 2011 15:33:36 -0600 Subject: [R] read.table performance In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From savy_ss at yahoo.com Tue Dec 6 23:06:37 2011 From: savy_ss at yahoo.com (saveetha) Date: Tue, 6 Dec 2011 14:06:37 -0800 (PST) Subject: [R] SVM - predict function error handling In-Reply-To: Message-ID: <1323209197.66606.YahooMailClassic@web161301.mail.bf1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sachin.abeywardana at gmail.com Wed Dec 7 00:39:29 2011 From: sachin.abeywardana at gmail.com (Sachinthaka Abeywardana) Date: Wed, 7 Dec 2011 10:39:29 +1100 Subject: [R] configuring a package for own personal needs Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Wed Dec 7 01:02:35 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 19:02:35 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: You want a plot of s = sum(log(b^2 + (x-a)^2)) as a function of a or am I missing something? You do it just like any other R plot: pick some values of a, evaluate s for each of them (a little tricky if you use my vectorized version due to the implicit use of the recycling rule but very easy with your looped version)and plot(a, loglikelihood(a)). Of course, since log is monotonic, it's pretty easy to get an analytic solution for this. If you want to be more creative about the graph this would also work: x.fix <- c(-4.2, -2.85, -2.3, -1.02, 0.7, 0.98, 2.72, 3.5) b <- 0.1 curve(sum(log(b^2 + (x.fix - x)^2))) # Note that curve has to take a function of "x" so you have to rewrite it a little. Michael On Tue, Dec 6, 2011 at 10:40 AM, Gyanendra Pokharel wrote: > Yes Michael, it works well and I got the result what I want but it totally > depends on how reliable result do I want. When I take very high rho (near > about 1) and very low psi, it takes very long time may be it gives us more > accurate result. But for lower rho and higher psi, it gives immediately, and > very poor result. Now as I asked before, how I can get the plot of "a" > versus "s" which determines the cooling curve with the global minimum of s > at a specific value of a. > > On Tue, Dec 6, 2011 at 6:52 AM, R. Michael Weylandt > wrote: >> >> So I just ran your code verbatim with this one change and it finished >> in less than 10 seconds. However, even without the change it doesn't >> take more than 15 seconds: what exactly lead you to believe this was >> an infinite loop? >> >> Michael >> >> On Tue, Dec 6, 2011 at 12:03 AM, R. Michael Weylandt >> wrote: >> > Off the bat I'd suggest you vectorize loglikelihood as a simple one >> > liner: >> > >> > sum(log(b^2 + (x-a)^2)) >> > >> > That alone will speed up your function many times over: I'll look at the >> > big >> > function in more detail tomorrow. >> > >> > Michael >> > >> > On Dec 5, 2011, at 10:37 PM, Gyanendra Pokharel >> > wrote: >> > >> > Thanks Michael >> > Lets figure out the problem by using the following function. I found the >> > same problem in this code too. >> > >> > >> > loglikehood <- function(a, b = 0.1, x = c(-4.2, -2.85, -2.3, -1.02, 0.7, >> > 0.98, 2.72, 3.5)) >> > >> > { >> > >> > s <- 0 >> > >> > for(i in 1:length(x)){ >> > >> > s <- s + log(b^2 + (x[i] - a)^2) >> > >> > } >> > >> > s >> > >> > } >> > >> > loglikelihood(0.1) >> > >> > simann <- function(T0 = 1, N = 500, rho = 0.9, x0 = 0, eps = 0.1, f){ >> > >> > moving <- 1 >> > >> > count <- 0 >> > >> > Temp <- T0 >> > >> > x <- x0 >> > >> > while(moving > 0){ >> > >> > moving <- 0 >> > >> > for(i in 1:N){ >> > >> > y <- x + runif(1,-eps,eps) >> > >> > alpha <- min(1,exp((f(x) -f(y))/Temp)) >> > >> > if(runif(1)> > >> > moving <- moving +1 >> > >> > x <- y >> > >> > } >> > >> > } >> > >> > Temp <- Temp*rho >> > >> > count <- count + 1 >> > >> > } >> > >> > fmin <- f(x) >> > >> > return(c(x,fmin,count)) >> > >> > } >> > >> > simann(f = loglikelihood) >> > >> > I hope we can analyze every problems from this function >> > >> > On Mon, Dec 5, 2011 at 10:27 PM, R. Michael Weylandt >> > wrote: >> >> >> >> It's not necessarily equivalent to your "loglikelihood" function but >> >> since >> >> that function wasn't provided I couldn't test it. >> >> >> >> My broader point is this: you said the problem was that the loop ran >> >> endlessly: I showed it does not run endlessly for at least one input so >> >> at >> >> least part of the problem lies in loglikelihood, which, being >> >> unprovided, I >> >> have trouble replicating. >> >> >> >> My original guess still stands: it's either 1) a case of you getting >> >> stuck >> >> at probaccept = 1 or 2) so slow it just feels endless. ?Either way, my >> >> prescription is the same: print() >> >> >> >> Michael >> >> >> >> >> >> On Dec 5, 2011, at 9:30 PM, Gyanendra Pokharel >> >> wrote: >> >> >> >> Yes, your function out<- epiann(f = function(a,b) >> >> log(dnorm(a)*dnorm(b))), >> >> N = 10) works well. >> >> >> >> But?why you are changing the loglikelihood function to f = >> >> function(a,b) >> >> log(dnorm(a)*dnorm(b))? how it is equivalent to loglikelihood? is there >> >> any >> >> mathematical relation? ?I also want to see the plot of aout and bout >> >> versus >> >> loglikelihood, and see the cooling rate in different temperature. how >> >> is >> >> this possible? >> >> >> >> On Mon, Dec 5, 2011 at 6:07 PM, R. Michael Weylandt >> >> wrote: >> >>> >> >>> If you run >> >>> >> >>> out<- epiann(f = function(a,b) log(dnorm(a)*dnorm(b))), N = 10) >> >>> >> >>> It takes less than 0.5 seconds so there's no problem I can see: >> >>> perhaps you want to look elsewhere to get better speed (like Rcpp or >> >>> general vectorization), or maybe your loglikihood is not what's >> >>> desired, but there's no problem with the loop. >> >>> >> >>> Michael >> >>> >> >>> On Mon, Dec 5, 2011 at 5:29 PM, Gyanendra Pokharel >> >>> wrote: >> >>> > Yes, I checked the acceptprob, it is very high but in my view, the >> >>> > while >> >>> > loop is not stopping, so there is some thing wrong in the use of >> >>> > while >> >>> > loop. >> >>> > When I removed the while loop, it returned some thing but not the >> >>> > result >> >>> > what I want. When i run the while loop separately, it never stops. >> >>> > >> >>> > >> >>> > >> >>> > On Mon, Dec 5, 2011 at 5:18 PM, R. Michael Weylandt >> >>> > wrote: >> >>> >> >> >>> >> Your code is not reproducible nor minimal, but why don't you put a >> >>> >> command print(acceptprob) in and see if you are getting reasonable >> >>> >> values. If these values are extremely low it shouldn't surprise you >> >>> >> that your loop takes a long time to run. >> >>> >> >> >>> >> More generally, read up on the use of print() and browser() as >> >>> >> debugging >> >>> >> tools. >> >>> >> >> >>> >> Michael >> >>> >> >> >>> >> On Mon, Dec 5, 2011 at 3:47 PM, Gyanendra Pokharel >> >>> >> wrote: >> >>> >> > I forgot to upload the R-code in last email, so heare is one >> >>> >> > >> >>> >> > epiann <- function(T0 = 1, N=1000, ainit=1, binit=1,rho = 0.99, >> >>> >> > amean = >> >>> >> > 3, >> >>> >> > bmean=1.6, avar =.1, bvar=.1, f){ >> >>> >> > >> >>> >> > ? ? ? ?moving <- 1 >> >>> >> > ? ? ? ?count <- 0 >> >>> >> > ? ? ? ?Temp <- T0 >> >>> >> > ? ? ? ?aout <- ainit >> >>> >> > ? ? ? ?bout <- binit >> >>> >> > ? ? ? ?while(moving > 0){ >> >>> >> > ? ? ? ? ? ? ? ?moving <- 0 >> >>> >> > ? ? ? ? ? ? ? ?for (i in 1:N) { >> >>> >> > ? ? ? ? ? ? ? ?aprop <- rnorm (1,amean, avar) >> >>> >> > ? ? ? ? ? ? ? ?bprop <- rnorm (1,bmean, bvar) >> >>> >> > ? ? ? ? ? ? ? ?if (aprop > 0 & bprop > 0){ >> >>> >> > ? ? ? ? ? ? ? ?acceptprob <- min(1,exp((f(aout, bout) - >> >>> >> > f(aprop,bprop))/Temp)) >> >>> >> > ? ? ? ? ? ? ? ?u <- runif(1) >> >>> >> > ? ? ? ? ? ? ? ?if(u> >>> >> > ? ? ? ? ? ? ? ? ? ?moving <- moving +1 >> >>> >> > ? ? ? ? ? ? ? ? ? ?aout <- aprop >> >>> >> > ? ? ? ? ? ? ? ? ? ?bout <- bprop >> >>> >> > ? ? ? ? ? ? ? ? ? ?} >> >>> >> > ? ? ? ? ? ? ? ? ? ?else{aprob <- aout >> >>> >> > ? ? ? ? ? ? ? ? ? ? ? ?bprob <- bout} >> >>> >> > ? ? ? ? ? ? ? ?} >> >>> >> > ? ? ? ? ? ?} >> >>> >> > ? ? ? ?Temp <- Temp*rho >> >>> >> > ? ? ? ? ? ?count <- count +1 >> >>> >> > >> >>> >> > ? ?} >> >>> >> > ? ?fmin <- f(aout,bout) >> >>> >> > ? ?return(c(aout, bout,fmin, count) ) >> >>> >> > >> >>> >> > } >> >>> >> > out<- epiann(f = loglikelihood) >> >>> >> > >> >>> >> > On Mon, Dec 5, 2011 at 3:46 PM, Gyanendra Pokharel < >> >>> >> > gyanendra.pokharel at gmail.com> wrote: >> >>> >> > >> >>> >> >> Hi all, >> >>> >> >> I have the following code, >> >>> >> >> When I run the code, it never terminate this is because of the >> >>> >> >> while >> >>> >> >> loop >> >>> >> >> i am using. In general, if you need a loop for which you don't >> >>> >> >> know >> >>> >> >> in >> >>> >> >> advance how many iterations there will be, you can use the >> >>> >> >> `while' >> >>> >> >> statement so here too i don't know the number how many >> >>> >> >> iterations >> >>> >> >> are >> >>> >> >> there. So Can some one suggest me whats going on? >> >>> >> >> I am using the Metropolis simulated annealing algorithm >> >>> >> >> Best >> >>> >> >> >> >>> >> > >> >>> >> > ? ? ? ?[[alternative HTML version deleted]] >> >>> >> > >> >>> >> > ______________________________________________ >> >>> >> > R-help at 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 >> >>> >> > code. >> >>> > >> >>> > >> >> >> >> >> > > > From michael.weylandt at gmail.com Wed Dec 7 01:16:16 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 19:16:16 -0500 Subject: [R] configuring a package for own personal needs In-Reply-To: References: Message-ID: The easiest thing is probably to download source files from CRAN and edit the R code, which can be found in the R2Cuba_vvv/R/ directory (vvv is the version code), re-build and then you should be good permanently. I just looked at the source on my machine: very easily done, if you feel comfortable with the compiling which sounds like you are. Michael On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana wrote: > Hi All, > > There is a function in package "R2Cuba" called Cuhre that I need to use. It > keeps spitting out a new-line which I really dont want it to do. So I was > wondering what is the best way of configuring the package. I tried copying > and pasting the code into Cuhre2 and getting rid of the newline command BUT > that didn't work since it seems to have some private functions which I do > not have access to. > > So what is the best way of rewriting the package and compiling it (some of > the code is written in C). Note that I want to do some other configurations > besides the above mentioned (incase you were going to mention some sort of > noprint option). > > Thanks, > Sachin > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From cindy_zhou_08 at hotmail.com Wed Dec 7 01:17:25 2011 From: cindy_zhou_08 at hotmail.com (Ying Zhou) Date: Tue, 6 Dec 2011 19:17:25 -0500 Subject: [R] import a dataset from Access database into R Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jholtman at gmail.com Wed Dec 7 01:29:42 2011 From: jholtman at gmail.com (jim holtman) Date: Tue, 6 Dec 2011 19:29:42 -0500 Subject: [R] configuring a package for own personal needs In-Reply-To: References: Message-ID: Where is it spitting out the new-line to? Can you just capture the output and then remove the last new-line; easier than rewriting the function. Here is one way of doing it: > f.x <- function()cat('this is\n\n output\n with\n an extra linefeed at the end\n\n') > f.x() # has the extra line-feed this is output with an extra linefeed at the end > x <- capture.output(f.x()) # capture the output > # print it > cat(x, sep = '\n') this is output with an extra linefeed at the end > # remove the extra linefeed at the end > cat(head(x, -1), sep = '\n') # now it is gone this is output with an extra linefeed at the end > > On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana wrote: > Hi All, > > There is a function in package "R2Cuba" called Cuhre that I need to use. It > keeps spitting out a new-line which I really dont want it to do. So I was > wondering what is the best way of configuring the package. I tried copying > and pasting the code into Cuhre2 and getting rid of the newline command BUT > that didn't work since it seems to have some private functions which I do > not have access to. > > So what is the best way of rewriting the package and compiling it (some of > the code is written in C). Note that I want to do some other configurations > besides the above mentioned (incase you were going to mention some sort of > noprint option). > > Thanks, > Sachin > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From jholtman at gmail.com Wed Dec 7 01:34:30 2011 From: jholtman at gmail.com (jim holtman) Date: Tue, 6 Dec 2011 19:34:30 -0500 Subject: [R] import a dataset from Access database into R In-Reply-To: References: Message-ID: Yo need to provide a lot more information. For example, how large is the dataset you are trying to read (how many row/columns). I assume that you are running under Windows probably with a 32-bit version of R, but who knows. How big are the rest of the objects that you have in your global environment? I am assuming that you have reached the maximum memory for your 32-bit version. You can always try running on a 64-bit version with more memory. Also depending on how big the dataset is, you might read it in parts, but it is hard to say without following the posting guidelines. On Tue, Dec 6, 2011 at 7:17 PM, Ying Zhou wrote: > > > > Hi > > I was trying to import a dataset from access database > into R > > My code looks like below > >>library(RODBC) > >>setwd("//STATESFPSOP1/docs/CRMPO/DEPT/Retail > PD") > >>channel<-odbcConnectAccess("MortgagePD.mdb") > > >>Mdata<-sqlFetch(channel, "MortgagePD") > > But I got error messages saying > > Error: cannot allocate vector of > size 27.9 Mb > > In addition: Warning messages: > > 1: In names(value) <- > make.unique(colnames) : > > ?Reached total allocation > of 1535Mb: see help(memory.size) > > ?.. > > Then I tried to increase the memory size and import the > data again > >>memory.limit(size=2000) > > However ?I still got the same error message like > below > > Error: cannot allocate vector of > size 27.9 Mb > > Can someone please help me solve this problem? Thanks so > much in advance. > > > Cindy > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From bbolker at gmail.com Wed Dec 7 02:48:51 2011 From: bbolker at gmail.com (Ben Bolker) Date: Wed, 7 Dec 2011 01:48:51 +0000 Subject: [R] the estimated random effects for each level of grouping References: <1323165732784-4164111.post@n4.nabble.com> Message-ID: stat999 gmail.com> writes: > Hi, I am a quite beginner of random effect modelling. > Sorry for my ignorant question. No problem, but this question is more appropriate for the r-sig-mixed-models at r-project.org mailing list ... > My question is about the values of lme function. > It returns coefficients which is a list with two components. > The R-help file says that it returns the estimated random effects for each > level of grouping. > > What is the estimator of this random effects in R? > > Since the random effects are random variables so this "estimate" should be > something like mean or mode of the density of the random effect given data, > f_i(b_i|y_i).... Yes. In the case of lme, which does linear mixed models, I believe the mean and mode of the conditional density are the same. But you may get better/more complete answers on the other mailing list. From sachin.abeywardana at gmail.com Wed Dec 7 03:27:33 2011 From: sachin.abeywardana at gmail.com (Sachinthaka Abeywardana) Date: Wed, 7 Dec 2011 13:27:33 +1100 Subject: [R] configuring a package for own personal needs In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From gyanendra.pokharel at gmail.com Wed Dec 7 03:47:59 2011 From: gyanendra.pokharel at gmail.com (Gyanendra Pokharel) Date: Tue, 6 Dec 2011 21:47:59 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jdnewmil at dcn.davis.ca.us Wed Dec 7 04:22:03 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Tue, 06 Dec 2011 22:22:03 -0500 Subject: [R] configuring a package for own personal needs In-Reply-To: References: Message-ID: RTFM. (Writing R Extensions. It comes with R.) Since you are asking this question I will hazard a guess that you are on Windows, and will want to install RTools per that documentation. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Sachinthaka Abeywardana wrote: >Hi Michael/ everyone, > >I guess a big part of the question was also how would you compile >(remember >that some of the code is written in C)? Any recommended tutorials on >this? > >Sachin > >On Wed, Dec 7, 2011 at 11:16 AM, R. Michael Weylandt < >michael.weylandt at gmail.com> wrote: > >> The easiest thing is probably to download source files from CRAN and >> edit the R code, which can be found in the R2Cuba_vvv/R/ directory >> (vvv is the version code), re-build and then you should be good >> permanently. I just looked at the source on my machine: very easily >> done, if you feel comfortable with the compiling which sounds like >you >> are. >> >> Michael >> >> On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana >> wrote: >> > Hi All, >> > >> > There is a function in package "R2Cuba" called Cuhre that I need to >use. >> It >> > keeps spitting out a new-line which I really dont want it to do. So >I was >> > wondering what is the best way of configuring the package. I tried >> copying >> > and pasting the code into Cuhre2 and getting rid of the newline >command >> BUT >> > that didn't work since it seems to have some private functions >which I do >> > not have access to. >> > >> > So what is the best way of rewriting the package and compiling it >(some >> of >> > the code is written in C). Note that I want to do some other >> configurations >> > besides the above mentioned (incase you were going to mention some >sort >> of >> > noprint option). >> > >> > Thanks, >> > Sachin >> > >> > [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. >> > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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 code. From michael.weylandt at gmail.com Wed Dec 7 05:09:40 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 23:09:40 -0500 Subject: [R] To Try or to TryCatch, I have tried to long In-Reply-To: <506F591A54F21D4480EE337F77369C056B10086B@LCEXG03.lc100.net> References: <1323191476006-4165578.post@n4.nabble.com> <506F591A54F21D4480EE337F77369C056B100869@LCEXG03.lc100.net> <506F591A54F21D4480EE337F77369C056B10086B@LCEXG03.lc100.net> Message-ID: This also might be of help: http://mazamascience.com/WorkingWithData/?p=912 Michael On Tue, Dec 6, 2011 at 3:02 PM, ROLL Josh F wrote: > ?Thank for the links. ?I reread one I found yesterday about changing the options parameter to options(warn = 2) and that allows the try() function to see a warning the same way as an error so problem solved using the existing code. > > Cheers, > ?Josh > > -----Original Message----- > From: William Dunlap [mailto:wdunlap at tibco.com] > Sent: Tuesday, December 06, 2011 11:42 AM > To: gleynes+r at gmail.com; ROLL Josh F > Cc: r-help at r-project.org > Subject: RE: [R] To Try or to TryCatch, I have tried to long > > Or, Google for 'R catching warnings' and third entry is the excellent > ?http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/ > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -----Original Message----- >> From: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] On Behalf Of William Dunlap >> Sent: Tuesday, December 06, 2011 11:38 AM >> To: gleynes+r at gmail.com; ROLL Josh F >> Cc: r-help at r-project.org >> Subject: Re: [R] To Try or to TryCatch, I have tried to long >> >> Look at the archives of this mailing list for a discussion entitled >> 'Stack trace?' on Nov 9-10 of this year. >> >> Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >> > -----Original Message----- >> > From: r-help-bounces at r-project.org >> > [mailto:r-help-bounces at r-project.org] On Behalf Of Gene Leynes >> > Sent: Tuesday, December 06, 2011 10:58 AM >> > To: ROLL Josh F >> > Cc: r-help at r-project.org >> > Subject: Re: [R] To Try or to TryCatch, I have tried to long >> > >> > I've had the same problem in other cases. >> > >> > Does anyone know how to catch warnings as well as errors? >> > >> > On Tue, Dec 6, 2011 at 12:34 PM, ROLL Josh F wrote: >> > >> > > ** >> > > Agreed. ?But what I am trying to control is when I get a warning. >> > > I want to do something different if a warning OR an error pop up? ?Any ideas? >> > > >> > > Cheers >> > > >> > > ?------------------------------ >> > > *From:* gleynes at gmail.com [mailto:gleynes at gmail.com] *On Behalf Of >> > > *Gene Leynes >> > > *Sent:* Tuesday, December 06, 2011 10:27 AM >> > > *To:* ROLL Josh F >> > > *Cc:* r-help at r-project.org >> > > *Subject:* Re: [R] To Try or to TryCatch, I have tried to long >> > > >> > > I think the problem is that it's only a warning and not an error. >> > > >> > > result_<-list() >> > > for(i in 1:10){ >> > > ? ? ?if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ >> > > ? ? ?#If sqrt fails >> > > ? ? ?cat('fail',i,'\n') >> > > ? ? ?result_[[i]]<-0 } else { >> > > ? ? ?#If sqrt succeeds >> > > ? ? ?cat('succeed',i,'\n') >> > > ? ? ?result_[[i]] <- 1 } >> > > } >> > > result_ >> > > >> > > On Tue, Dec 6, 2011 at 11:11 AM, LCOG1 wrote: >> > > >> > >> So after about 4 hours struggling with Try and TryCatch I am >> > >> throwing in the towel. ?I have a more complicated function that >> > >> used logspline through iterative distributions and at some point >> > >> the logspline doesnt function correctly for some subsets but is >> > >> fine with others so I need to be able to identify when the error >> > >> occurs and stop curtailing the distribution and I think this Try >> > >> or TryCatch should do the trick but I think I am missing >> > >> something here. A simple example >> > >> >> > >> >> > >> result_<-list() >> > >> for(i in 1:10){ >> > >> ? ? ? ? ?if(inherits(try(sqrt(9-i),silent=TRUE),"try-error")){ >> > >> ? ? ? ? ? ? ? ?#If sqrt fails >> > >> ? ? ? ? ? ? ? ?result_[[i]]<-0 } else { >> > >> ? ? ? ? ? ? ? ?#If sqrt succeeds >> > >> ? ? ? ? ? ? ? ?result_[[i]] <- 1 } } >> > >> >> > >> >> > >> I would expect this to fail only when i > 9 but succeeds ?each time. ?DO i >> > >> need to specify something different where "try-error" resides? ?Thanks >> > >> guys >> > >> >> > >> Cheers, >> > >> ?Josh >> > >> >> > >> >> > >> -- >> > >> View this message in context: >> > >> http://r.789695.n4.nabble.com/To-Try-or-to-TryCatch-I-have-tried-to-long-tp4165578p4165578.html >> > >> Sent from the R help mailing list archive at Nabble.com. >> > >> >> > >> ______________________________________________ >> > >> R-help at 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 code. >> > >> >> > > >> > > >> > >> > ? ? [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Wed Dec 7 05:14:04 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 23:14:04 -0500 Subject: [R] Problem in while loop In-Reply-To: References: <7DEC6BA8-EBF6-4F11-930E-4BBBA8340D47@gmail.com> Message-ID: I'm not here to walk you through learning how to plot: but once again does this work? curve(loglikelihood(x, bout = 0.1)) If you want to plot a function of two independent variables, you'll have to look into the various ways of doing so. Please do read section 12 of "An Introduction to R" which you can access by typing help.start() at the prompt for the basics of graphics in R. Michael On Tue, Dec 6, 2011 at 9:47 PM, Gyanendra Pokharel wrote: > > Thanks Michael, > I am able to find the very nice plot of the function we discussed but still > have the problem of ploting the? function loglikelihood(aout,bout) versus > aout posted in the initial massage. > Best > On Tue, Dec 6, 2011 at 10:40 AM, Gyanendra Pokharel > wrote: >> >> Yes Michael, it works well and I got the result what I want but it totally >> depends on how reliable result do I want. When I take very high rho (near >> about 1) and very low psi, it takes very long time may be it gives us more >> accurate result. But for lower rho and higher psi, it gives immediately, and >> very poor result. Now as I asked before, how I can get the plot of "a" >> versus "s" which determines the cooling curve with the global minimum of s >> at a specific value of a. >> >> >> On Tue, Dec 6, 2011 at 6:52 AM, R. Michael Weylandt >> wrote: >>> >>> So I just ran your code verbatim with this one change and it finished >>> in less than 10 seconds. However, even without the change it doesn't >>> take more than 15 seconds: what exactly lead you to believe this was >>> an infinite loop? >>> >>> Michael >>> >>> On Tue, Dec 6, 2011 at 12:03 AM, R. Michael Weylandt >>> wrote: >>> > Off the bat I'd suggest you vectorize loglikelihood as a simple one >>> > liner: >>> > >>> > sum(log(b^2 + (x-a)^2)) >>> > >>> > That alone will speed up your function many times over: I'll look at >>> > the big >>> > function in more detail tomorrow. >>> > >>> > Michael >>> > >>> > On Dec 5, 2011, at 10:37 PM, Gyanendra Pokharel >>> > wrote: >>> > >>> > Thanks Michael >>> > Lets figure out the problem by using the following function. I found >>> > the >>> > same problem in this code too. >>> > >>> > >>> > loglikehood <- function(a, b = 0.1, x = c(-4.2, -2.85, -2.3, -1.02, >>> > 0.7, >>> > 0.98, 2.72, 3.5)) >>> > >>> > { >>> > >>> > s <- 0 >>> > >>> > for(i in 1:length(x)){ >>> > >>> > s <- s + log(b^2 + (x[i] - a)^2) >>> > >>> > } >>> > >>> > s >>> > >>> > } >>> > >>> > loglikelihood(0.1) >>> > >>> > simann <- function(T0 = 1, N = 500, rho = 0.9, x0 = 0, eps = 0.1, f){ >>> > >>> > moving <- 1 >>> > >>> > count <- 0 >>> > >>> > Temp <- T0 >>> > >>> > x <- x0 >>> > >>> > while(moving > 0){ >>> > >>> > moving <- 0 >>> > >>> > for(i in 1:N){ >>> > >>> > y <- x + runif(1,-eps,eps) >>> > >>> > alpha <- min(1,exp((f(x) -f(y))/Temp)) >>> > >>> > if(runif(1)>> > >>> > moving <- moving +1 >>> > >>> > x <- y >>> > >>> > } >>> > >>> > } >>> > >>> > Temp <- Temp*rho >>> > >>> > count <- count + 1 >>> > >>> > } >>> > >>> > fmin <- f(x) >>> > >>> > return(c(x,fmin,count)) >>> > >>> > } >>> > >>> > simann(f = loglikelihood) >>> > >>> > I hope we can analyze every problems from this function >>> > >>> > On Mon, Dec 5, 2011 at 10:27 PM, R. Michael Weylandt >>> > wrote: >>> >> >>> >> It's not necessarily equivalent to your "loglikelihood" function but >>> >> since >>> >> that function wasn't provided I couldn't test it. >>> >> >>> >> My broader point is this: you said the problem was that the loop ran >>> >> endlessly: I showed it does not run endlessly for at least one input >>> >> so at >>> >> least part of the problem lies in loglikelihood, which, being >>> >> unprovided, I >>> >> have trouble replicating. >>> >> >>> >> My original guess still stands: it's either 1) a case of you getting >>> >> stuck >>> >> at probaccept = 1 or 2) so slow it just feels endless. ?Either way, my >>> >> prescription is the same: print() >>> >> >>> >> Michael >>> >> >>> >> >>> >> On Dec 5, 2011, at 9:30 PM, Gyanendra Pokharel >>> >> wrote: >>> >> >>> >> Yes, your function out<- epiann(f = function(a,b) >>> >> log(dnorm(a)*dnorm(b))), >>> >> N = 10) works well. >>> >> >>> >> But?why you are changing the loglikelihood function to f = >>> >> function(a,b) >>> >> log(dnorm(a)*dnorm(b))? how it is equivalent to loglikelihood? is >>> >> there any >>> >> mathematical relation? ?I also want to see the plot of aout and bout >>> >> versus >>> >> loglikelihood, and see the cooling rate in different temperature. how >>> >> is >>> >> this possible? >>> >> >>> >> On Mon, Dec 5, 2011 at 6:07 PM, R. Michael Weylandt >>> >> wrote: >>> >>> >>> >>> If you run >>> >>> >>> >>> out<- epiann(f = function(a,b) log(dnorm(a)*dnorm(b))), N = 10) >>> >>> >>> >>> It takes less than 0.5 seconds so there's no problem I can see: >>> >>> perhaps you want to look elsewhere to get better speed (like Rcpp or >>> >>> general vectorization), or maybe your loglikihood is not what's >>> >>> desired, but there's no problem with the loop. >>> >>> >>> >>> Michael >>> >>> >>> >>> On Mon, Dec 5, 2011 at 5:29 PM, Gyanendra Pokharel >>> >>> wrote: >>> >>> > Yes, I checked the acceptprob, it is very high but in my view, the >>> >>> > while >>> >>> > loop is not stopping, so there is some thing wrong in the use of >>> >>> > while >>> >>> > loop. >>> >>> > When I removed the while loop, it returned some thing but not the >>> >>> > result >>> >>> > what I want. When i run the while loop separately, it never stops. >>> >>> > >>> >>> > >>> >>> > >>> >>> > On Mon, Dec 5, 2011 at 5:18 PM, R. Michael Weylandt >>> >>> > wrote: >>> >>> >> >>> >>> >> Your code is not reproducible nor minimal, but why don't you put a >>> >>> >> command print(acceptprob) in and see if you are getting reasonable >>> >>> >> values. If these values are extremely low it shouldn't surprise >>> >>> >> you >>> >>> >> that your loop takes a long time to run. >>> >>> >> >>> >>> >> More generally, read up on the use of print() and browser() as >>> >>> >> debugging >>> >>> >> tools. >>> >>> >> >>> >>> >> Michael >>> >>> >> >>> >>> >> On Mon, Dec 5, 2011 at 3:47 PM, Gyanendra Pokharel >>> >>> >> wrote: >>> >>> >> > I forgot to upload the R-code in last email, so heare is one >>> >>> >> > >>> >>> >> > epiann <- function(T0 = 1, N=1000, ainit=1, binit=1,rho = 0.99, >>> >>> >> > amean = >>> >>> >> > 3, >>> >>> >> > bmean=1.6, avar =.1, bvar=.1, f){ >>> >>> >> > >>> >>> >> > ? ? ? ?moving <- 1 >>> >>> >> > ? ? ? ?count <- 0 >>> >>> >> > ? ? ? ?Temp <- T0 >>> >>> >> > ? ? ? ?aout <- ainit >>> >>> >> > ? ? ? ?bout <- binit >>> >>> >> > ? ? ? ?while(moving > 0){ >>> >>> >> > ? ? ? ? ? ? ? ?moving <- 0 >>> >>> >> > ? ? ? ? ? ? ? ?for (i in 1:N) { >>> >>> >> > ? ? ? ? ? ? ? ?aprop <- rnorm (1,amean, avar) >>> >>> >> > ? ? ? ? ? ? ? ?bprop <- rnorm (1,bmean, bvar) >>> >>> >> > ? ? ? ? ? ? ? ?if (aprop > 0 & bprop > 0){ >>> >>> >> > ? ? ? ? ? ? ? ?acceptprob <- min(1,exp((f(aout, bout) - >>> >>> >> > f(aprop,bprop))/Temp)) >>> >>> >> > ? ? ? ? ? ? ? ?u <- runif(1) >>> >>> >> > ? ? ? ? ? ? ? ?if(u>> >>> >> > ? ? ? ? ? ? ? ? ? ?moving <- moving +1 >>> >>> >> > ? ? ? ? ? ? ? ? ? ?aout <- aprop >>> >>> >> > ? ? ? ? ? ? ? ? ? ?bout <- bprop >>> >>> >> > ? ? ? ? ? ? ? ? ? ?} >>> >>> >> > ? ? ? ? ? ? ? ? ? ?else{aprob <- aout >>> >>> >> > ? ? ? ? ? ? ? ? ? ? ? ?bprob <- bout} >>> >>> >> > ? ? ? ? ? ? ? ?} >>> >>> >> > ? ? ? ? ? ?} >>> >>> >> > ? ? ? ?Temp <- Temp*rho >>> >>> >> > ? ? ? ? ? ?count <- count +1 >>> >>> >> > >>> >>> >> > ? ?} >>> >>> >> > ? ?fmin <- f(aout,bout) >>> >>> >> > ? ?return(c(aout, bout,fmin, count) ) >>> >>> >> > >>> >>> >> > } >>> >>> >> > out<- epiann(f = loglikelihood) >>> >>> >> > >>> >>> >> > On Mon, Dec 5, 2011 at 3:46 PM, Gyanendra Pokharel < >>> >>> >> > gyanendra.pokharel at gmail.com> wrote: >>> >>> >> > >>> >>> >> >> Hi all, >>> >>> >> >> I have the following code, >>> >>> >> >> When I run the code, it never terminate this is because of the >>> >>> >> >> while >>> >>> >> >> loop >>> >>> >> >> i am using. In general, if you need a loop for which you don't >>> >>> >> >> know >>> >>> >> >> in >>> >>> >> >> advance how many iterations there will be, you can use the >>> >>> >> >> `while' >>> >>> >> >> statement so here too i don't know the number how many >>> >>> >> >> iterations >>> >>> >> >> are >>> >>> >> >> there. So Can some one suggest me whats going on? >>> >>> >> >> I am using the Metropolis simulated annealing algorithm >>> >>> >> >> Best >>> >>> >> >> >>> >>> >> > >>> >>> >> > ? ? ? ?[[alternative HTML version deleted]] >>> >>> >> > >>> >>> >> > ______________________________________________ >>> >>> >> > R-help at 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 >>> >>> >> > code. >>> >>> > >>> >>> > >>> >> >>> >> >>> > >> >> > From michael.weylandt at gmail.com Wed Dec 7 05:22:37 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Tue, 6 Dec 2011 23:22:37 -0500 Subject: [R] Plotting Time Series Data by Month In-Reply-To: <1323125906801-4162534.post@n4.nabble.com> References: <1323125906801-4162534.post@n4.nabble.com> Message-ID: Your data set is not reproducible from an image (use dput() on your next post to give us a taste of your data) but I'll hazard it's a ts class object. If so, try this: X <- ts( sample(500, 204), frequency = 12, start = 1995) plot( rep(1:12, 17), X, col = rep(1:17, each = 12), xaxt = "n", xlab = "Months", pch = 20) axis(1, at = 1:12, label = month.abb, padj = 0) legend("bottom", pch = 20, col = 1:17, label = 1995:2011, horiz = TRUE) as a start. You can add the grid lines with (among others) the abline function's h argument. Michael On Mon, Dec 5, 2011 at 5:58 PM, crazedruff wrote: > Hi, > > I have a dataset which includes monthly data for 17 years. I want to be able > to see the monthly data behavior for the period of all 17 years. > > What my data looks like: > > http://r.789695.n4.nabble.com/file/n4162534/data.jpg > > I would like to represent the data in a graph such as the one below: > > http://r.789695.n4.nabble.com/file/n4162534/Untitled-2.jpg > > Any help would be appreciated. > > Thanks! > > -- > View this message in context: http://r.789695.n4.nabble.com/Plotting-Time-Series-Data-by-Month-tp4162534p4162534.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From asl87501 at earthlink.net Wed Dec 7 01:36:35 2011 From: asl87501 at earthlink.net (alan lapedes) Date: Tue, 6 Dec 2011 17:36:35 -0700 (GMT-07:00) Subject: [R] scatterplotting stock returns using quantmod and pairs() Message-ID: <25158300.1323218195787.JavaMail.root@elwamui-norfolk.atl.sa.earthlink.net> I want to get data for a set of ticker symbols and compute the daily return of the adjusted close using quantmod, and then scatterplot returns using pairs(). The following gets data for the list of tickers: tickers <- c("SHY","TLT","SPY","IWM","GLD","IEV","ILF","EWJ","EPP","SAF","ASA") AdjClosePrices <- do.call(merge, lapply(tickers, function(x) Ad(get(x)))) #get adjusted close prices First try at getting returns and plotting: AdjCloseReturns <- do.call(merge, lapply(tickers, function(x) dailyReturn(Ad(get(x))) )) But the resulting pairs plot pairs(data.matrix(AdjCloseReturns),cex=0.01) has uninformative text "daily.returns" down the diag on the plot. Second try at getting returns and plotting: using lapply instead AdjCloseReturns <- lapply(AdjClosePrices,dailyReturn) head(AdjCloseReturns) this prints long columns of numbers (not what I expected) but at least I see a ticker symbol e.g: $IEV.Adjusted daily.returns 2001-03-01 0.0000000000 2001-03-02 0.0037147103 2001-03-05 0.0088823094 However trying to plot: pairs(data.matrix(AdjCloseReturns),cex=0.01) gives error: Error in pairs.default(data.matrix(AdjCloseReturns), cex = 0.01) : non-numeric argument to 'pairs' Any insight would be appreciated: I want to scatterplot the returns for a set of tickers using pairs() with the ticker symbol info down the diag (and would be nice to also have scatterplot on lower panel and the numerical correlation on upper panel) Thanks! From searl at vt.edu Tue Dec 6 23:53:51 2011 From: searl at vt.edu (Steve E.) Date: Tue, 6 Dec 2011 14:53:51 -0800 (PST) Subject: [R] help wrapping findInterval into a function In-Reply-To: References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> Message-ID: <1323212031194-4166826.post@n4.nabble.com> Bill (and David), Thank you very much for taking the time to respond to my query. You were right, I was creating and calling the function exactly as you had predicted. I revised the structure based on your suggestion. It runs but the output is an array of the flags that are not attached to the data frame, not a new column in the data frame as was my intention. So, the new configuration I tried was like this (where DataFrame is not a real data frame but just the word "DataFrame"): WQFlags <- function(DataFrame) {DataFrame$CalciumFlag <- with(DataFrame, ifelse(variable == "CaD_ICP", (dataqualifier <- c("Y", 'Q', "", "A") [findInterval(DataFrame$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) } I called it using: WaterQualityData <- WQFlags(WaterQualityData) Again, the output is simply an array of the flags, unattached to a data frame. Can you suggest a way to modify this to make it work as desired, or, in the worst case, can I attach the resulting array of flag values? Thank you again! -- View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4166826.html Sent from the R help mailing list archive at Nabble.com. From ablankertz at earthlink.net Wed Dec 7 00:02:34 2011 From: ablankertz at earthlink.net (ablankertz) Date: Tue, 6 Dec 2011 15:02:34 -0800 (PST) Subject: [R] Trouble with mlogit.data Message-ID: <1323212554708-4166866.post@n4.nabble.com> I've got data in the form of rec policyno reason2 uwclass sexx term band 1 1 17B356313 IS S M 30 2 2 2 17B356326 IS P M 20 3 when I use > mydata<-mlogit.data(poldata, choice="reason2", shape = "wide", reflevel="IS") the result is rec policyno reason2 uwclass sexx term band chid alt 1. 1 17B356313 FALSE S M 30 2 1 1.DE 1 17B356313 FALSE S M 30 2 1 DE 1.IS 1 17B356313 TRUE S M 30 2 1 IS 1.NT 1 17B356313 FALSE S M 30 2 1 NT 2. 2 17B356326 FALSE P M 20 3 2 2.DE 2 17B356326 FALSE P M 20 3 2 DE 2.IS 2 17B356326 TRUE P M 20 3 2 IS 2.NT 2 17B356326 FALSE P M 20 3 2 NT I've tried using mydata<-mlogit.data(poldata, choice="reason2", shape = "tall", alt.levels = c("IS", "DE", "NT")) but just get an error message. Any ideas? -- View this message in context: http://r.789695.n4.nabble.com/Trouble-with-mlogit-data-tp4166866p4166866.html Sent from the R help mailing list archive at Nabble.com. From frostygoat at gmail.com Wed Dec 7 01:25:29 2011 From: frostygoat at gmail.com (Frostygoat) Date: Tue, 6 Dec 2011 16:25:29 -0800 (PST) Subject: [R] Rank samples by breaks in hist and assign result as factor Message-ID: Hi R users, My goal is to rank my samples according to how they fall out in a histogram with 10 bins to produce a ranking for each sample according to where it falls on the histogram, with a "1" to represent one tail of the hist, a "10" to represent the other tail, and a "5" for the median/mean. I have a number of different data sets to do this with and in all cases I need this ranking between1-10 regardless of the number of samples in each set. e.g., x=rnorm(50) h=hist(x,breaks=10) h$breaks [1] -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 So, I want to add a factor to x where if x is less than -2.0, then new factor="1"; if x is greater than -2.0 but x is less than -1.5, then new factor="2", etc. rank doesn't seem to help Any tips? Thanks much. From Dave.Messmer at ec.gc.ca Wed Dec 7 01:46:49 2011 From: Dave.Messmer at ec.gc.ca (Messmer,Dave [Sas]) Date: Tue, 6 Dec 2011 18:46:49 -0600 Subject: [R] glmmADMB not available on r-forge? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From egpivo at gmail.com Wed Dec 7 03:40:06 2011 From: egpivo at gmail.com (JosephWang) Date: Tue, 6 Dec 2011 18:40:06 -0800 (PST) Subject: [R] How to fit the log Gaussian Cox process model Message-ID: <1323225606638-4167430.post@n4.nabble.com> Hi, As far as I know, there exist some programs via the function INLA, but I'm so curious if there is a specific function directly used to fit the log Gaussian Cox process model and predict the latent Gaussian field. That is, if I have a data points, then I input it in the function and don't need to revise the program. Thanks for your help. Joseph -- View this message in context: http://r.789695.n4.nabble.com/How-to-fit-the-log-Gaussian-Cox-process-model-tp4167430p4167430.html Sent from the R help mailing list archive at Nabble.com. From wendy2.qiao at gmail.com Wed Dec 7 04:45:37 2011 From: wendy2.qiao at gmail.com (Wendy) Date: Tue, 6 Dec 2011 19:45:37 -0800 (PST) Subject: [R] questions about scatterplotMatrix Message-ID: <1323229537113-4167576.post@n4.nabble.com> Hi all, I want to plot some data with scatterplotMatrix. I want to set all axis limits of all the sub figures the same, also add abline(0,1) to all the sub figures. Using the code following code, I can only add abline to the first off-diagonal figure, and I did not figure out how to set all the axis limits the same. scatterplotMatrix(~ income + education + prestige, smooth = FALSE,transform=FALSE, data=Duncan,robust=TRUE,diagonal="none",plot.points = TRUE,reg.line=abline(0,1)) Does anybody know how to achieve this? Any advice is appreciated. Thank you. Wendy -- View this message in context: http://r.789695.n4.nabble.com/questions-about-scatterplotMatrix-tp4167576p4167576.html Sent from the R help mailing list archive at Nabble.com. From dwinsemius at comcast.net Wed Dec 7 05:47:24 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Tue, 6 Dec 2011 23:47:24 -0500 Subject: [R] Rank samples by breaks in hist and assign result as factor In-Reply-To: References: Message-ID: On Dec 6, 2011, at 7:25 PM, Frostygoat wrote: > Hi R users, > > My goal is to rank my samples according to how they fall out in a > histogram with 10 bins to produce a ranking for each sample according > to where it falls on the histogram, with a "1" to represent one tail > of the hist, a "10" to represent the other tail, and a "5" for the > median/mean. I have a number of different data sets to do this with > and in all cases I need this ranking between1-10 regardless of the > number of samples in each set. > > e.g., > > x=rnorm(50) > h=hist(x,breaks=10) > h$breaks > > [1] -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 > > So, I want to add a factor to x where if x is less than -2.0, then new > factor="1"; if x is greater than -2.0 but x is less than -1.5, then > new factor="2", etc. > xb <- as.numeric(cut(x, h$breaks)) > xb [1] 9 2 6 9 9 9 6 5 4 7 8 6 6 9 4 8 5 4 9 7 5 9 5 5 4 2 6 7 4 6 4 9 3 8 5 3 6 1 7 [40] 5 7 9 4 4 4 7 8 5 6 7 > str(xdf) 'data.frame': 50 obs. of 2 variables: $ x : num 1.577 -1.525 0.254 1.54 1.6 ... $ xbrks: num 9 2 6 9 9 9 6 5 4 7 ... > > rank doesn't seem to help > > Any tips? > > Thanks much. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From jwiley.psych at gmail.com Wed Dec 7 05:49:39 2011 From: jwiley.psych at gmail.com (Joshua Wiley) Date: Tue, 6 Dec 2011 20:49:39 -0800 Subject: [R] glmmADMB not available on r-forge? In-Reply-To: References: Message-ID: Hi Dave, You should be okay if you update to a recent version of R, so in a way, yes, it is temporary :) Cheers, Josh On Tue, Dec 6, 2011 at 4:46 PM, Messmer,Dave [Sas] wrote: > After copy and pasting the code for installation of glmmADMB package > suggested at http://glmmadmb.r-forge.r-project.org/, I receive this > message. > >> install.packages("glmmADMB", > repos="http://r-forge.r-project.org",type="source") > Warning message: > In getDependencies(pkgs, dependencies, available, lib) : > ?package 'glmmADMB' is not available > > > I'm not sure if this is just a temporary problem, > > > I am operating R v 2.12.2 on a windows machine. > > > Thanks for any advice > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/ From dwinsemius at comcast.net Wed Dec 7 05:55:55 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Tue, 6 Dec 2011 23:55:55 -0500 Subject: [R] configuring a package for own personal needs In-Reply-To: References: Message-ID: <44C995FA-9D21-4C48-A01D-55B1ACCF13EB@comcast.net> On Dec 6, 2011, at 10:22 PM, Jeff Newmiller wrote: > RTFM. (Writing R Extensions. It comes with R.) Since you are asking > this question I will hazard a guess that you are on Windows, and > will want to install RTools per that documentation. In addition to ReadingThatF'ingManl, you may also want to look at Rcpp (and its extensions). It's not as clear to me that you are on Windows (I'm not). -- David. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go > Live... > DCN: Basics: ##.#. ##.#. > Live Go... > Live: OO#.. Dead: OO#.. > Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. > rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Sachinthaka Abeywardana wrote: > >> Hi Michael/ everyone, >> >> I guess a big part of the question was also how would you compile >> (remember >> that some of the code is written in C)? Any recommended tutorials on >> this? >> >> Sachin >> >> On Wed, Dec 7, 2011 at 11:16 AM, R. Michael Weylandt < >> michael.weylandt at gmail.com> wrote: >> >>> The easiest thing is probably to download source files from CRAN and >>> edit the R code, which can be found in the R2Cuba_vvv/R/ directory >>> (vvv is the version code), re-build and then you should be good >>> permanently. I just looked at the source on my machine: very easily >>> done, if you feel comfortable with the compiling which sounds like >> you >>> are. >>> >>> Michael >>> >>> On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana >>> wrote: >>>> Hi All, >>>> >>>> There is a function in package "R2Cuba" called Cuhre that I need to >> use. >>> It >>>> keeps spitting out a new-line which I really dont want it to do. So >> I was >>>> wondering what is the best way of configuring the package. I tried >>> copying >>>> and pasting the code into Cuhre2 and getting rid of the newline >> command >>> BUT >>>> that didn't work since it seems to have some private functions >> which I do >>>> not have access to. >>>> >>>> So what is the best way of rewriting the package and compiling it >> (some >>> of >>>> the code is written in C). Note that I want to do some other >>> configurations >>>> besides the above mentioned (incase you were going to mention some >> sort >>> of >>>> noprint option). >>>> >>>> Thanks, >>>> Sachin >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Wed Dec 7 06:06:19 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Wed, 7 Dec 2011 00:06:19 -0500 Subject: [R] glmmADMB not available on r-forge? In-Reply-To: References: Message-ID: <73B5AF33-F4C1-4157-8B3E-7F08ACF46CDC@comcast.net> On Dec 6, 2011, at 7:46 PM, Messmer,Dave [Sas] wrote: > After copy and pasting the code for installation of glmmADMB package > suggested at http://glmmadmb.r-forge.r-project.org/, I receive this > message. > >> install.packages("glmmADMB", > repos="http://r-forge.r-project.org",type="source") > Warning message: > In getDependencies(pkgs, dependencies, available, lib) : > package 'glmmADMB' is not available > > > I'm not sure if this is just a temporary problem, > > > I am operating R v 2.12.2 on a windows machine. Packages are keyed to version numbers. Yours is old. If you want an old version then you must compile from source. You would be better advise to update. And to post in plain text. > > > Thanks for any advice\ You did ask for any advice. > > [[alternative HTML version deleted]] -- David Winsemius, MD West Hartford, CT From dwinsemius at comcast.net Wed Dec 7 06:07:02 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Wed, 7 Dec 2011 00:07:02 -0500 Subject: [R] help wrapping findInterval into a function In-Reply-To: <1323212031194-4166826.post@n4.nabble.com> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> Message-ID: <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> On Dec 6, 2011, at 5:53 PM, Steve E. wrote: > Bill (and David), > > Thank you very much for taking the time to respond to my query. > > You were right, I was creating and calling the function exactly as > you had > predicted. I revised the structure based on your suggestion. It > runs but > the output is an array of the flags that are not attached to the > data frame, > not a new column in the data frame as was my intention. > > So, the new configuration I tried was like this (where DataFrame is > not a > real data frame but just the word "DataFrame"): > > WQFlags <- function(DataFrame) {DataFrame$CalciumFlag <- > with(DataFrame, > ifelse(variable == "CaD_ICP", (dataqualifier <- c("Y", 'Q', "", "A") > [findInterval(DataFrame$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) > } > > I called it using: > > WaterQualityData <- WQFlags(WaterQualityData) Unless you provide either the original data or an unambiguous ( at the level the R interpreter would see, not at the level of what you see when you print a dataframe) description of your data you will get at the very best educated guesses. Use str() or dput(). > > Again, the output is simply an array of the flags, unattached to a > data > frame. Can you suggest a way to modify this to make it work as > desired, or, > in the worst case, can I attach the resulting array of flag values? Do you mean "attach" in the sense of using the R function `attach`? If so, then please do not. (And please ignore any advice or the examples concerning that issue you might get from reading Crawley's text.) -- Good night. David Winsemius, MD West Hartford, CT From pdalgd at gmail.com Wed Dec 7 08:21:23 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Wed, 7 Dec 2011 08:21:23 +0100 Subject: [R] read.table performance In-Reply-To: References: Message-ID: On Dec 6, 2011, at 22:33 , Gene Leynes wrote: > Mark, > > Thanks for your suggestions. > > That's a good idea about the NULL columns; I didn't think of that. > Surprisingly, it didn't have any effect on the time. Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you fix both? >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >> rep(NULL,3696)). As a general matter, if you want people to dig into this, they need some paraphrase of the file to play with. Would it be possible to set up a small R program that generates a data file which displays the issue? Everything I try seems to take about a second to read in. -pd > > This problem was just a curiosity, I already did the import using Excel and > VBA. I was just going to illustrate the power and simplicity of R, but it > ironically it's been much slower and harder in R... > The VBA was painful and messy, and took me over an hour to write; but at > least it worked quickly and reliably. > The R code was clean and only took me about 5 minutes to write, but the run > time was prohibitively slow! > > I profiled the code, but that offers little insight to me. > > Profile results with 10 line file: > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > $by.self > self.time self.pct total.time total.pct > scan 12.24 53.50 12.24 53.50 > read.table 10.58 46.24 22.88 100.00 > type.convert 0.04 0.17 0.04 0.17 > make.names 0.02 0.09 0.02 0.09 > > $by.total > total.time total.pct self.time self.pct > read.table 22.88 100.00 10.58 46.24 > scan 12.24 53.50 12.24 53.50 > type.convert 0.04 0.17 0.04 0.17 > make.names 0.02 0.09 0.02 0.09 > > $sample.interval > [1] 0.02 > > $sampling.time > [1] 22.88 > > > Profile results with 250 line file: > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > $by.self > self.time self.pct total.time total.pct > scan 23.88 68.15 23.88 68.15 > read.table 10.78 30.76 35.04 100.00 > type.convert 0.30 0.86 0.32 0.91 > character 0.02 0.06 0.02 0.06 > file 0.02 0.06 0.02 0.06 > lapply 0.02 0.06 0.02 0.06 > unlist 0.02 0.06 0.02 0.06 > > $by.total > total.time total.pct self.time self.pct > read.table 35.04 100.00 10.78 30.76 > scan 23.88 68.15 23.88 68.15 > type.convert 0.32 0.91 0.30 0.86 > sapply 0.04 0.11 0.00 0.00 > character 0.02 0.06 0.02 0.06 > file 0.02 0.06 0.02 0.06 > lapply 0.02 0.06 0.02 0.06 > unlist 0.02 0.06 0.02 0.06 > simplify2array 0.02 0.06 0.00 0.00 > > $sample.interval > [1] 0.02 > > $sampling.time > [1] 35.04 > > > > > On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: > >> hi gene: maybe someone else will reply with some subtleties that I'm not >> aware of. one other thing >> that might help: if you know which columns you want , you can set the >> others to NULL through >> colClasses and this should speed things up also. For example, say you knew >> you only wanted the >> first four columns and they were character. then you could do, >> >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >> rep(NULL,3696)). >> >> hopefully someone else will say something that does the trick. it seems >> odd to me as far as the >> difference in timings ? good luck. >> >> >> >> >> >> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: >> >>> Mark, >>> >>> Thank you for the reply >>> >>> I neglected to mention that I had already set >>> options(stringsAsFactors=FALSE) >>> >>> I agree, skipping the factor determination can help performance. >>> >>> The main reason that I wanted to use read.table is because it will >>> correctly determine the column classes for me. I don't really want to >>> specify 3700 column classes! (I'm not sure what they are anyway). >>> >>> >>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds wrote: >>> >>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. >>>> If you know what your variables are ahead of time and what you want them to >>>> be, this allows you to be specific by specifying, character or numeric, >>>> etc and often it makes things faster. others will have more to say. >>>> >>>> also, if most of your variables are characters, R will try to turn >>>> convert them into factors by default. If you use as.is = TRUE it won't >>>> do this and that might speed things up also. >>>> >>>> >>>> Rejoinder: above tidbits are just from experience. I don't know if >>>> it's in stone or a hard and fast rule. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes wrote: >>>> >>>>> ** Disclaimer: I'm looking for general suggestions ** >>>>> I'm sorry, but can't send out the file I'm using, so there is no >>>>> reproducible example. >>>>> >>>>> I'm using read.table and it's taking over 30 seconds to read a tiny >>>>> file. >>>>> The strange thing is that it takes roughly the same amount of time if >>>>> the >>>>> file is 100 times larger. >>>>> >>>>> After re-reviewing the data Import / Export manual I think the best >>>>> approach would be to use Python, or perhaps the readLines function, but >>>>> I >>>>> was hoping to understand why the simple read.table approach wasn't >>>>> working >>>>> as expected. >>>>> >>>>> Some relevant facts: >>>>> >>>>> 1. There are about 3700 columns. Maybe this is the problem? Still >>>>> the >>>>> >>>>> file size is not very large. >>>>> 2. The file encoding is ANSI, but I'm not specifying that in the >>>>> >>>>> function. Setting fileEncoding="ANSI" produces an "unsupported >>>>> conversion" >>>>> error >>>>> 3. readLines imports the lines quickly >>>>> 4. scan imports the file quickly also >>>>> >>>>> >>>>> Obviously, scan and readLines would require more coding to identify >>>>> columns, etc. >>>>> >>>>> my code: >>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', >>>>> header=TRUE)) >>>>> >>>>> It's taking 33.4 seconds and the file size is only 315 kb! >>>>> >>>>> Thanks >>>>> >>>>> Gene >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>>> >>>> >>>> >>> >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From rolf.turner at xtra.co.nz Wed Dec 7 08:50:08 2011 From: rolf.turner at xtra.co.nz (Rolf Turner) Date: Wed, 07 Dec 2011 20:50:08 +1300 Subject: [R] How to fit the log Gaussian Cox process model In-Reply-To: <1323225606638-4167430.post@n4.nabble.com> References: <1323225606638-4167430.post@n4.nabble.com> Message-ID: <4EDF1AB0.9040202@xtra.co.nz> If I understand your question correctly, the functions lgcp.estK() and lgcp.estpcf() in the "spatstat" package should help you to fit the model. (These functions use the method of minimum contrast.) I don't know about "predicting" the underlying random field. This is random, with a constant mean "mu" (so the estimated value of mu is the ``point prediction'' of the field). The functions mentioned above provide estimates of mu (and of the variance sigma^2 of the random field). If you are interested in estimating the particular realisation of the random field which gave rise to the observed point pattern, then it seems to me that simply smoothing the observed pattern with density.ppp() is about as good as anything that you might do. cheers, Rolf Turner On 07/12/11 15:40, JosephWang wrote: > Hi, > As far as I know, there exist some programs via the function INLA, > but I'm so curious if there is a specific function directly used to fit the > log Gaussian Cox process model and > predict the latent Gaussian field. That is, if I have a data points, then I > input it in the function and > don't need to revise the program. Thanks for your help. From tal.galili at gmail.com Wed Dec 7 09:35:49 2011 From: tal.galili at gmail.com (Tal Galili) Date: Wed, 7 Dec 2011 10:35:49 +0200 Subject: [R] HTML Forms to R In-Reply-To: <1323172376189-4164360.post@n4.nabble.com> References: <1323172376189-4164360.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From akpbond007 at gmail.com Wed Dec 7 07:20:05 2011 From: akpbond007 at gmail.com (arunkumar1111) Date: Tue, 6 Dec 2011 22:20:05 -0800 (PST) Subject: [R] Help to get fitted and residual value Message-ID: <1323238805366-4167808.post@n4.nabble.com> Data<- read.csv("C:/FE and RE.csv") Formula="Y~X2+X3+X4 + X5+X6 fit=lm(formula=Formula,data=Data) My sample Data State Year Y X2 X3 X4 X5 X6 S2 1960 27.8 397.5 42.2 50.7 78.3 65.8 S1 1960 29.9 413.3 38.1 52 79.2 66.9 S2 1961 29.8 439.2 40.3 54 79.2 67.8 S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 Is there any way to fitted and residual for the new set of data. or should i create formula manually and pass the values individually S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 -- View this message in context: http://r.789695.n4.nabble.com/Help-to-get-fitted-and-residual-value-tp4167808p4167808.html Sent from the R help mailing list archive at Nabble.com. From sudhi.upadhyaya at ndsu.edu Wed Dec 7 07:44:15 2011 From: sudhi.upadhyaya at ndsu.edu (Sudhi.Upadhyaya) Date: Tue, 6 Dec 2011 22:44:15 -0800 (PST) Subject: [R] EM Algorithm for missing data Message-ID: <1323240255384-4167861.post@n4.nabble.com> Dear all, I need help with EM algorithm. I am modeling this alogirthm based on " Incomplete Data in Generalized Linear Models" by Joseph G Ibrahim. i have half way through developing the R code based on this this paper, I need little help in tweaking my code furthure. ---------------------------------------------------------------------------- a=read.table("C:/sudhi/ex3.csv",header=T,sep=",") #Set design matrix n=1558 X1=as.matrix(rep(1,n)) X2=as.matrix((a[,1])) X3=as.matrix((a[,2])) X4=as.matrix((a[,3])) X5=as.matrix((a[,4])) X6=as.matrix((a[,5])) X7=as.matrix((a[,6])) X8=as.matrix((a[,7])) X=cbind(X1,X2,X3,X4,X5,X6,X7,X8) #Start Newton-Raphson Method #Set Initial parameter B0=0.001 B1=0.001 B2=0.001 B3=0.001 B4=0.001 B5=0.001 B6=0.001 B7=0.001 #Parameters B=matrix(c(B0,B1,B2,B3,B4,B4,B6,B7),nrow=8,ncol=1,byrow=F) #Start Iteration Diff=1 AA = 0 while(Diff>.000001){ AA= AA +1 plot_colors <- c("blue","red","forestgreen") plot(B, type="l", lwd=2, col=plot_colors[1], add=TRUE) split.screen(c(1,1)) #Probability for each comb P=(1+exp(-(X%*%B)))^-1 #Set V matrix ni=1 V=diag(n) for(i in 1:n) { V[i,i]=diag(ni%*%P[i]%*%(1-P[i])) } #Set S matrix #Response R=a[,8] S=matrix(data=1,nrow=n,ncol=1) for (i in 1:n) {S[i]=R[i]-ni*P[i]} new.B=B+solve(t(X)%*%V%*%X)%*%(t(X)%*%S) Diff=max(abs(new.B-B)) B=new.B} #Check the second derivative -diag(t(X)%*%V%*%X) #Check the first derivative t(X)%*%S #Maximum Likelihood Estimates --------------------------------------------------- Please see the pdf file attached for Joseph G Ibrahim's logic Sincerely Sudhi http://r.789695.n4.nabble.com/file/n4167861/EM_on_Logit_Model_-Ibrahim.PDF EM_on_Logit_Model_-Ibrahim.PDF -- View this message in context: http://r.789695.n4.nabble.com/EM-Algorithm-for-missing-data-tp4167861p4167861.html Sent from the R help mailing list archive at Nabble.com. From GormleyA at landcareresearch.co.nz Wed Dec 7 09:08:18 2011 From: GormleyA at landcareresearch.co.nz (Andrew Gormley) Date: Wed, 7 Dec 2011 00:08:18 -0800 (PST) Subject: [R] Memory getting eaten up with XML In-Reply-To: References: Message-ID: <1323245298128-4168098.post@n4.nabble.com> Today I tried the code on a MacBook and experienced the same problem. Which makes me think there is something wrong with the way I am trying to free up the memory...? Andrew Andrew Gormley wrote > > Hi all. I have an issue that I cannot resolve. I am trying to read in lots > of data that are stored in xml files. But after I read them in and copy > the relevant data, then remove the document etc, it doesn't free up the > memory. When I monitor it in windows task manager the memory usage just > climbs with each iteration until R crashes. I can replicate the problem > with the small example: > file.name<-"C:\\MyData.xml.gz" > TEMPP<-xmlParse(file.name) > xx <- xmlRoot(TEMPP) > rm(xx) > rm(TEMPP) > gc() > > Even though I remove the root node xx and the document TEMPP, the memory > usage remains the same as it was when I first read it in... Any > ideas/solutions? > I am using a 32bit version of R 2.14.0 on windows XP, and the latest > version of XML (3.6.1). > Many thanks > Andrew (apologies for the large footer my work appends to all my > emails...) > > ____________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/Memory-getting-eaten-up-with-XML-tp4163468p4168098.html Sent from the R help mailing list archive at Nabble.com. From eric.fail at gmx.us Wed Dec 7 10:02:33 2011 From: eric.fail at gmx.us (Eric Fail) Date: Wed, 07 Dec 2011 04:02:33 -0500 Subject: [R] plotting and coloring longitudinal data with three time points (ggplot2) Message-ID: <20111207090233.276920@gmx.com> Dear list, I have been struggling with this for some time now, and for the last hour I have been struggling to make a working example for the list. I hope someone out there have some experience with plotting longitudinal data that they will share. My data is some patient data with three different time stamps. First the patients are identified at different times (first time stamp). Second, they go through an assessment phase and begin their treatment (time stamp 2). Finally they are admitted from the hospital at some point (time stamp 3), I would like to make a spaghetti plot with the assessment phase in one color and the treatment phase in another color. I used ggplot2, and with this example data and only two time points; it works fine (I call it my working example), library(ggplot2) df <- data.frame( ?date = seq(Sys.Date(), len=104, by="1 day")[sample(104, 52)], ? patient = factor(rep(1:26, 2), labels = LETTERS) ) df <- df[order(df$date), ] dt <- qplot(date, patient, data=df, geom="line") dt + scale_x_date() df[ which(df$patient=='E'), c("patient", "date")] But, if I have three time points, R, for some reason I do not yet understand, add the two second time points in some funny way. Finally, when that is solved; how do I colorize the different parts of the line so the assessment phase gets one color and the treatment phase another? I want to be able to show how long we have been in contact with our patients, how much of the contact time that was assessment and how much that was actual treatment. Below is an example (I call it the not-working example) df2 <- data.frame( ?date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], ?patient2 = factor(rep(1:26, 3), labels = LETTERS) ) df2 <- df2[order(df2$date2), ] dt2 <- qplot(date2, patient2, data=df2, geom="line") dt2 + scale_x_date(major="months", minor="weeks") df2[ which(df2$patient2=='B'), c("patient2", "date2")] If someone can point me in a direction or tell me what I am doing wrong or if there is some amazing package for plotting longitudinal data I would be very grateful. Thanks, Eric From Mohamed.lajnef at inserm.fr Wed Dec 7 10:24:01 2011 From: Mohamed.lajnef at inserm.fr (Mohamed Lajnef) Date: Wed, 07 Dec 2011 10:24:01 +0100 Subject: [R] Help to get fitted and residual value In-Reply-To: <1323238805366-4167808.post@n4.nabble.com> References: <1323238805366-4167808.post@n4.nabble.com> Message-ID: <4EDF30B1.607@inserm.fr> Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : From Mintewab.Bezabih at economics.gu.se Wed Dec 7 10:24:11 2011 From: Mintewab.Bezabih at economics.gu.se (Mintewab Bezabih) Date: Wed, 7 Dec 2011 10:24:11 +0100 Subject: [R] curve fitted ... how to retreive data Message-ID: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D9@HGUMAIL6.hgu.gu.se> Dear R users, I have now managed to fit the curve using the thin plate spline as follows: library(mgcv) b <- gam(y~s(x1,x2,k=100),data =dat) vis.gam(b) What I want now is to get the fitted data for y and copy it so that I use it for further analysis. Many thanks in advance mintewab From mohammed.ouassou at statkart.no Wed Dec 7 10:37:56 2011 From: mohammed.ouassou at statkart.no (Mohammed Ouassou) Date: Wed, 07 Dec 2011 10:37:56 +0100 Subject: [R] Help to get fitted and residual value In-Reply-To: <1323238805366-4167808.post@n4.nabble.com> References: <1323238805366-4167808.post@n4.nabble.com> Message-ID: <1323250676.29223.13.camel@tjalve> Hei, i) get names of object returned by lm(). in this case fit names(fit) output from command : names(fit) [1] "coefficients" "residuals" "effects" "rank" [5] "fitted.values" "assign" "qr" "df.residual" [9] "contrasts" "xlevels" "call" "terms" ii) To get residuals, enter the command myFitRes <- fit$residuals; iii) myFitVals <- fit$fitted.values I hope will help, M.O On ti., 2011-12-06 at 22:20 -0800, arunkumar1111 wrote: > Data<- read.csv("C:/FE and RE.csv") > Formula="Y~X2+X3+X4 + X5+X6 > fit=lm(formula=Formula,data=Data) > > My sample Data > > State Year Y X2 X3 X4 X5 X6 > S2 1960 27.8 397.5 42.2 50.7 78.3 65.8 > S1 1960 29.9 413.3 38.1 52 79.2 66.9 > S2 1961 29.8 439.2 40.3 54 79.2 67.8 > S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 > > Is there any way to fitted and residual for the new set of data. or should i > create formula manually and pass the values individually > > > S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 > S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 > S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Help-to-get-fitted-and-residual-value-tp4167808p4167808.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From Thomas.Chesney at nottingham.ac.uk Wed Dec 7 10:54:29 2011 From: Thomas.Chesney at nottingham.ac.uk (Thomas Chesney) Date: Wed, 7 Dec 2011 09:54:29 +0000 Subject: [R] arules package intsallation Message-ID: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk> I'm using R version 2.13.0 (2011-04-13) on Mac OS X and I get the following error message with library(arules): Loading required package: Matrix Loading required package: lattice Attaching package: 'Matrix' The following object(s) are masked from 'package:base': det Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so': dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.14/Resources/lib/libR.dylib Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so Reason: image not found In addition: Warning message: package 'arules' was built under R version 2.14.0 Error: package/namespace load failed for 'arules' The arules CRAN page says: Depends: R (? 2.11.0), stats, methods, Matrix (? 0.999375-38), all of which I have - anyone know what the problem is? I'm really relunctant to update R as its Package Installer is blocked somehow by our Firewall and updating all the packages I use is a major hassle. Thank you (as always!) Thomas PS on a related note, are the package installer port settings available somewhere and I'll send them to IT, ask them to unblock it?This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From ligges at statistik.tu-dortmund.de Wed Dec 7 11:13:40 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 11:13:40 +0100 Subject: [R] arules package intsallation In-Reply-To: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk> References: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk> Message-ID: <4EDF3C54.4060607@statistik.tu-dortmund.de> On 07.12.2011 10:54, Thomas Chesney wrote: > I'm using R version 2.13.0 (2011-04-13) on Mac OS X and I get the following error message with library(arules): > > Loading required package: Matrix > Loading required package: lattice > > Attaching package: 'Matrix' > > The following object(s) are masked from 'package:base': > > det > > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared object '/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so': > dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.14/Resources/lib/libR.dylib > Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so > Reason: image not found > In addition: Warning message: > package 'arules' was built under R version 2.14.0 > Error: package/namespace load failed for 'arules' Install an arules binary that was built for your version of R (reather than a later one) or install from sources. Uwe Ligges > > The arules CRAN page says: Depends: R (? 2.11.0), stats, methods, Matrix (? 0.999375-38), all of which I have - anyone know what the problem is? I'm really relunctant to update R as its Package Installer is blocked somehow by our Firewall and updating all the packages I use is a major hassle. > > Thank you (as always!) > > Thomas > > PS on a related note, are the package installer port settings available somewhere and I'll send them to IT, ask them to unblock it?This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. > > This message has been checked for viruses but the contents of an attachment > may still contain software viruses which could damage your computer system: > you are advised to perform your own checks. Email communications with the > University of Nottingham may be monitored as permitted by UK legislation. > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Wed Dec 7 11:32:36 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 7 Dec 2011 11:32:36 +0100 Subject: [R] any R-Revolution users here? How to make Revolution portable? In-Reply-To: References: Message-ID: <4EDF40C4.9000309@statistik.tu-dortmund.de> On 06.12.2011 23:14, Michael wrote: > How to make a portable version of Revolution R? > > I just wanted to be able to carry it anywhere I go in a USB drive... > > I don't need fancy functionalities, just need the visual debugger therein... > btw, Windows or Linux doesn't matter... > > Any thoughts? Yes: ask on the right mailing list or the support staff. Best, Uwe Ligges > Thanks a lot! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From petr.pikal at precheza.cz Wed Dec 7 11:38:29 2011 From: petr.pikal at precheza.cz (Petr PIKAL) Date: Wed, 7 Dec 2011 11:38:29 +0100 Subject: [R] Help to get fitted and residual value In-Reply-To: <1323250676.29223.13.camel@tjalve> References: <1323238805366-4167808.post@n4.nabble.com> <1323250676.29223.13.camel@tjalve> Message-ID: Hi > Hei, > > i) get names of object returned by lm(). in this case fit > names(fit) > > output from command : names(fit) > [1] "coefficients" "residuals" "effects" "rank" > [5] "fitted.values" "assign" "qr" "df.residual" > [9] "contrasts" "xlevels" "call" "terms" > > ii) To get residuals, enter the command > myFitRes <- fit$residuals; myFitRes <- residuals(fit) > > iii) myFitVals <- fit$fitted.values myFitVals <- fitted(fit) shall be prefered. Regards Petr > > > I hope will help, > M.O > > On ti., 2011-12-06 at 22:20 -0800, arunkumar1111 wrote: > > Data<- read.csv("C:/FE and RE.csv") > > Formula="Y~X2+X3+X4 + X5+X6 > > fit=lm(formula=Formula,data=Data) > > > > My sample Data > > > > State Year Y X2 X3 X4 X5 X6 > > S2 1960 27.8 397.5 42.2 50.7 78.3 65.8 > > S1 1960 29.9 413.3 38.1 52 79.2 66.9 > > S2 1961 29.8 439.2 40.3 54 79.2 67.8 > > S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 > > > > Is there any way to fitted and residual for the new set of data. or should i > > create formula manually and pass the values individually > > > > > > S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 > > S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 > > S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 > > > > > > > > -- > > View this message in context: http://r.789695.n4.nabble.com/Help-to-get- > fitted-and-residual-value-tp4167808p4167808.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help at 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 code. > > ______________________________________________ > R-help at 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 code. From ripley at stats.ox.ac.uk Wed Dec 7 11:45:15 2011 From: ripley at stats.ox.ac.uk (Prof Brian Ripley) Date: Wed, 7 Dec 2011 10:45:15 +0000 (GMT) Subject: [R] arules package intsallation In-Reply-To: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk> References: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk> Message-ID: On Wed, 7 Dec 2011, Thomas Chesney wrote: > I'm using R version 2.13.0 (2011-04-13) on Mac OS X and I get the following error message with library(arules): Well somehow you used a version of arules built for R 2.14.0. Try the build for R 2.13.x. And please note that R-sig-mac is the list for Mac-specific questions (which this is: only on Mac OS X are package build locked to a specific version of R). > > Loading required package: Matrix > Loading required package: lattice > > Attaching package: 'Matrix' > > The following object(s) are masked from 'package:base': > > det > > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared object '/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so': > dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.14/Resources/lib/libR.dylib > Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/library/arules/libs/i386/arules.so > Reason: image not found > In addition: Warning message: > package 'arules' was built under R version 2.14.0 > Error: package/namespace load failed for 'arules' > > The arules CRAN page says: Depends: R (? 2.11.0), stats, methods, > Matrix (? 0.999375-38), all of which I have - anyone know what the > problem is? I'm really relunctant to update R as its Package > Installer is blocked somehow by our Firewall and updating all the > packages I use is a major hassle. > > Thank you (as always!) > > Thomas > > PS on a related note, are the package installer port settings > available somewhere and I'll send them to IT, ask them to unblock > it? What exactly do you mean by 'package installer'? There is not really any such thing. Inside R, install.packages() just uses http, and R.app's menus (if that is what you mean: R.app is not R, BTW) just use install.packages(). I think you need to talk to your IT people and get them to solve their problem (and it is their problem, not ours). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 From jim at bitwrit.com.au Wed Dec 7 11:57:30 2011 From: jim at bitwrit.com.au (Jim Lemon) Date: Wed, 07 Dec 2011 21:57:30 +1100 Subject: [R] plotting and coloring longitudinal data with three time points (ggplot2) In-Reply-To: <20111207090233.276920@gmx.com> References: <20111207090233.276920@gmx.com> Message-ID: <4EDF469A.2010607@bitwrit.com.au> On 12/07/2011 08:02 PM, Eric Fail wrote: > Dear list, > > I have been struggling with this for some time now, and for the last hour I have been struggling to make a working example for the list. I hope someone out there have some experience with plotting longitudinal data that they will share. > > My data is some patient data with three different time stamps. First the patients are identified at different times (first time stamp). Second, they go through an assessment phase and begin their treatment (time stamp 2). Finally they are admitted from the hospital at some point (time stamp 3), > > I would like to make a spaghetti plot with the assessment phase in one color and the treatment phase in another color. > > I used ggplot2, and with this example data and only two time points; it works fine (I call it my working example), > > library(ggplot2) > df<- data.frame( > date = seq(Sys.Date(), len=104, by="1 day")[sample(104, 52)], > patient = factor(rep(1:26, 2), labels = LETTERS) > ) > df<- df[order(df$date), ] > dt<- qplot(date, patient, data=df, geom="line") > dt + scale_x_date() > df[ which(df$patient=='E'), c("patient", "date")] > > But, if I have three time points, R, for some reason I do not yet understand, add the two second time points in some funny way. > > Finally, when that is solved; how do I colorize the different parts of the line so the assessment phase gets one color and the treatment phase another? > > I want to be able to show how long we have been in contact with our patients, how much of the contact time that was assessment and how much that was actual treatment. > > Below is an example (I call it the not-working example) > > df2<- data.frame( > date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], > patient2 = factor(rep(1:26, 3), labels = LETTERS) > ) > > df2<- df2[order(df2$date2), ] > dt2<- qplot(date2, patient2, data=df2, geom="line") > dt2 + scale_x_date(major="months", minor="weeks") > df2[ which(df2$patient2=='B'), c("patient2", "date2")] > > If someone can point me in a direction or tell me what I am doing wrong or if there is some amazing package for plotting longitudinal data I would be very grateful. > Hi Eric, Try this, I think it does more or less what you want. I tried to work this out with matplot, but couldn't. library(plotrix) df2<-data.frame(dates=c(base_dates,dates2,dates3),patients=rep(LETTERS,3), occasion=rep(c("Assessment","Treatment","Hospital"),each=26)) plot(df2$dates,as.numeric(factor(df2$patients)), main="Dates of treatment stages by patient", xlab="Date",ylab="Patient",axes=FALSE,pch=rep(c("A","T","H"),each=26)) axis.dates<-c("2011-01-01","2011-03-01","2011-05-01","2011-07-01", "2011-09-01","2011-11-01") axis(1,at=as.Date(axis.dates,"%Y-%m-%d"),labels=axis.dates) staxlab(2,at=1:26,labels=LETTERS) box() for(i in 1:26) { lines(df2$dates[c(i,i+26)],c(i,i),col=2) lines(df2$dates[c(i+26,i+52)],c(i,i),col=3) } Jim From aidan.corcoran11 at gmail.com Wed Dec 7 12:05:41 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Wed, 7 Dec 2011 11:05:41 +0000 Subject: [R] removing specified length of text after a period in dataframe of char's Message-ID: Dear all, I'm trying to remove some text after the period (a decimal point) in the data frame 'hi', below. This is one step in formatting a table. So I would like e.g. "2.0" to become "2" and "5.3" to be "5.3", where the variable digordered contains the number of digits after the decimal that I would like to display, in the same order in which the variables appear in hi. If it makes it easier to use, this info is also contained in the dataframe nam2. The reason the numbers are recorded as characters is because I used format to get a thousand separator, which I also need. The string manipulation functions in R generally don't seem to work with matrices or data frames, so e.g. regexpr("\\.", hi[1,2]) works but not regexpr("\\.", hi). Finding the location of the period and then using substring was the approach I was thinking of taking, but this would seem to need for loops here. I was wondering if anyone knows any easier ways. Thanks very much for any help! Aidan digordered<- c(0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1) f<-structure(list(c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", "Ratio to EZ GDP Per Cap", "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "PPP Exchange Rate", "Nominal Exchange Rate (LCU per $)", "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on Central Gov", "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities" ), `2005` = c(35662, 809, 32128, 0.1, 4.3, 9, 1110, 3.5, NA, 14.7, 44.1, 4, 10.8, 7, 15, 22835, NA, NA, NA, NA), `2009` = c(61240, 1265, 52163, 0.1, 5.2, 6.8, 1174, NA, NA, 16.8, 48.4, 10.9, 12.2, 14, 31, 47180, 13.6, 9, 10.8, 42.8), `2010` = c(75122, 1632, 63100, 0.1, 5.5, 10.1, 1191, NA, NA, 18.5, 45.7, 12, NA, 15, 39, 56787, 14.7, 9.9, 10.5, 41.1), `2011` = c(87455, 1843, 72461, 0.1, 5.7, 7.8, 1207, NA, NA, 19.6, NA, 10.6, NA, NA, NA, NA, 13.5, 9.3, 14.3, 35.8), `2012` = c(99459, 2013, 81313, 0.1, 5.9, 7.5, 1223, NA, NA, 20.5, NA, 8.6, NA, NA, NA, NA, NA, NA, NA, NA)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = c(NA, 20L), class = c("cast_df", "data.frame")) hi<-format(f,big.mark=",",scientific=F) regexpr("\\.", hi) #don't know to get location of "." in a dataframe of chars nam2<- structure(list(var1 = c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", "Ratio to EZ GDP Per Cap", "GDP per capita (Intl $)", "EU GDP per capita (Intl $)", "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "Employment (1000s)", "Unemployment (1000s)", "PPP Exchange Rate", "Nominal Exchange Rate (LCU per $)", "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on Central Gov", "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities", "Reserves"), digi = c(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0)), .Names = c("var1", "digi" ), row.names = c("96", "97", "98", "110", "99", "100", "101", "102", "103", "111", "112", "104", "105", "106", "107", "108", "109", "114", "115", "113", "119", "120", "121", "122", "116" ), class = "data.frame") From jholtman at gmail.com Wed Dec 7 12:18:29 2011 From: jholtman at gmail.com (jim holtman) Date: Wed, 7 Dec 2011 06:18:29 -0500 Subject: [R] read.table performance In-Reply-To: References: Message-ID: Here is a test that I ran where the difference was rather the data was in a single column or 3700 columns. If in a single column, the 'scan' and 'read.table' were comparable; with 3700 columns, read.table took 3X longer. using 'colClasses' did not make a difference: > x.n <- as.character(runif(3700)) > x.f <- tempfile() > # just write out a file of numbers in a single column > # 3700 * 500 = 1.85M lines > writeLines(rep(x.n, 500), con = x.f) > file.info(x.f) size isdir mode mtime C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 35154500 FALSE 666 2011-12-07 06:13:56 ctime atime C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 2011-12-07 06:13:52 2011-12-07 06:13:52 exe C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 no > system.time(x.n.read <- scan(x.f)) Read 1850000 items user system elapsed 4.04 0.05 4.10 > dim(x.n.read) NULL > object.size(x.n.read) 14800040 bytes > system.time(x.n.read <- read.table(x.f)) # comparible to 'scan' user system elapsed 4.68 0.06 4.74 > object.size(x.n.read) 14800672 bytes > > # now create data with 3700 columns > # and 500 rows (1.85M numbers) > x.long <- paste(x.n, collapse = ',') > writeLines(rep(x.long, 500), con = x.f) > file.info(x.f) size isdir mode mtime C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 33305000 FALSE 666 2011-12-07 06:14:11 ctime atime C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 2011-12-07 06:13:52 2011-12-07 06:13:52 C:\\Users\\Owner\\AppData\\Local\\Temp\\RtmpOWGkEu\\file60a82064 no > system.time(x.long.read <- scan(x.f, sep = ',')) Read 1850000 items user system elapsed 4.21 0.02 4.23 > dim(x.long.read) NULL > object.size(x.long.read) 14800040 bytes > # takes 3 times as long as 'scan' > system.time(x.long.read <- read.table(x.f, sep = ',')) user system elapsed 13.24 0.06 13.33 > dim(x.long.read) [1] 500 3700 > object.size(x.long.read) 15185368 bytes > > > # using colClasses > system.time(x.long.read <- read.table(x.f, sep = ',' + , colClasses = rep('numeric', 3700) + ) + ) user system elapsed 12.39 0.06 12.48 > > On Tue, Dec 6, 2011 at 4:33 PM, Gene Leynes wrote: > Mark, > > Thanks for your suggestions. > > That's a good idea about the NULL columns; I didn't think of that. > Surprisingly, it didn't have any effect on the time. > > This problem was just a curiosity, I already did the import using Excel and > VBA. ?I was just going to illustrate the power and simplicity of R, but it > ironically it's been much slower and harder in R... > The VBA was painful and messy, and took me over an hour to write; but at > least it worked quickly and reliably. > The R code was clean and only took me about 5 minutes to write, but the run > time was prohibitively slow! > > I profiled the code, but that offers little insight to me. > > Profile results with 10 line file: > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > $by.self > ? ? ? ? ? ? self.time self.pct total.time total.pct > scan ? ? ? ? ? ? 12.24 ? ?53.50 ? ? ?12.24 ? ? 53.50 > read.table ? ? ? 10.58 ? ?46.24 ? ? ?22.88 ? ?100.00 > type.convert ? ? ?0.04 ? ? 0.17 ? ? ? 0.04 ? ? ?0.17 > make.names ? ? ? ?0.02 ? ? 0.09 ? ? ? 0.02 ? ? ?0.09 > > $by.total > ? ? ? ? ? ? total.time total.pct self.time self.pct > read.table ? ? ? ?22.88 ? ?100.00 ? ? 10.58 ? ?46.24 > scan ? ? ? ? ? ? ?12.24 ? ? 53.50 ? ? 12.24 ? ?53.50 > type.convert ? ? ? 0.04 ? ? ?0.17 ? ? ?0.04 ? ? 0.17 > make.names ? ? ? ? 0.02 ? ? ?0.09 ? ? ?0.02 ? ? 0.09 > > $sample.interval > [1] 0.02 > > $sampling.time > [1] 22.88 > > > Profile results with 250 line file: > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > $by.self > ? ? ? ? ? ? self.time self.pct total.time total.pct > scan ? ? ? ? ? ? 23.88 ? ?68.15 ? ? ?23.88 ? ? 68.15 > read.table ? ? ? 10.78 ? ?30.76 ? ? ?35.04 ? ?100.00 > type.convert ? ? ?0.30 ? ? 0.86 ? ? ? 0.32 ? ? ?0.91 > character ? ? ? ? 0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 > file ? ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 > lapply ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 > unlist ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 > > $by.total > ? ? ? ? ? ? ? total.time total.pct self.time self.pct > read.table ? ? ? ? ?35.04 ? ?100.00 ? ? 10.78 ? ?30.76 > scan ? ? ? ? ? ? ? ?23.88 ? ? 68.15 ? ? 23.88 ? ?68.15 > type.convert ? ? ? ? 0.32 ? ? ?0.91 ? ? ?0.30 ? ? 0.86 > sapply ? ? ? ? ? ? ? 0.04 ? ? ?0.11 ? ? ?0.00 ? ? 0.00 > character ? ? ? ? ? ?0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 > file ? ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 > lapply ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 > unlist ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 > simplify2array ? ? ? 0.02 ? ? ?0.06 ? ? ?0.00 ? ? 0.00 > > $sample.interval > [1] 0.02 > > $sampling.time > [1] 35.04 > > > > > On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: > >> hi gene: maybe someone else will reply with some ?subtleties that I'm not >> aware of. one other thing >> that might help: if you know which columns you want , you can set the >> others to NULL through >> colClasses and this should speed things up also. For example, say you knew >> you only wanted the >> first four columns and they were character. then you could do, >> >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >> rep(NULL,3696)). >> >> hopefully someone else will say something that does the trick. it seems >> odd to me as far as the >> difference in timings ? good luck. >> >> >> >> >> >> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: >> >>> Mark, >>> >>> Thank you for the reply >>> >>> I neglected to mention that I had already set >>> options(stringsAsFactors=FALSE) >>> >>> I agree, skipping the factor determination can help performance. >>> >>> The main reason that I wanted to use read.table is because it will >>> correctly determine the column classes for me. ?I don't really want to >>> specify 3700 column classes! ?(I'm not sure what they are anyway). >>> >>> >>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds wrote: >>> >>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. >>>> If you know what your variables are ahead of time and what you want them to >>>> be, this allows you to be specific ?by specifying, character or numeric, >>>> etc ?and often it makes things faster. others will have more to say. >>>> >>>> also, if most of your variables are characters, R will try to turn >>>> convert them into factors by default. If you use as.is = TRUE it won't >>>> do this and that might speed things up also. >>>> >>>> >>>> Rejoinder: ?above tidbits are ?just from experience. I don't know if >>>> it's in stone or a hard and fast rule. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes wrote: >>>> >>>>> ** Disclaimer: I'm looking for general suggestions ** >>>>> I'm sorry, but can't send out the file I'm using, so there is no >>>>> reproducible example. >>>>> >>>>> I'm using read.table and it's taking over 30 seconds to read a tiny >>>>> file. >>>>> The strange thing is that it takes roughly the same amount of time if >>>>> the >>>>> file is 100 times larger. >>>>> >>>>> After re-reviewing the data Import / Export manual I think the best >>>>> approach would be to use Python, or perhaps the readLines function, but >>>>> I >>>>> was hoping to understand why the simple read.table approach wasn't >>>>> working >>>>> as expected. >>>>> >>>>> Some relevant facts: >>>>> >>>>> ? 1. There are about 3700 columns. ?Maybe this is the problem? ?Still >>>>> the >>>>> >>>>> ? file size is not very large. >>>>> ? 2. The file encoding is ANSI, but I'm not specifying that in the >>>>> >>>>> ? function. ?Setting fileEncoding="ANSI" produces an "unsupported >>>>> conversion" >>>>> ? error >>>>> ? 3. readLines imports the lines quickly >>>>> ? 4. scan imports the file quickly also >>>>> >>>>> >>>>> Obviously, scan and readLines would require more coding to identify >>>>> columns, etc. >>>>> >>>>> my code: >>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', >>>>> header=TRUE)) >>>>> >>>>> It's taking 33.4 seconds and the file size is only 315 kb! >>>>> >>>>> Thanks >>>>> >>>>> Gene >>>>> >>>>> ? ? ? ?[[alternative HTML version deleted]] >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>>> >>>> >>>> >>> >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From Thomas.Chesney at nottingham.ac.uk Wed Dec 7 12:20:40 2011 From: Thomas.Chesney at nottingham.ac.uk (Thomas Chesney) Date: Wed, 7 Dec 2011 11:20:40 +0000 Subject: [R] arules package intsallation In-Reply-To: References: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DEF@EXCHANGE2.ad.nottingham.ac.uk>, Message-ID: <5EAA21940C65214F9C11DA5FBBC14F0B3004573DF3@EXCHANGE2.ad.nottingham.ac.uk> ________________________________________ From: Prof Brian Ripley [ripley at stats.ox.ac.uk] Sent: Wednesday, December 07, 2011 10:45 AM To: Thomas Chesney Cc: r-help at r-project.org Subject: Re: [R] arules package intsallation On Wed, 7 Dec 2011, Thomas Chesney wrote: > I'm using R version 2.13.0 (2011-04-13) on Mac OS X and I get the following error message with library(arules): Well somehow you used a version of arules built for R 2.14.0. Try the build for R 2.13.x. And please note that R-sig-mac is the list for Mac-specific questions (which this is: only on Mac OS X are package build locked to a specific version of R). >>Thanks and noted re: R-sig-mac. > > PS on a related note, are the package installer port settings > available somewhere and I'll send them to IT, ask them to unblock > it? What exactly do you mean by 'package installer'? There is not really any such thing. Inside R, install.packages() just uses http, and R.app's menus (if that is what you mean: R.app is not R, BTW) just use install.packages(). I think you need to talk to your IT people and get them to solve their problem (and it is their problem, not ours). >>Yes I did mean the menu item, which I didn't realise wasn't part of R sorry - I was just asking as a lot of the software I use requires certain ports to be open and there's usually a list somewhere which can be difficult to track down. Out of interest, is arules part of R? >>ThomasThis message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From aidan.corcoran11 at gmail.com Wed Dec 7 12:47:21 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Wed, 7 Dec 2011 11:47:21 +0000 Subject: [R] running texi2dvi without running bibtex Message-ID: Dear all, I was hoping someone may know a way of running texi2dvi while ignoring bibtex errors, or any other work around (such as not running bibtex at all, if possible). The context is that I have an R program that does some calculations and writes a table into various folders, one per country for several countries. I have a latex file that takes the table as an input, and this latex file is copied into each folder. I would like to use R to compile the latex files, to avoid having to open and compile them individually. The files are simple one page files with no citations, so need no biblio. If I switch to one of the folders containing a table and a latex file and run texi2dvi("onepager", pdf = TRUE, clean = FALSE, quiet = FALSE, texi2dvi = getOption("texi2dvi"), texinputs = NULL, index = TRUE) I get running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" --pdf "onepager" -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/tex/latex" -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/bibtex/bst"' had status 1 and no pdf produced. I think the problem is that the absence of a biblio causes an error. The files compile in Texniccenter (with a warning on "no \citation commands" etc). Does anyone know of a trick to avoid this problem? Thanks very much for any help! Aidan From sarah.goslee at gmail.com Wed Dec 7 13:05:16 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Wed, 7 Dec 2011 07:05:16 -0500 Subject: [R] removing specified length of text after a period in dataframe of char's In-Reply-To: References: Message-ID: Hi, Example data is crucial, but small simple example data is even better. I'm too lazy to figure out which bits I need from your data, so here's a simple example of one way to approach your question. You could use gsub() in very much the same manner if you need more complex output. > testdata <- data.frame(values=c(2.0, 5.3, 1.1), digits=c(0, 1, 2)) > testdata values digits 1 2.0 0 2 5.3 1 3 1.1 2 # a nice way that works on numbers > apply(testdata, 1, function(x)sprintf(paste("%0.", x[2], "f", sep=""), x[1])) [1] "2" "5.3" "1.10" # a messy way that works on strings > apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) [1] "2" "5.3" "1.1" Also note that the second method will not add zeros to pad out the end. If you need that, I'd consider rearranging the order of your steps so that you can use sprintf(). Someone else might have a more flexible way too; I'd be interested to see it. Unfortunately I don't think sprintf() has a way to insert a thousands separator, or that would be a one-step solution. Sarah On Wed, Dec 7, 2011 at 6:05 AM, Aidan Corcoran wrote: > ?Dear all, > > ?I'm trying to remove some text after the period (a decimal point) in > the data frame 'hi', below. This is one step in formatting a table. So > I would like e.g. > "2.0" to become "2" > and "5.3" to be "5.3", > where the variable digordered contains the number of digits after the > decimal that I would like to display, in the same order in which the > variables appear in hi. If it makes it easier to use, this info is > also contained in the dataframe nam2. The reason the numbers are > recorded as characters is because I used format to get a thousand > separator, which I also need. > > The string manipulation functions in R generally don't seem to work > with matrices or data frames, so e.g. ? regexpr("\\.", ?hi[1,2]) works > but not regexpr("\\.", hi). Finding the location of the period and > then using substring was the approach I was thinking of taking, but > this would seem to need for loops here. I was wondering if anyone > knows any easier ways. > > Thanks very much for any help! > > Aidan > > > digordered<- ?c(0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1) > f<-structure(list(c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", > "Ratio to EZ GDP Per Cap", "Share of World GDP (Intl $, %)", > "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", > "Ratio of Employed/Unemployed", "PPP Exchange Rate", "Nominal Exchange > Rate (LCU per $)", > "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on > Central Gov", > "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", > "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities" > ), `2005` = c(35662, 809, 32128, 0.1, 4.3, 9, 1110, 3.5, NA, > 14.7, 44.1, 4, 10.8, 7, 15, 22835, NA, NA, NA, NA), `2009` = c(61240, > 1265, 52163, 0.1, 5.2, 6.8, 1174, NA, NA, 16.8, 48.4, 10.9, 12.2, > 14, 31, 47180, 13.6, 9, 10.8, 42.8), `2010` = c(75122, 1632, > 63100, 0.1, 5.5, 10.1, 1191, NA, NA, 18.5, 45.7, 12, NA, 15, > 39, 56787, 14.7, 9.9, 10.5, 41.1), `2011` = c(87455, 1843, 72461, > 0.1, 5.7, 7.8, 1207, NA, NA, 19.6, NA, 10.6, NA, NA, NA, NA, > 13.5, 9.3, 14.3, 35.8), `2012` = c(99459, 2013, 81313, 0.1, 5.9, > 7.5, 1223, NA, NA, 20.5, NA, 8.6, NA, NA, NA, NA, NA, NA, NA, > NA)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = c(NA, > 20L), class = c("cast_df", "data.frame")) > > ?hi<-format(f,big.mark=",",scientific=F) > ?regexpr("\\.", ?hi) #don't know to get location of "." in a dataframe of chars > > > nam2<- ?structure(list(var1 = c("GDP (LCU,bn)", "GDP ($, bn)", "GDP > per capita (LCU)", > "Ratio to EZ GDP Per Cap", "GDP per capita (Intl $)", "EU GDP per > capita (Intl $)", > "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", > "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "Employment (1000s)", > "Unemployment (1000s)", "PPP Exchange Rate", "Nominal Exchange Rate > (LCU per $)", > "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on > Central Gov", > "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", > "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities", > "Reserves"), digi = c(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, > 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0)), .Names = c("var1", "digi" > ), row.names = c("96", "97", "98", "110", "99", "100", "101", > "102", "103", "111", "112", "104", "105", "106", "107", "108", > "109", "114", "115", "113", "119", "120", "121", "122", "116" > ), class = "data.frame") > > ______________________________________________ > R-help at 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 code. -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org From janko.thyson.rstuff at googlemail.com Wed Dec 7 13:33:45 2011 From: janko.thyson.rstuff at googlemail.com (Janko Thyson) Date: Wed, 07 Dec 2011 13:33:45 +0100 Subject: [R] making changes to global variables in functions In-Reply-To: References: Message-ID: <4EDF5D29.5050404@googlemail.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jfox at mcmaster.ca Wed Dec 7 14:11:12 2011 From: jfox at mcmaster.ca (John Fox) Date: Wed, 7 Dec 2011 08:11:12 -0500 Subject: [R] questions about scatterplotMatrix In-Reply-To: <1323229537113-4167576.post@n4.nabble.com> References: <1323229537113-4167576.post@n4.nabble.com> Message-ID: <002c01ccb4e1$b21bf640$1653e2c0$@mcmaster.ca> Dear Wendy, This must be the scatterplotMatrix() function in the car package. If I understand correctly what you want, the following should do it: scatterplotMatrix(~ income + education + prestige, smooth = FALSE, data=Duncan, diagonal="none", reg.line=function(...) abline(0,1), xlim=c(0, 100), ylim=c(0, 100)) (The reg.line argument must be a function.) I hope this helps, John -------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Wendy > Sent: December-06-11 10:46 PM > To: r-help at r-project.org > Subject: [R] questions about scatterplotMatrix > > Hi all, > > I want to plot some data with scatterplotMatrix. I want to set all axis > limits of all the sub figures the same, also add abline(0,1) to all the > sub figures. Using the code following code, I can only add abline to > the first off-diagonal figure, and I did not figure out how to set all > the axis limits the same. > > > scatterplotMatrix(~ income + education + prestige, smooth = > FALSE,transform=FALSE, > data=Duncan,robust=TRUE,diagonal="none",plot.points = > TRUE,reg.line=abline(0,1)) > > Does anybody know how to achieve this? Any advice is appreciated. Thank > you. > > Wendy > > > > -- > View this message in context: http://r.789695.n4.nabble.com/questions- > about-scatterplotMatrix-tp4167576p4167576.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From aidan.corcoran11 at gmail.com Wed Dec 7 14:20:10 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Wed, 7 Dec 2011 13:20:10 +0000 Subject: [R] removing specified length of text after a period in dataframe of char's In-Reply-To: References: Message-ID: Hi Sarah, apologies for the excess. A smaller example: f<-structure(list(c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" ), `2005` = c(32128, 0.1), `2009` = c(52163, 0.1), `2010` = c(63100, 0.1), `2011` = c(72461, 0.1), `2012` = c(81313, 0.1)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = 3:4, class = c("cast_df", "data.frame")) nam2<- structure(list(var1 = c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" ), digi = c(0, 1)), .Names = c("var1", "digi"), row.names = c("98", "110"), class = "data.frame") I'm trying to place a thousand separator in the numbers in the table f: > f 2005 2009 2010 2011 2012 3 GDP per capita (LCU) 32128.0 52163.0 63100.0 72461.0 81313.0 4 Ratio to EZ GDP Per Cap 0.1 0.1 0.1 0.1 0.1 and also have precision given by variable digi: > nam2 var1 digi 98 GDP per capita (LCU) 0 110 Ratio to EZ GDP Per Cap 1 format hi<-format(f,big.mark=",",scientific=F) gives me the comma, but now I'm not sure how to get the precision. Your answer seems to be doing what I want, although when I changed the testdata slightly >testdata[1,1]<-10000 > hi<-format(testdata,big.mark=",",scientific=F) > hi values digits 1 10,000.0 0 2 5.3 1 3 1.1 2 > apply(hi, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) 1 2 3 "10,000." " 5.3" " 1.1" The decimal appears to be left behind in 10,000. Unfortunately your approach is a bit too advanced for me, so I can't adapt it. Perhaps you could recommend somewhere where I could read up on what the caret and other symbols mean in your paste call? thanks for your help! Aidan On Wed, Dec 7, 2011 at 12:05 PM, Sarah Goslee wrote: > Hi, > > Example data is crucial, but small simple example data is even better. > I'm too lazy to figure out which bits I need from your data, so here's > a simple example of one way to approach your question. You could > use gsub() in very much the same manner if you need more complex > output. > >> testdata <- data.frame(values=c(2.0, 5.3, 1.1), digits=c(0, 1, 2)) >> testdata > ?values digits > 1 ? ?2.0 ? ? ?0 > 2 ? ?5.3 ? ? ?1 > 3 ? ?1.1 ? ? ?2 > # a nice way that works on numbers >> apply(testdata, 1, function(x)sprintf(paste("%0.", x[2], "f", sep=""), x[1])) > [1] "2" ? ?"5.3" ?"1.10" > > # a messy way that works on strings >> apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) > [1] "2" ? "5.3" "1.1" > > Also note that the second method will not add zeros to pad out the > end. If you need that, I'd consider rearranging the order of your > steps so that you can use sprintf(). > > Someone else might have a more flexible way too; I'd be interested to see it. > Unfortunately I don't think sprintf() has a way to insert a thousands separator, > or that would be a one-step solution. > > Sarah > > On Wed, Dec 7, 2011 at 6:05 AM, Aidan Corcoran > wrote: >> ?Dear all, >> >> ?I'm trying to remove some text after the period (a decimal point) in >> the data frame 'hi', below. This is one step in formatting a table. So >> I would like e.g. >> "2.0" to become "2" >> and "5.3" to be "5.3", >> where the variable digordered contains the number of digits after the >> decimal that I would like to display, in the same order in which the >> variables appear in hi. If it makes it easier to use, this info is >> also contained in the dataframe nam2. The reason the numbers are >> recorded as characters is because I used format to get a thousand >> separator, which I also need. >> >> The string manipulation functions in R generally don't seem to work >> with matrices or data frames, so e.g. ? regexpr("\\.", ?hi[1,2]) works >> but not regexpr("\\.", hi). Finding the location of the period and >> then using substring was the approach I was thinking of taking, but >> this would seem to need for loops here. I was wondering if anyone >> knows any easier ways. >> >> Thanks very much for any help! >> >> Aidan >> >> >> digordered<- ?c(0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1) >> f<-structure(list(c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", >> "Ratio to EZ GDP Per Cap", "Share of World GDP (Intl $, %)", >> "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", >> "Ratio of Employed/Unemployed", "PPP Exchange Rate", "Nominal Exchange >> Rate (LCU per $)", >> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >> Central Gov", >> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities" >> ), `2005` = c(35662, 809, 32128, 0.1, 4.3, 9, 1110, 3.5, NA, >> 14.7, 44.1, 4, 10.8, 7, 15, 22835, NA, NA, NA, NA), `2009` = c(61240, >> 1265, 52163, 0.1, 5.2, 6.8, 1174, NA, NA, 16.8, 48.4, 10.9, 12.2, >> 14, 31, 47180, 13.6, 9, 10.8, 42.8), `2010` = c(75122, 1632, >> 63100, 0.1, 5.5, 10.1, 1191, NA, NA, 18.5, 45.7, 12, NA, 15, >> 39, 56787, 14.7, 9.9, 10.5, 41.1), `2011` = c(87455, 1843, 72461, >> 0.1, 5.7, 7.8, 1207, NA, NA, 19.6, NA, 10.6, NA, NA, NA, NA, >> 13.5, 9.3, 14.3, 35.8), `2012` = c(99459, 2013, 81313, 0.1, 5.9, >> 7.5, 1223, NA, NA, 20.5, NA, 8.6, NA, NA, NA, NA, NA, NA, NA, >> NA)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = c(NA, >> 20L), class = c("cast_df", "data.frame")) >> >> ?hi<-format(f,big.mark=",",scientific=F) >> ?regexpr("\\.", ?hi) #don't know to get location of "." in a dataframe of chars >> >> >> nam2<- ?structure(list(var1 = c("GDP (LCU,bn)", "GDP ($, bn)", "GDP >> per capita (LCU)", >> "Ratio to EZ GDP Per Cap", "GDP per capita (Intl $)", "EU GDP per >> capita (Intl $)", >> "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", >> "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "Employment (1000s)", >> "Unemployment (1000s)", "PPP Exchange Rate", "Nominal Exchange Rate >> (LCU per $)", >> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >> Central Gov", >> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities", >> "Reserves"), digi = c(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, >> 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0)), .Names = c("var1", "digi" >> ), row.names = c("96", "97", "98", "110", "99", "100", "101", >> "102", "103", "111", "112", "104", "105", "106", "107", "108", >> "109", "114", "115", "113", "119", "120", "121", "122", "116" >> ), class = "data.frame") >> >> ______________________________________________ >> R-help at 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 code. > > > > -- > Sarah Goslee > http://www.stringpage.com > http://www.sarahgoslee.com > http://www.functionaldiversity.org From sarah.goslee at gmail.com Wed Dec 7 14:40:24 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Wed, 7 Dec 2011 08:40:24 -0500 Subject: [R] removing specified length of text after a period in dataframe of char's In-Reply-To: References: Message-ID: Hi, If you really wanted precision (significant figures) rather than decimal places, it would be easy: format() handles that, I believe. Your original email said you'd been reading about regular expressions; continuing that reading will lead you to the meaning of the cryptic ^ and all the \. As for the final ., you're right: I didn't think about having nothing following the decimal place. It's much easier to do in two steps: > testdata <- data.frame(values=c("10,000.0", "5.321", "1.1"), digits=c(0, 1, 2)) > intermediate <- apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) > intermediate [1] "10,000." "5.3" "1.1" > sub("\\.$", "", intermediate) [1] "10,000" "5.3" "1.1" Sarah On Wed, Dec 7, 2011 at 8:20 AM, Aidan Corcoran wrote: > Hi Sarah, > > apologies for the excess. A smaller example: > > f<-structure(list(c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" > ), `2005` = c(32128, 0.1), `2009` = c(52163, 0.1), `2010` = c(63100, > 0.1), `2011` = c(72461, 0.1), `2012` = c(81313, 0.1)), .Names = c("", > "2005", "2009", "2010", "2011", "2012"), row.names = 3:4, class = c("cast_df", > "data.frame")) > > nam2<- > structure(list(var1 = c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" > ), digi = c(0, 1)), .Names = c("var1", "digi"), row.names = c("98", > "110"), class = "data.frame") > > I'm trying to place a thousand separator in the numbers in the table f: > >> f > ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2005 ? ?2009 ? ?2010 ? ?2011 ? ?2012 > 3 ? ?GDP per capita (LCU) 32128.0 52163.0 63100.0 72461.0 81313.0 > 4 Ratio to EZ GDP Per Cap ? ? 0.1 ? ? 0.1 ? ? 0.1 ? ? 0.1 ? ? 0.1 > > and also have precision given by variable digi: > >> nam2 > ? ? ? ? ? ? ? ? ? ? ? var1 digi > 98 ? ? GDP per capita (LCU) ? ?0 > 110 Ratio to EZ GDP Per Cap ? ?1 > > format > ?hi<-format(f,big.mark=",",scientific=F) > gives me the comma, but now I'm not sure how to get the precision. > > Your answer seems to be doing what I want, although when I changed the > testdata slightly >>testdata[1,1]<-10000 >> ? hi<-format(testdata,big.mark=",",scientific=F) >> hi > ? ?values digits > 1 10,000.0 ? ? ?0 > 2 ? ? ?5.3 ? ? ?1 > 3 ? ? ?1.1 ? ? ?2 >> apply(hi, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) > ? ? ? ? 1 ? ? ? ? ?2 ? ? ? ? ?3 > ?"10,000." " ? ? 5.3" " ? ? 1.1" > The decimal appears to be left behind in 10,000. > > Unfortunately your approach is a bit too advanced for me, so I can't > adapt it. Perhaps you could recommend somewhere where I could read up > on what the caret and other symbols mean in your paste call? > > thanks for your help! > > Aidan > > On Wed, Dec 7, 2011 at 12:05 PM, Sarah Goslee wrote: >> Hi, >> >> Example data is crucial, but small simple example data is even better. >> I'm too lazy to figure out which bits I need from your data, so here's >> a simple example of one way to approach your question. You could >> use gsub() in very much the same manner if you need more complex >> output. >> >>> testdata <- data.frame(values=c(2.0, 5.3, 1.1), digits=c(0, 1, 2)) >>> testdata >> ?values digits >> 1 ? ?2.0 ? ? ?0 >> 2 ? ?5.3 ? ? ?1 >> 3 ? ?1.1 ? ? ?2 >> # a nice way that works on numbers >>> apply(testdata, 1, function(x)sprintf(paste("%0.", x[2], "f", sep=""), x[1])) >> [1] "2" ? ?"5.3" ?"1.10" >> >> # a messy way that works on strings >>> apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) >> [1] "2" ? "5.3" "1.1" >> >> Also note that the second method will not add zeros to pad out the >> end. If you need that, I'd consider rearranging the order of your >> steps so that you can use sprintf(). >> >> Someone else might have a more flexible way too; I'd be interested to see it. >> Unfortunately I don't think sprintf() has a way to insert a thousands separator, >> or that would be a one-step solution. >> >> Sarah >> >> On Wed, Dec 7, 2011 at 6:05 AM, Aidan Corcoran >> wrote: >>> ?Dear all, >>> >>> ?I'm trying to remove some text after the period (a decimal point) in >>> the data frame 'hi', below. This is one step in formatting a table. So >>> I would like e.g. >>> "2.0" to become "2" >>> and "5.3" to be "5.3", >>> where the variable digordered contains the number of digits after the >>> decimal that I would like to display, in the same order in which the >>> variables appear in hi. If it makes it easier to use, this info is >>> also contained in the dataframe nam2. The reason the numbers are >>> recorded as characters is because I used format to get a thousand >>> separator, which I also need. >>> >>> The string manipulation functions in R generally don't seem to work >>> with matrices or data frames, so e.g. ? regexpr("\\.", ?hi[1,2]) works >>> but not regexpr("\\.", hi). Finding the location of the period and >>> then using substring was the approach I was thinking of taking, but >>> this would seem to need for loops here. I was wondering if anyone >>> knows any easier ways. >>> >>> Thanks very much for any help! >>> >>> Aidan >>> >>> >>> digordered<- ?c(0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1) >>> f<-structure(list(c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", >>> "Ratio to EZ GDP Per Cap", "Share of World GDP (Intl $, %)", >>> "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", >>> "Ratio of Employed/Unemployed", "PPP Exchange Rate", "Nominal Exchange >>> Rate (LCU per $)", >>> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >>> Central Gov", >>> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >>> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities" >>> ), `2005` = c(35662, 809, 32128, 0.1, 4.3, 9, 1110, 3.5, NA, >>> 14.7, 44.1, 4, 10.8, 7, 15, 22835, NA, NA, NA, NA), `2009` = c(61240, >>> 1265, 52163, 0.1, 5.2, 6.8, 1174, NA, NA, 16.8, 48.4, 10.9, 12.2, >>> 14, 31, 47180, 13.6, 9, 10.8, 42.8), `2010` = c(75122, 1632, >>> 63100, 0.1, 5.5, 10.1, 1191, NA, NA, 18.5, 45.7, 12, NA, 15, >>> 39, 56787, 14.7, 9.9, 10.5, 41.1), `2011` = c(87455, 1843, 72461, >>> 0.1, 5.7, 7.8, 1207, NA, NA, 19.6, NA, 10.6, NA, NA, NA, NA, >>> 13.5, 9.3, 14.3, 35.8), `2012` = c(99459, 2013, 81313, 0.1, 5.9, >>> 7.5, 1223, NA, NA, 20.5, NA, 8.6, NA, NA, NA, NA, NA, NA, NA, >>> NA)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = c(NA, >>> 20L), class = c("cast_df", "data.frame")) >>> >>> ?hi<-format(f,big.mark=",",scientific=F) >>> ?regexpr("\\.", ?hi) #don't know to get location of "." in a dataframe of chars >>> >>> >>> nam2<- ?structure(list(var1 = c("GDP (LCU,bn)", "GDP ($, bn)", "GDP >>> per capita (LCU)", >>> "Ratio to EZ GDP Per Cap", "GDP per capita (Intl $)", "EU GDP per >>> capita (Intl $)", >>> "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", >>> "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "Employment (1000s)", >>> "Unemployment (1000s)", "PPP Exchange Rate", "Nominal Exchange Rate >>> (LCU per $)", >>> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >>> Central Gov", >>> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >>> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities", >>> "Reserves"), digi = c(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, >>> 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0)), .Names = c("var1", "digi" >>> ), row.names = c("96", "97", "98", "110", "99", "100", "101", >>> "102", "103", "111", "112", "104", "105", "106", "107", "108", >>> "109", "114", "115", "113", "119", "120", "121", "122", "116" >>> ), class = "data.frame") >>> >>> ________________________ From hadley at rice.edu Wed Dec 7 15:01:05 2011 From: hadley at rice.edu (Hadley Wickham) Date: Wed, 7 Dec 2011 09:01:05 -0500 Subject: [R] plotting and coloring longitudinal data with three time points (ggplot2) In-Reply-To: <20111207090233.276920@gmx.com> References: <20111207090233.276920@gmx.com> Message-ID: On Wed, Dec 7, 2011 at 4:02 AM, Eric Fail wrote: > ?Dear list, > > I have been struggling with this for some time now, and for the last hour I have been struggling to make a working example for the list. I hope someone out there have some experience with plotting longitudinal data that they will share. > > My data is some patient data with three different time stamps. First the patients are identified at different times (first time stamp). Second, they go through an assessment phase and begin their treatment (time stamp 2). Finally they are admitted from the hospital at some point (time stamp 3), > > I would like to make a spaghetti plot with the assessment phase in one color and the treatment phase in another color. > > I used ggplot2, and with this example data and only two time points; it works fine (I call it my working example), > > library(ggplot2) > df <- data.frame( > ??date = seq(Sys.Date(), len=104, by="1 day")[sample(104, 52)], > ?? patient = factor(rep(1:26, 2), labels = LETTERS) > ?) > df <- df[order(df$date), ] > dt <- qplot(date, patient, data=df, geom="line") > dt + scale_x_date() > df[ which(df$patient=='E'), c("patient", "date")] > > But, if I have three time points, R, for some reason I do not yet understand, add the two second time points in some funny way. > > Finally, when that is solved; how do I colorize the different parts of the line so the assessment phase gets one color and the treatment phase another? > > I want to be able to show how long we have been in contact with our patients, how much of the contact time that was assessment and how much that was actual treatment. > > Below is an example (I call it the not-working example) > > df2 <- data.frame( > ??date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], > ??patient2 = factor(rep(1:26, 3), labels = LETTERS) > ?) > > df2 <- df2[order(df2$date2), ] > dt2 <- qplot(date2, patient2, data=df2, geom="line") > dt2 + scale_x_date(major="months", minor="weeks") > df2[ which(df2$patient2=='B'), c("patient2", "date2")] Did you mean something like this? library(ggplot2) library(plyr) df2 <- data.frame( date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], patient2 = factor(rep(1:26, 3), labels = LETTERS) ) df2 <- ddply(df2, "patient2", mutate, visit = order(date2)) qplot(date2, patient2, data = df2, geom = "line") + geom_point(aes(colour = factor(visit))) # or this? library(ggplot2) library(plyr) df2 <- data.frame( date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], patient2 = factor(rep(1:26, 3), labels = LETTERS) ) df2 <- ddply(df2, "patient2", mutate, visit = order(date2)) qplot(date2, patient2, data = df2, geom = "line", colour = factor(visit), group = patient2) # Obviously the lines are drawn between the observations so you only see the first two visits. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ From cristabel.duran at waldbau.uni-freiburg.de Wed Dec 7 15:29:26 2011 From: cristabel.duran at waldbau.uni-freiburg.de (cristabel.duran at waldbau.uni-freiburg.de) Date: Wed, 07 Dec 2011 15:29:26 +0100 Subject: [R] maximum number of files to choose with tk_choose.files ? Message-ID: Dear R-list, I am running a script in which I calculate and create new files from orginal ones. As I have a large number of files to process, I automatize this calculation with a loop. First, I am choosing the files to work with. This is done by using: Files <- if(interactive()) tk_choose.files(default = paste(getwd(),"/", sep=""), filter = Filters, multi=TRUE, caption = "Files to process") It works ok but if I am choosing approximately less than 350-400 files. If I want to choose more files, it is not working. Some additional information: Files are 5kb big. R version 2.12.1 memory.limit 4000 Someone have an idea if the function tk_choose.files recognizes a maximum of files to work with? thanks and greetings, Cristabel. Cristabel Dur?n Rangel. PhD Student. Institute of Silviculture. Faculty of Forest and Environmental Sciences. University of Freiburg. Germany Telf: +49 (761) 203 8604 (ofc) ?Man lernt die Physiognomie einer Landschaft desto besser kennen, je genauer man die einzelnen Z?ge auffa?t, sie untereinander vergleicht und so auf dem Wege der Analysis den Quellen der Gen?sse nachgeht, die uns das gro?e Naturgem?lde bietet.? Alexander von Humboldt, 1799 From aidan.corcoran11 at gmail.com Wed Dec 7 15:40:23 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Wed, 7 Dec 2011 14:40:23 +0000 Subject: [R] removing specified length of text after a period in dataframe of char's In-Reply-To: References: Message-ID: Hi Sarah, this is a neat solution. Thanks very much for your help, and your patience with my poorly posed questions. I've learned a lot from your approach. best regards, Aidan On Wed, Dec 7, 2011 at 1:40 PM, Sarah Goslee wrote: > Hi, > > If you really wanted precision (significant figures) rather than decimal places, > it would be easy: format() handles that, I believe. > > Your original email said you'd been reading about regular expressions; > continuing > that reading will lead you to the meaning of the cryptic ^ and all the \. > > As for the final ., you're right: I didn't think about having nothing > following the > decimal place. It's much easier to do in two steps: > >> testdata <- data.frame(values=c("10,000.0", "5.321", "1.1"), digits=c(0, 1, 2)) >> intermediate <- apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) >> intermediate > [1] "10,000." "5.3" ? ? "1.1" >> sub("\\.$", "", intermediate) > [1] "10,000" "5.3" ? ?"1.1" > > Sarah > On Wed, Dec 7, 2011 at 8:20 AM, Aidan Corcoran > wrote: >> Hi Sarah, >> >> apologies for the excess. A smaller example: >> >> f<-structure(list(c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" >> ), `2005` = c(32128, 0.1), `2009` = c(52163, 0.1), `2010` = c(63100, >> 0.1), `2011` = c(72461, 0.1), `2012` = c(81313, 0.1)), .Names = c("", >> "2005", "2009", "2010", "2011", "2012"), row.names = 3:4, class = c("cast_df", >> "data.frame")) >> >> nam2<- >> structure(list(var1 = c("GDP per capita (LCU)", "Ratio to EZ GDP Per Cap" >> ), digi = c(0, 1)), .Names = c("var1", "digi"), row.names = c("98", >> "110"), class = "data.frame") >> >> I'm trying to place a thousand separator in the numbers in the table f: >> >>> f >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2005 ? ?2009 ? ?2010 ? ?2011 ? ?2012 >> 3 ? ?GDP per capita (LCU) 32128.0 52163.0 63100.0 72461.0 81313.0 >> 4 Ratio to EZ GDP Per Cap ? ? 0.1 ? ? 0.1 ? ? 0.1 ? ? 0.1 ? ? 0.1 >> >> and also have precision given by variable digi: >> >>> nam2 >> ? ? ? ? ? ? ? ? ? ? ? var1 digi >> 98 ? ? GDP per capita (LCU) ? ?0 >> 110 Ratio to EZ GDP Per Cap ? ?1 >> >> format >> ?hi<-format(f,big.mark=",",scientific=F) >> gives me the comma, but now I'm not sure how to get the precision. >> >> Your answer seems to be doing what I want, although when I changed the >> testdata slightly >>>testdata[1,1]<-10000 >>> ? hi<-format(testdata,big.mark=",",scientific=F) >>> hi >> ? ?values digits >> 1 10,000.0 ? ? ?0 >> 2 ? ? ?5.3 ? ? ?1 >> 3 ? ? ?1.1 ? ? ?2 >>> apply(hi, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) >> ? ? ? ? 1 ? ? ? ? ?2 ? ? ? ? ?3 >> ?"10,000." " ? ? 5.3" " ? ? 1.1" >> The decimal appears to be left behind in 10,000. >> >> Unfortunately your approach is a bit too advanced for me, so I can't >> adapt it. Perhaps you could recommend somewhere where I could read up >> on what the caret and other symbols mean in your paste call? >> >> thanks for your help! >> >> Aidan >> >> On Wed, Dec 7, 2011 at 12:05 PM, Sarah Goslee wrote: >>> Hi, >>> >>> Example data is crucial, but small simple example data is even better. >>> I'm too lazy to figure out which bits I need from your data, so here's >>> a simple example of one way to approach your question. You could >>> use gsub() in very much the same manner if you need more complex >>> output. >>> >>>> testdata <- data.frame(values=c(2.0, 5.3, 1.1), digits=c(0, 1, 2)) >>>> testdata >>> ?values digits >>> 1 ? ?2.0 ? ? ?0 >>> 2 ? ?5.3 ? ? ?1 >>> 3 ? ?1.1 ? ? ?2 >>> # a nice way that works on numbers >>>> apply(testdata, 1, function(x)sprintf(paste("%0.", x[2], "f", sep=""), x[1])) >>> [1] "2" ? ?"5.3" ?"1.10" >>> >>> # a messy way that works on strings >>>> apply(testdata, 1, function(x)sub(paste("(^.*\\.\\d{", x[2], "})(\\d*)", sep=""), "\\1", x[1])) >>> [1] "2" ? "5.3" "1.1" >>> >>> Also note that the second method will not add zeros to pad out the >>> end. If you need that, I'd consider rearranging the order of your >>> steps so that you can use sprintf(). >>> >>> Someone else might have a more flexible way too; I'd be interested to see it. >>> Unfortunately I don't think sprintf() has a way to insert a thousands separator, >>> or that would be a one-step solution. >>> >>> Sarah >>> >>> On Wed, Dec 7, 2011 at 6:05 AM, Aidan Corcoran >>> wrote: >>>> ?Dear all, >>>> >>>> ?I'm trying to remove some text after the period (a decimal point) in >>>> the data frame 'hi', below. This is one step in formatting a table. So >>>> I would like e.g. >>>> "2.0" to become "2" >>>> and "5.3" to be "5.3", >>>> where the variable digordered contains the number of digits after the >>>> decimal that I would like to display, in the same order in which the >>>> variables appear in hi. If it makes it easier to use, this info is >>>> also contained in the dataframe nam2. The reason the numbers are >>>> recorded as characters is because I used format to get a thousand >>>> separator, which I also need. >>>> >>>> The string manipulation functions in R generally don't seem to work >>>> with matrices or data frames, so e.g. ? regexpr("\\.", ?hi[1,2]) works >>>> but not regexpr("\\.", hi). Finding the location of the period and >>>> then using substring was the approach I was thinking of taking, but >>>> this would seem to need for loops here. I was wondering if anyone >>>> knows any easier ways. >>>> >>>> Thanks very much for any help! >>>> >>>> Aidan >>>> >>>> >>>> digordered<- ?c(0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1) >>>> f<-structure(list(c("GDP (LCU,bn)", "GDP ($, bn)", "GDP per capita (LCU)", >>>> "Ratio to EZ GDP Per Cap", "Share of World GDP (Intl $, %)", >>>> "Real GDP Growth (%)", "Population (mn)", "Unemployment Rate (%)", >>>> "Ratio of Employed/Unemployed", "PPP Exchange Rate", "Nominal Exchange >>>> Rate (LCU per $)", >>>> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >>>> Central Gov", >>>> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >>>> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities" >>>> ), `2005` = c(35662, 809, 32128, 0.1, 4.3, 9, 1110, 3.5, NA, >>>> 14.7, 44.1, 4, 10.8, 7, 15, 22835, NA, NA, NA, NA), `2009` = c(61240, >>>> 1265, 52163, 0.1, 5.2, 6.8, 1174, NA, NA, 16.8, 48.4, 10.9, 12.2, >>>> 14, 31, 47180, 13.6, 9, 10.8, 42.8), `2010` = c(75122, 1632, >>>> 63100, 0.1, 5.5, 10.1, 1191, NA, NA, 18.5, 45.7, 12, NA, 15, >>>> 39, 56787, 14.7, 9.9, 10.5, 41.1), `2011` = c(87455, 1843, 72461, >>>> 0.1, 5.7, 7.8, 1207, NA, NA, 19.6, NA, 10.6, NA, NA, NA, NA, >>>> 13.5, 9.3, 14.3, 35.8), `2012` = c(99459, 2013, 81313, 0.1, 5.9, >>>> 7.5, 1223, NA, NA, 20.5, NA, 8.6, NA, NA, NA, NA, NA, NA, NA, >>>> NA)), .Names = c("", "2005", "2009", "2010", "2011", "2012"), row.names = c(NA, >>>> 20L), class = c("cast_df", "data.frame")) >>>> >>>> ?hi<-format(f,big.mark=",",scientific=F) >>>> ?regexpr("\\.", ?hi) #don't know to get location of "." in a dataframe of chars >>>> >>>> >>>> nam2<- ?structure(list(var1 = c("GDP (LCU,bn)", "GDP ($, bn)", "GDP >>>> per capita (LCU)", >>>> "Ratio to EZ GDP Per Cap", "GDP per capita (Intl $)", "EU GDP per >>>> capita (Intl $)", >>>> "Share of World GDP (Intl $, %)", "Real GDP Growth (%)", "Population (mn)", >>>> "Unemployment Rate (%)", "Ratio of Employed/Unemployed", "Employment (1000s)", >>>> "Unemployment (1000s)", "PPP Exchange Rate", "Nominal Exchange Rate >>>> (LCU per $)", >>>> "Inflation (%)", "Main Lending Rate to Private Sector (%)", "Claims on >>>> Central Gov", >>>> "Claims on Private Sector", "Bank Assets", "Regulator Capital to RWA", >>>> "Tier 1 Capital to RWA", "Return on Equity", "Liquid Assets to ST Liabilities", >>>> "Reserves"), digi = c(0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, >>>> 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0)), .Names = c("var1", "digi" >>>> ), row.names = c("96", "97", "98", "110", "99", "100", "101", >>>> "102", "103", "111", "112", "104", "105", "106", "107", "108", >>>> "109", "114", "115", "113", "119", "120", "121", "122", "116" >>>> ), class = "data.frame") >>>> >>>> ________________________ From jianfeng.mao at gmail.com Wed Dec 7 16:11:45 2011 From: jianfeng.mao at gmail.com (Mao Jianfeng) Date: Wed, 7 Dec 2011 16:11:45 +0100 Subject: [R] select integer intervals from a integer space Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Wed Dec 7 16:13:58 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Wed, 07 Dec 2011 10:13:58 -0500 Subject: [R] running texi2dvi without running bibtex In-Reply-To: References: Message-ID: <4EDF82B6.3040106@gmail.com> On 07/12/2011 6:47 AM, Aidan Corcoran wrote: > Dear all, > > I was hoping someone may know a way of running texi2dvi while ignoring > bibtex errors, or any other work around (such as not running bibtex at > all, if possible). > > The context is that I have an R program that does some calculations > and writes a table into various folders, one per country for several > countries. I have a latex file that takes the table as an input, and > this latex file is copied into each folder. I would like to use R to > compile the latex files, to avoid having to open and compile them > individually. The files are simple one page files with no citations, > so need no biblio. > > If I switch to one of the folders containing a table and a latex file and run > texi2dvi("onepager", pdf = TRUE, clean = FALSE, quiet = FALSE, > texi2dvi = getOption("texi2dvi"), > texinputs = NULL, index = TRUE) > I get > running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" > --pdf "onepager" -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/tex/latex" > -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/bibtex/bst"' had status 1 > and no pdf produced. > > I think the problem is that the absence of a biblio causes an error. > The files compile in Texniccenter (with a warning on "no \citation > commands" etc). Does anyone know of a trick to avoid this problem? > > Thanks very much for any help! You might want to check the MikTeX documentation to see if there's an option to do that, but I couldn't spot one listed in "texi2dvi --help". So I'd suggest that you don't use the texi2dvi executable, just run pdflatex via texi2dvi("onepager", texi2dvi="pdflatex", ...) (or by setting the texi2dvi option) with the ... being appropriate other commands. If that doesn't work, then write a batch or cmd file to do exactly what you want, and use system() to run it. Duncan Murdoch From gunter.berton at gene.com Wed Dec 7 16:18:30 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Wed, 7 Dec 2011 07:18:30 -0800 Subject: [R] making changes to global variables in functions In-Reply-To: <4EDF5D29.5050404@googlemail.com> References: <4EDF5D29.5050404@googlemail.com> Message-ID: None of this pass by reference complexity is necessary. Here's how to do it without references or environments. A <- list(n=100,won=0) B <- list(n=100,won=0) f <- function(x,y) { nmx <- deparse(substitute(x)) nmy <- deparse(substitute(y)) x$n <-50; y$n <- 50 assign(nmx,x, pos=parent.frame()) assign(nmy,y,pos=parent.frame()) invisible(NULL) } ## Does it work: > A <- list(n=100,won=0) > B <- list(n=100,won=0) > > A $n [1] 100 $won [1] 0 > B $n [1] 100 $won [1] 0 > f(A,B) > A $n [1] 50 $won [1] 0 > B $n [1] 50 $won [1] 0 However, one may fairly ask whether doing things this way is wise -- and the answer is probably not: better to pass a list of lists, make the changes in the passed copy, and then explicitly assign back the results: g <- function(l,...) {... your code ...} z <- list(A,B) z <- g(z) Cheers, Bert On Wed, Dec 7, 2011 at 4:33 AM, Janko Thyson wrote: > Basically, I see two options here: > > 1) Using environments > > # Temp environment > env <- new.env(parent=emptyenv()) > env$state1 <- list(n=100, won=0) > env$state2 <- list(n=100, won=0) > > fight2 <- function(stateA, stateB, envir){ > # ?get(stateA, envir=envir)$n <- 50 > ? ? # The above is what you would want to do, but > ? ? # 'get<-' is not defined, so: > ? ? temp <- get(stateA, envir=envir) > ? ? temp$n <- 50 > ? ? assign(stateA, value=temp, envir=envir) > > ? ? # Same for stateB > ? ? temp <- get(stateB, envir=envir) > ? ? temp$n <- 50 > ? ? assign(stateA, value=temp, envir=envir) > > ? ? return(TRUE) > } > > fight2(stateA="state1", stateB="state2", envir=env) > > # Extract from environment > state1 <- env$state1 > state1 > state2 <- env$state2 > state2 > > 2) Using Reference Classes > > # Class Def > setRefClass("State", > ? ? fields=list(n="numeric", won="numeric"), > ? ? methods=list( > ? ? ? ? fight2=function(...){ > ? ? ? ? ? ? fight2Ref(.self=.self, ...) > ? ? ? ? } > ? ? ) > ) > # Set Generic > setGeneric(name="fight2Ref", signature=".self", def=function(.self, ...) > ? ? standardGeneric("fight2Ref")) > # Set Method > setMethod(f="fight2Ref", signature="State", > ? ? definition=function( > ? ? ? ? .self, > ? ? ? ? value, > ? ? ? ? ... > ? ? ){ > ? ? ? ? .self$n <- value > ? ? } > ) > # Note: > # You could also put the code inside 'fight2Ref' directly inside the > class def, > # but I don't want them to be too crowded, so I go by 'divide and conquer' > > # Instantiate objects > state1 <- new("State", n=100, won=0) > state1 > state2 <- new("State", n=100, won=0) > state2 > > # Apply method > state1$fight2(value=50) > state1 > state2$fight2(value=50) > state2 > > # Back to list > stateToList <- function(obj, ...){ > ? ? fields <- names(getRefClass("State")$fields()) > ? ? out <- lapply(fields, function(x.field){ > ? ? ? ? obj$field(x.field) > ? ? }) > ? ? names(out) <- fields > ? ? return(out) > } > state1 <- stateToList(state1) > state1 > state2 <- stateToList(state2) > state2 > > HTH, > Janko > > On 06.12.2011 22:06, R. Michael Weylandt wrote: >> No pointer functionality in R (that I know of), but if you want to >> return two objects as one the standard way is to put them in a list >> and to return that list. >> >> Michael >> >> On Tue, Dec 6, 2011 at 2:35 PM, Yev ?wrote: >>> I'm trying to write a function that takes several objects with many >>> different attributes and then changes their attributes. So what I wanted to >>> happen in the simplified example below is for the function to change the >>> attributes of the objects state1 and state2 that are passed to it. But >>> because stateA and stateB are local, this isn't working. Are there any easy >>> solutions? >>> >>> e.g., if I could combine the two objects stateA and stateB into a single >>> object, I could return it and then assign it back to objects state1 and >>> state2. Or if I could pass a pointer to the original object.. But I cannot >>> find an easy way of doing either. ?Thanks in advance.. >>> >>> state1<- list(n=100, won=0) >>> state2<- list(n=100, won=0) >>> >>> fight2<- function(stateA, stateB){ >>> ? ?stateA$n<- 50 >>> ? ?stateB$n<-50 >>> } >>> >>> fight2(state1,state2) >>> >>> state1$n >>> state2$n >>> >>> ? ? ? ? [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org ?mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >> ______________________________________________ >> R-help at r-project.org ?mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > > -- > ------------------------------------------------------------------------ > > *Janko Thyson* > janko.thyson at ku-eichstaett.de > > Catholic University of Eichst?tt-Ingolstadt > Ingolstadt School of Management > Statistics and Quantitative Methods > Auf der Schanz 49 > D-85049 Ingolstadt > > www.wfi.edu/lsqm > > Fon: +49 841 937-1923 > Fax: +49 841 937-1965 > > This e-mail and any attachment is for authorized use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be > copied, disclosed to, retained or used by any other party. > If you are not an intended recipient then please promptly delete this > e-mail and any attachment and all copies and inform the sender. > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From michael.weylandt at gmail.com Wed Dec 7 16:29:51 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 10:29:51 -0500 Subject: [R] scatterplotting stock returns using quantmod and pairs() In-Reply-To: <25158300.1323218195787.JavaMail.root@elwamui-norfolk.atl.sa.earthlink.net> References: <25158300.1323218195787.JavaMail.root@elwamui-norfolk.atl.sa.earthlink.net> Message-ID: The names of the list entries are not the same as the column names of the elements of the list (if that makes any sense)...you need to add them manually after the merge: this works library(quantmod) tickers <- c("SHY","TLT","SPY","IWM","GLD","IEV") getSymbols(tickers) AdjCloseReturns <- do.call(merge, lapply(tickers, function(x) dailyReturn(Ad(get(x))))) names(AdjCloseReturns) <- tickers pairs(as.matrix(AdjCloseReturns)) Michael On Tue, Dec 6, 2011 at 7:36 PM, alan lapedes wrote: > I want to get data for a set of ticker symbols and compute the daily return of the adjusted close using quantmod, and then scatterplot returns using pairs(). > > The following gets data for the list of tickers: > tickers <- c("SHY","TLT","SPY","IWM","GLD","IEV","ILF","EWJ","EPP","SAF","ASA") > AdjClosePrices <- do.call(merge, lapply(tickers, function(x) Ad(get(x)))) #get adjusted close prices > > First try at getting returns and plotting: > AdjCloseReturns <- do.call(merge, lapply(tickers, function(x) dailyReturn(Ad(get(x))) )) > But the resulting pairs plot > pairs(data.matrix(AdjCloseReturns),cex=0.01) > has uninformative text "daily.returns" down the diag on the plot. > > Second try at getting returns and plotting: using lapply instead > AdjCloseReturns <- lapply(AdjClosePrices,dailyReturn) > head(AdjCloseReturns) > this prints long columns of numbers (not what I expected) but at least I see a ticker symbol e.g: > $IEV.Adjusted > ? ? ? ? ? daily.returns > 2001-03-01 ?0.0000000000 > 2001-03-02 ?0.0037147103 > 2001-03-05 ?0.0088823094 > > > However trying to plot: > pairs(data.matrix(AdjCloseReturns),cex=0.01) > gives error: > Error in pairs.default(data.matrix(AdjCloseReturns), cex = 0.01) : > ?non-numeric argument to 'pairs' > > Any insight would be appreciated: I want to scatterplot the returns for a set of tickers using pairs() with the ticker symbol info down the diag (and would be nice to also have scatterplot on lower panel and the numerical correlation on upper panel) > Thanks! > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Wed Dec 7 16:36:34 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 10:36:34 -0500 Subject: [R] help wrapping findInterval into a function In-Reply-To: <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> Message-ID: Can't this be fixed by switching with to within? E.g., x = data.frame(a = 1:3, b = 4:6) AddRowSums <- function(df) within(df, d <- a + b) x <- AddRowSums(x) print(x) Michael On Wed, Dec 7, 2011 at 12:07 AM, David Winsemius wrote: > > On Dec 6, 2011, at 5:53 PM, Steve E. wrote: > >> Bill (and David), >> >> Thank you very much for taking the time to respond to my query. >> >> You were right, I was creating and calling the function exactly as you had >> predicted. ?I revised the structure based on your suggestion. ?It runs but >> the output is an array of the flags that are not attached to the data >> frame, >> not a new column in the data frame as was my intention. >> >> So, the new configuration I tried was like this (where DataFrame is not a >> real data frame but just the word "DataFrame"): >> >> WQFlags <- function(DataFrame) {DataFrame$CalciumFlag <- with(DataFrame, >> ifelse(variable == "CaD_ICP", (dataqualifier <- c("Y", 'Q', "", "A") >> [findInterval(DataFrame$value, c(-Inf, 0.027, 0.1, 100, Inf))]),"")) >> } >> >> I called it using: >> >> WaterQualityData <- WQFlags(WaterQualityData) > > > Unless you provide either the original data or an unambiguous ( at the level > the R interpreter would see, not at the level of what you see when you print > a dataframe) description of your data you will get at the very best educated > guesses. Use str() or dput(). > > >> >> Again, the output is simply an array of the flags, unattached to a data >> frame. ?Can you suggest a way to modify this to make it work as desired, >> or, >> in the worst case, can I attach the resulting array of flag values? > > > Do you mean "attach" in the sense of using the R function `attach`? If so, > then please do not. (And please ignore any advice or the examples concerning > that issue you might get from reading Crawley's text.) > > > -- > > Good night. > > David Winsemius, MD > West Hartford, CT > > > ______________________________________________ > R-help at 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 code. From dwinsemius at comcast.net Wed Dec 7 16:40:33 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Wed, 7 Dec 2011 10:40:33 -0500 Subject: [R] select integer intervals from a integer space In-Reply-To: References: Message-ID: <7AE956BD-CF1F-4A92-ADB7-943C60693FE9@comcast.net> On Dec 7, 2011, at 10:11 AM, Mao Jianfeng wrote: > Dear r-helpers, > > I have an one-dimensional integer space (defined by random integer > intervals, which overlapped each other or not). I would like to select > consecutive integer intervals with specific intra and inter length. > > Here, an integer interval means a set of consecutive increasing > integers, > defined by a begin integer and an end integer. > > This question has ever been asked here ( > http://stackoverflow.com/questions/8413990/selecting-integer-intervals-with-specific-intra-inter-length-from-random-integer) > . > Though it has attracted some responses, but I still have not > received any > hints of solution. Because you have a poorly posted problem. As far as I can tell you have not yet responded constructively to the attempts at clarification of the problem. Cross-posting to this list after waiting only 4 hours with an identical problem is bad Rhelp behavior. You should use the interactive facilities at SO and better respect the efforts already being extended on your behalf. > > I expect to hearing your helps/advice/directions in email or > response in > stackoverflow webpage. Thanks a lot in advance. > > Best wishes, > > Jian-Feng, > > > I describe my question using the following dummy. > > ############################## > > # (1) the data (integer space consist of integer intervals defined > by their > begin and end) I have, > > integer.space <- data.frame(begin=c(1,5,6,15,31,51,102), > end=c(7,9,13,21,49,52,109)) > > > ##################################### > > # (2) what I want is to select the consequent integer intervals with > # intra-length of 3 and inter-length of 2. and output the selected > # intervals as begin and end. In this selection, I would like to > select > # more integer intervals as most as it could be. > # the following are intervals I expected to be selected from the > dummy data > > begin,end > 1,3 > 6,8 > 11,13 > 16,18 > 31,33 > 36,38 > 41,43 > 46,48 > 102,105 Last item does NOT have length of 3. Why have you not responded to this observation on SO? And why would there not also be another line in the sequence after 102,104 that would be 106,108? My suggestion would be to go back to SO and be a better citizen. > > [[alternative HTML version deleted]] Posting in HTML is also bad citizenship on R-help. > > ______________________________________________ > R-help at 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 code. David Winsemius, MD West Hartford, CT From jianfeng.mao at gmail.com Wed Dec 7 17:20:43 2011 From: jianfeng.mao at gmail.com (Mao Jianfeng) Date: Wed, 7 Dec 2011 17:20:43 +0100 Subject: [R] select integer intervals from a integer space In-Reply-To: <7AE956BD-CF1F-4A92-ADB7-943C60693FE9@comcast.net> References: <7AE956BD-CF1F-4A92-ADB7-943C60693FE9@comcast.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From xfim.ll at gmail.com Wed Dec 7 17:45:00 2011 From: xfim.ll at gmail.com (Xavier =?utf-8?Q?Fern=C3=A1ndez_i_Mar=C3=ADn?=) Date: Wed, 7 Dec 2011 17:45:00 +0100 Subject: [R] Hinton Diagram for a matrix of weights Message-ID: <20111207164459.GA6069@deu.xfim> Hello, Although I have used a general search engine, r-seek, and browsed CRAN for contributed packages and R Gallery, I have not been able to find an implementation of Hinton Diagrams for representing weighting matrices using R. Does anyone knows a way of plotting weighting matrices in R? Thank you, -- - Xavier - From aidan.corcoran11 at gmail.com Wed Dec 7 18:24:24 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Wed, 7 Dec 2011 17:24:24 +0000 Subject: [R] running texi2dvi without running bibtex In-Reply-To: <4EDF82B6.3040106@gmail.com> References: <4EDF82B6.3040106@gmail.com> Message-ID: Hi Duncan, thanks for your help. Unfortunately texi2dvi("onepager", pdf = TRUE, texi2dvi = "pdflatex") seems to run into the same issue. I searched the documentation as you suggested (http://docs.miktex.org/2.9/manual/pdftex.html) and also checked pdflatex --help, but can't find a command line option to prevent the bibtex call. I think there should be one, since it's an option in texniccenter, but I guess this is now a latex not an r question (although I'm not sure exactly where I would put the command line option in the texi2dvi call above). If I can't find a way to do it then I'll take the batch approach as you suggested. Thanks again! Aidan I know texniccenter has an option to not run bibtex when calling pdflatex, but this is a tick box so I can?t find out what the command line option is from there. On Wed, Dec 7, 2011 at 3:13 PM, Duncan Murdoch wrote: > On 07/12/2011 6:47 AM, Aidan Corcoran wrote: >> >> Dear all, >> >> I was hoping someone may know a way of running texi2dvi while ignoring >> bibtex errors, or any other work around (such as not running bibtex at >> all, if possible). >> >> The context is that I have an R program that does some calculations >> and writes a table into various folders, one per country for several >> countries. I have a latex file that takes the table as an input, and >> this latex file is copied into each folder. I would like to use R to >> compile the latex files, to avoid having to open and compile them >> individually. The files are simple one page files with no citations, >> so need no biblio. >> >> If I switch to one of the folders containing a table and a latex file and >> run >> texi2dvi("onepager", pdf = TRUE, clean = FALSE, quiet = FALSE, >> texi2dvi = getOption("texi2dvi"), >> texinputs = NULL, index = TRUE) >> I get >> running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" >> --pdf "onepager" -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/tex/latex" >> -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/bibtex/bst"' had status 1 >> and no pdf produced. >> >> I think the problem is that the absence of a biblio causes an error. >> The files compile in Texniccenter (with a warning on "no \citation >> commands" etc). Does anyone know of a trick to avoid this problem? >> >> Thanks very much for any help! > > > You might want to check the MikTeX documentation to see if there's an option > to do that, but I couldn't spot one listed in "texi2dvi --help". So I'd > suggest that you don't use the texi2dvi executable, just run pdflatex via > > texi2dvi("onepager", texi2dvi="pdflatex", ...) > > (or by setting the texi2dvi option) with the ... being appropriate other > commands. If that doesn't work, then write a batch or cmd file to do > exactly what you want, and use system() to run it. > > Duncan Murdoch From gleynes+r at gmail.com Wed Dec 7 18:28:10 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Wed, 7 Dec 2011 11:28:10 -0600 Subject: [R] RSPython installation Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wdunlap at tibco.com Wed Dec 7 18:31:07 2011 From: wdunlap at tibco.com (William Dunlap) Date: Wed, 7 Dec 2011 17:31:07 +0000 Subject: [R] making changes to global variables in functions In-Reply-To: <4EDF5D29.5050404@googlemail.com> References: <4EDF5D29.5050404@googlemail.com> Message-ID: A third option is to put your state objects in a list and write a replacement function to modify the state of each. E.g., `n<-` <- function(state, value) { state[["n"]] <- value state } n <- function(state) state[["n"]] states <- list( list(n=100, won=0), list(n=101, won=1) ) for(i in seq_along(states)) { n(states[[i]]) <- i*1000 } invisible(lapply(states, dput)) # that should show: # structure(list(n = 1000, won = 0), .Names = c("n", "won")) # structure(list(n = 2000, won = 1), .Names = c("n", "won")) This can make it easier to understand the flow of data. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Janko Thyson > Sent: Wednesday, December 07, 2011 4:34 AM > To: R. Michael Weylandt > Cc: r-help at r-project.org; Yev > Subject: Re: [R] making changes to global variables in functions > > Basically, I see two options here: > > 1) Using environments > > # Temp environment > env <- new.env(parent=emptyenv()) > env$state1 <- list(n=100, won=0) > env$state2 <- list(n=100, won=0) > > fight2 <- function(stateA, stateB, envir){ > # get(stateA, envir=envir)$n <- 50 > # The above is what you would want to do, but > # 'get<-' is not defined, so: > temp <- get(stateA, envir=envir) > temp$n <- 50 > assign(stateA, value=temp, envir=envir) > > # Same for stateB > temp <- get(stateB, envir=envir) > temp$n <- 50 > assign(stateA, value=temp, envir=envir) > > return(TRUE) > } > > fight2(stateA="state1", stateB="state2", envir=env) > > # Extract from environment > state1 <- env$state1 > state1 > state2 <- env$state2 > state2 > > 2) Using Reference Classes > > # Class Def > setRefClass("State", > fields=list(n="numeric", won="numeric"), > methods=list( > fight2=function(...){ > fight2Ref(.self=.self, ...) > } > ) > ) > # Set Generic > setGeneric(name="fight2Ref", signature=".self", def=function(.self, ...) > standardGeneric("fight2Ref")) > # Set Method > setMethod(f="fight2Ref", signature="State", > definition=function( > .self, > value, > ... > ){ > .self$n <- value > } > ) > # Note: > # You could also put the code inside 'fight2Ref' directly inside the > class def, > # but I don't want them to be too crowded, so I go by 'divide and conquer' > > # Instantiate objects > state1 <- new("State", n=100, won=0) > state1 > state2 <- new("State", n=100, won=0) > state2 > > # Apply method > state1$fight2(value=50) > state1 > state2$fight2(value=50) > state2 > > # Back to list > stateToList <- function(obj, ...){ > fields <- names(getRefClass("State")$fields()) > out <- lapply(fields, function(x.field){ > obj$field(x.field) > }) > names(out) <- fields > return(out) > } > state1 <- stateToList(state1) > state1 > state2 <- stateToList(state2) > state2 > > HTH, > Janko > > On 06.12.2011 22:06, R. Michael Weylandt wrote: > > No pointer functionality in R (that I know of), but if you want to > > return two objects as one the standard way is to put them in a list > > and to return that list. > > > > Michael > > > > On Tue, Dec 6, 2011 at 2:35 PM, Yev wrote: > >> I'm trying to write a function that takes several objects with many > >> different attributes and then changes their attributes. So what I wanted to > >> happen in the simplified example below is for the function to change the > >> attributes of the objects state1 and state2 that are passed to it. But > >> because stateA and stateB are local, this isn't working. Are there any easy > >> solutions? > >> > >> e.g., if I could combine the two objects stateA and stateB into a single > >> object, I could return it and then assign it back to objects state1 and > >> state2. Or if I could pass a pointer to the original object.. But I cannot > >> find an easy way of doing either. Thanks in advance.. > >> > >> state1<- list(n=100, won=0) > >> state2<- list(n=100, won=0) > >> > >> fight2<- function(stateA, stateB){ > >> stateA$n<- 50 > >> stateB$n<-50 > >> } > >> > >> fight2(state1,state2) > >> > >> state1$n > >> state2$n > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org mailing list > >> https://stat.ethz.ch/mailman/listinfo/r-help > >> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > > R-help at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > > -- > ------------------------------------------------------------------------ > > *Janko Thyson* > janko.thyson at ku-eichstaett.de > > Catholic University of Eichst?tt-Ingolstadt > Ingolstadt School of Management > Statistics and Quantitative Methods > Auf der Schanz 49 > D-85049 Ingolstadt > > www.wfi.edu/lsqm > > Fon: +49 841 937-1923 > Fax: +49 841 937-1965 > > This e-mail and any attachment is for authorized use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be > copied, disclosed to, retained or used by any other party. > If you are not an intended recipient then please promptly delete this > e-mail and any attachment and all copies and inform the sender. > > > [[alternative HTML version deleted]] From bps0002 at auburn.edu Wed Dec 7 18:31:50 2011 From: bps0002 at auburn.edu (B77S) Date: Wed, 7 Dec 2011 09:31:50 -0800 (PST) Subject: [R] Problem with xlsx package In-Reply-To: References: Message-ID: <1323279110995-4169793.post@n4.nabble.com> If all else fails, open it in Excel... save as .csv read.csv() Nikhil Joshi wrote > > I am trying to read an xlsx spreadsheet (1506 rows, 501columns) all > populated but getting the following error: > Please advise as to how to get around this issue. > >> res <- read.xlsx("c:\\BSE_v2.xlsx",1) > Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : > java.lang.OutOfMemoryError: Java heap space > > Here is the session info: > >> sessionInfo() > R version 2.12.1 (2010-12-16) > Platform: i386-pc-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United > States.1252 > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] grid stats graphics grDevices utils datasets methods > base > > other attached packages: > [1] xlsx_0.2.4 xlsxjars_0.2.0 rJava_0.8-8 > > [4] quantmod_0.3-15 TTR_0.20-2 > Defaults_1.1-1 > [7] urca_1.2-4 RBGL_1.26.0 > graph_1.28.0 > > [10] colorspace_1.0-1 spatstat_1.21-4 > deldir_0.0-13 > > [13] mgcv_1.7-2 reshape_0.8.4 plyr_1.4 > > [16] fExtremes_2100.77 fTrading_2100.76 > fGarch_2110.80 > [19] fBasics_2110.79 timeSeries_2130.90 > timeDate_2130.91 > [22] mc2d_0.1-9 mvtnorm_0.9-96 > mixtools_0.4.4 > [25] boot_1.2-43 MASS_7.3-9 > SuppDists_1.1-8 > [28] ghyp_1.5.4 gplots_2.8.0 > caTools_1.11 > > [31] bitops_1.0-4.1 gdata_2.8.1 > gtools_2.6.2 > > [34] numDeriv_2010.11-1 xtable_1.5-6 > PerformanceAnalytics_1.0.3.2 > [37] sn_0.4-16 mnormt_1.4-0 xts_0.7-5 > > [40] zoo_1.6-4 RODBC_1.3-2 > > loaded via a namespace (and not attached): > [1] lattice_0.19-13 Matrix_0.999375-46 nlme_3.1-97 tools_2.12.1 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@ 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 code. > -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-xlsx-package-tp3298470p4169793.html Sent from the R help mailing list archive at Nabble.com. From gleynes+r at gmail.com Wed Dec 7 18:43:54 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Wed, 7 Dec 2011 11:43:54 -0600 Subject: [R] curve fitted ... how to retreive data In-Reply-To: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D9@HGUMAIL6.hgu.gu.se> References: <4B46FB7EED800046A5952FCFA92D3BA0347DF578D9@HGUMAIL6.hgu.gu.se> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From friendly at yorku.ca Wed Dec 7 18:52:52 2011 From: friendly at yorku.ca (Michael Friendly) Date: Wed, 07 Dec 2011 12:52:52 -0500 Subject: [R] How to scale arrows to approximately fill a plot region? Message-ID: <4EDFA7F4.1050104@yorku.ca> In a variety of graphic applications, I plot some data, together with arrows representing variables or linear transformations of variables as vectors in the same space, as in a biplot. In my applications, the scale of the arrows is arbitrary -- all that matters is relative length. I'd like to blow them up or shrink them to fit the available space in the plot. The origin is typically at some mean for (x,y), but that is not necessarily so. There must be some general, perhaps approximate solution for this problem, but I can't see it. Below is a simple test case. I found the approximate solution, scale <- 14 by trial and error. [I'm ignoring aspect ratio, because that determines the bbox I calculate from the plot.] set.seed(123135251) x <- 2 + 5* rnorm(50) y <- 5 + 2* rnorm(50) plot(x,y) # get bounding box of plot region, in data coordinates bbox <- matrix(par("usr"), 2, 2, dimnames=list(c("min", "max"),c("x", "y"))) # center vectors here origin <- colMeans(bbox) points(origin[1], origin[2], pch=16, cex=2) # vectors to be displayed in this space vectors <- cbind( runif(5), (runif(5)-.5)) # draw arrows, given origin and length in xy Arrows <- function(xy, lenxy, length=.1, angle=10, ...) { arrows(xy[1], xy[2], xy[1]+lenxy[,1], xy[2]+lenxy[,2], length=length, angle=angle, ...) } ## How to determine scale so that vectors ~ fill the bounding box??? scale <- 14 Arrows(origin, scale*vectors) -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA From mark.heckmann at gmx.de Wed Dec 7 19:09:15 2011 From: mark.heckmann at gmx.de (Mark Heckmann) Date: Wed, 7 Dec 2011 19:09:15 +0100 Subject: [R] generalized procrustes analysis without translation Message-ID: Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: From comtech.usa at gmail.com Wed Dec 7 19:14:27 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 12:14:27 -0600 Subject: [R] nice report generator? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From mailinglist.honeypot at gmail.com Wed Dec 7 19:18:40 2011 From: mailinglist.honeypot at gmail.com (Steve Lianoglou) Date: Wed, 7 Dec 2011 13:18:40 -0500 Subject: [R] nice report generator? In-Reply-To: References: Message-ID: Hi, On Wed, Dec 7, 2011 at 1:14 PM, Michael wrote: > Hi all, > > I am looking for recommendations/pointers about best report generator you > think that are currently available? > > i.e. the package that can help turn console output into nice-looking neat > report to send to bosses? Perhaps you should turn your analysis into a Sweave document? There are many refs you can follow up on Sweave online -- here's one: http://www.stat.uni-muenchen.de/~leisch/Sweave/ HTH, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact From sarah.goslee at gmail.com Wed Dec 7 19:19:27 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Wed, 7 Dec 2011 13:19:27 -0500 Subject: [R] nice report generator? In-Reply-To: References: Message-ID: Sweave. Or ODFWeave, if Sweave/LaTeX are too much overhead. But really, it depends on what kind of report output you need to deliver. Printed? HTML? PDF? Sarah On Wed, Dec 7, 2011 at 1:14 PM, Michael wrote: > Hi all, > > I am looking for recommendations/pointers about best report generator you > think that are currently available? > > i.e. the package that can help turn console output into nice-looking neat > report to send to bosses? > > thanks a lot! >. -- Sarah Goslee http://www.functionaldiversity.org From janko.thyson.rstuff at googlemail.com Wed Dec 7 19:43:51 2011 From: janko.thyson.rstuff at googlemail.com (Janko Thyson) Date: Wed, 7 Dec 2011 19:43:51 +0100 Subject: [R] nice report generator? In-Reply-To: References: Message-ID: <4EDFB3E7.1070302@googlemail.com> I like knitr. IMHO Yihui really came up with a killer package there: http://yihui.github.com/knitr/ On 07.12.2011 19:19, Sarah Goslee wrote: > Sweave. > > Or ODFWeave, if Sweave/LaTeX are too much overhead. > > But really, it depends on what kind of report output you need to > deliver. Printed? HTML? PDF? > > Sarah > > On Wed, Dec 7, 2011 at 1:14 PM, Michael wrote: >> Hi all, >> >> I am looking for recommendations/pointers about best report generator you >> think that are currently available? >> >> i.e. the package that can help turn console output into nice-looking neat >> report to send to bosses? >> >> thanks a lot! >> . > > From dschruth at u.washington.edu Wed Dec 7 19:45:35 2011 From: dschruth at u.washington.edu (David M. Schruth) Date: Wed, 07 Dec 2011 10:45:35 -0800 Subject: [R] adding hyperlinked text to pdf plot In-Reply-To: References: Message-ID: <4EDFB44F.8090105@u.washington.edu> Hi Justin, It sounds like you might be able to use the 'hyperplot()' function (in the 'caroline' package) for creating an html imagemap around your figure. This is assuming all that you want to do is interactivate a 2-dimensional scatter plot. You'd also lose PDF-pagination but the auto-tabbing of most browsers from each independent hyperplot() call should help you stay organized. Say you use hyperplot() like so: ---------------------------------------------------------------- library(caroline) chr1 <- data.frame(pos=1:1000, cov=rnorm(1000,10,1), url=paste('http://my.genome.org/id=',1:1000,sep='')) hyperplot(x='pos',y='cov', annout=chr1, link='url', xlab='position', ylab='coverage') chr2 <- data.frame(pos=1:1000, cov=rnorm(1000,10,1), url=paste('http://my.genome.org/id=',1:1000,sep='')) hyperplot(x='pos',y='cov', annout=chr2, link='url', xlab='position', ylab='coverage') #chr3 <- #...etc... ---------------------------------------------------------------- With this approach you'd have each chromosome on a different tab. Cheers, Dave On 12/5/2011 12:20 PM, Yihui Xie wrote: > Sorry I experimented with tikzDevice using \href{}{} but failed. > > You can probably try the old image hotspot technique in HTML. I > remember someone did this before in R, but I cannot find the link to > the work now. The key is your need to use the two functions grconvertX > and grconvertY. > > Regards, > Yihui > -- > Yihui Xie > Phone: 515-294-2465 Web: http://yihui.name > Department of Statistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > > On Mon, Dec 5, 2011 at 2:10 PM, Justin Fincher wrote: >> For example, say I am plotting some data that is genomic and therefore >> maps to a specific locus on the human genome, like a gene. I was >> hoping to have the title of the plot display the gene name, but have >> it be a link so that clicking on it would take you to those >> coordinates on a public browser, like USCS's genome browser. So >> basically, I was hoping to have text in a plot generated by R function >> as a normal html-style link. >> >> - Fincher >> >> >> On Mon, Dec 5, 2011 at 14:09, Yihui Xie wrote: >>> It seems I missed the context of this post -- who is "you", and what >>> is "something other than the URL"? >>> >>> I feel the tikzDevice package should be an option for the task. >>> >>> Regards, >>> Yihui >>> -- >>> Yihui Xie >>> Phone: 515-294-2465 Web: http://yihui.name >>> Department of Statistics, Iowa State University >>> 2215 Snedecor Hall, Ames, IA >>> >>> >>> >>> On Mon, Dec 5, 2011 at 12:39 PM, Justin Fincher wrote: >>>> Howdy, >>>> I have read that if you put a URL in the text of a plot being saved >>>> into pdf, the result is a functional hyperlink. I am interested in >>>> having text in a plot that is linked to a URL, but I would like the >>>> text to be something other than the URL. Is this possible? Thank you. >>>> >>>> - Fincher >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>> >>> -- >>> This message has been scanned for viruses and >>> dangerous content by MailScanner, and is >>> believed to be clean. >>> > > ______________________________________________ > R-help at 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 code. From david at revolutionanalytics.com Wed Dec 7 19:49:31 2011 From: david at revolutionanalytics.com (David Smith) Date: Wed, 7 Dec 2011 10:49:31 -0800 Subject: [R] Revolutions Blog: November Roundup Message-ID: I write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of November: R 2.14 now includes SVG support for Windows: http://bit.ly/vKQ0UC The submissions for the Applications of R in Business contest are available for viewing online: http://bit.ly/urjg8F A tutorial on using the Rdatamarket package to import public datasets into R: http://bit.ly/t7vUok Free books on R for multivariate analysis, biomedical statistics, and time series available for download: http://bit.ly/sKxZSV Revolution R Enterprise 5.0 has been released: http://bit.ly/vrn6wU . Download the slides and replay for the webinar here: http://bit.ly/s0VtVQ . It's available for free download to members of the academic community: http://bit.ly/uv0fPf . There's a review of the new release here: http://bit.ly/rMe54q Hadley Wickham presents the "R Development Master Class" in San Francisco: http://bit.ly/eC5YQe Slides and a video interview from a talk on the RHadoop project given at Hadoop World 2011: http://bit.ly/rGdYeG Using calendar heat maps in R to visualize training for a marathon: http://bit.ly/rvy1ix Modeling 70Gb of birth records data using the RevoScaleR package: http://bit.ly/tLwvGU Why we do need to deal with big data in R: http://bit.ly/rFmW9N The University of Washington is offering a web-based course on financial modeling with R: http://bit.ly/sLXYCY R performance tip: pre-allocate a vector, rather than extending it in a loop: http://bit.ly/ueKsMc A review of the new book "The Art of R Programming" by Norman Matloff: http://bit.ly/vTPZ8S R remains the preferred tool of participants in the Kaggle predictive modeling competitions: http://bit.ly/uN9DkL Other non-R-related stories in the past month included: data mining wine (http://bit.ly/ueyIF0 ), creating a "holodeck" with Kinect sensors (http://bit.ly/vv5pAV ), visualizing a year of the sky (http://bit.ly/rLv0zB ) and a radio series on Big Data (http://bit.ly/vSeCWm ). Meeting times for local R user groups (http://bit.ly/eC5YQe ) can be found on the updated R Community Calendar at: http://bit.ly/bb3naW If you're looking for more articles about R, you can find summaries from previous months at http://blog.revolutionanalytics.com/roundups/. Join the Revolution mailing list at http://revolutionanalytics.com/newsletter to be alerted to new articles on a monthly basis. As always, thanks for the comments and please keep sending suggestions to me at david at revolutionanalytics.com . Don't forget you can also follow the blog using an RSS reader like Google Reader, or by following me on Twitter (I'm @revodavid). Cheers, # David -- David M Smith VP of Marketing, Revolution Analytics? http://blog.revolutionanalytics.com Tel: +1 (650) 646-9523 (Palo Alto, CA, USA) From comtech.usa at gmail.com Wed Dec 7 19:50:12 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 12:50:12 -0600 Subject: [R] nice report generator? In-Reply-To: <4EDFB3E7.1070302@googlemail.com> References: <4EDFB3E7.1070302@googlemail.com> Message-ID: Thanks a lot! Typically the console output will be something like this: Analysis of Variance Table Response: as.double(my.delta) Df Sum Sq Mean Sq F value Pr(>F) my.factor 1 0 0.005 2e-04 0.988 Residuals 1484 32630 21.988 I am looking for a report-generator to make this look nicer and tabularize it... It doesn't matter if the outputs are in HTML, PDF, etc. As long as it looks fantastic, that's what we are looking for ... and also the convenience is important... we dont' want to create Latex document with manual insertaion of tables and plots... These need automation... thx a lot! On 12/7/11, Janko Thyson wrote: > I like knitr. IMHO Yihui really came up with a killer package there: > http://yihui.github.com/knitr/ > > On 07.12.2011 19:19, Sarah Goslee wrote: >> Sweave. >> >> Or ODFWeave, if Sweave/LaTeX are too much overhead. >> >> But really, it depends on what kind of report output you need to >> deliver. Printed? HTML? PDF? >> >> Sarah >> >> On Wed, Dec 7, 2011 at 1:14 PM, Michael wrote: >>> Hi all, >>> >>> I am looking for recommendations/pointers about best report generator you >>> think that are currently available? >>> >>> i.e. the package that can help turn console output into nice-looking neat >>> report to send to bosses? >>> >>> thanks a lot! >>> . >> >> > > From John.Visagie at up.ac.za Wed Dec 7 13:06:36 2011 From: John.Visagie at up.ac.za (John Visagie) Date: Wed, 07 Dec 2011 14:06:36 +0200 Subject: [R] Object xxx not found Message-ID: <4EDF72EC020000930000BD35@gwise.up.ac.za> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From alexandre.chausson at unil.ch Wed Dec 7 11:18:19 2011 From: alexandre.chausson at unil.ch (AlexC) Date: Wed, 7 Dec 2011 02:18:19 -0800 (PST) Subject: [R] axis thickness in plot() In-Reply-To: <4EDE5463.1080304@ucalgary.ca> References: <1323189326756-4165430.post@n4.nabble.com> <4EDE5463.1080304@ucalgary.ca> Message-ID: <1323253099557-4168437.post@n4.nabble.com> RESOLVED dear Peter thank you for your quick response naturally, I was trying lwd before using lwd.axis, the only reason i tried lwd.axis is because lwd wasn't working yesterday. I restarted R today and for some reason the exact same script, with the lwd argument, that gave me the lwd error yesterday is working Sincerely, Alexandre C. -- View this message in context: http://r.789695.n4.nabble.com/axis-thickness-in-plot-tp4165430p4168437.html Sent from the R help mailing list archive at Nabble.com. From rahul at schmizz.net Wed Dec 7 12:15:32 2011 From: rahul at schmizz.net (rahulthewall) Date: Wed, 7 Dec 2011 03:15:32 -0800 (PST) Subject: [R] PLSA Algorithm in R Message-ID: <1323256532352-4168574.post@n4.nabble.com> Hello everyone, Newbie here (both in terms of R, and in my knowledge of statistics). I need to run LDA and PLSA on a set of data that I have. While I have managed to find a package for LDA, I have not been able to find anything for PLSA. There is a package for LSA, but I am not sure whether I can use the same for PLSA as well. I am currently trying to see whether that is possible (reading up on PLSA and LSA to better understand the differences and similarities). Meanwhile, I am posting this here in the hope that someone out there could help me out. So if there is anyone who knows how to implement PLSA in R, please help me out. Thanks Rahul -- View this message in context: http://r.789695.n4.nabble.com/PLSA-Algorithm-in-R-tp4168574p4168574.html Sent from the R help mailing list archive at Nabble.com. From raoul.t.dsouza at gmail.com Wed Dec 7 12:23:18 2011 From: raoul.t.dsouza at gmail.com (RaoulD) Date: Wed, 7 Dec 2011 03:23:18 -0800 (PST) Subject: [R] Select a set of rows based on a condition Message-ID: <1323256998142-4168594.post@n4.nabble.com> Hi, I need help with selecting a set of rows from a column in a dataset, that matches a string criteria - start and end. The dataset is : List|Index 10 ABC 20 DEF 10 GHI 50 JKL 40 MNO 20 PQR 10 Start="DEF" End = "MNO" Ideally, I would like to select the data from DEF to MNO into a new data set. My logic is 1) get the row number for DEF 2) get the row number for MNO 3) subset the rows from DEF to MNO Can someone please help me with the R code for this as am a little rusty. Please let me know if you have questions. Thanks in advance! Raoul -- View this message in context: http://r.789695.n4.nabble.com/Select-a-set-of-rows-based-on-a-condition-tp4168594p4168594.html Sent from the R help mailing list archive at Nabble.com. From junhak3244 at naver.com Wed Dec 7 13:18:32 2011 From: junhak3244 at naver.com (jurassic85) Date: Wed, 7 Dec 2011 04:18:32 -0800 (PST) Subject: [R] fuctional iteration..... Message-ID: <1323260312368-4168737.post@n4.nabble.com> g(x)=1+1/x-log(x) g(x)=0 => f(x)=g(x)+x=x I want to solve this problem(x) by "fucntional iteration" method.... plz... -- View this message in context: http://r.789695.n4.nabble.com/fuctional-iteration-tp4168737p4168737.html Sent from the R help mailing list archive at Nabble.com. From pmassicotte at hotmail.com Wed Dec 7 15:30:51 2011 From: pmassicotte at hotmail.com (Filoche) Date: Wed, 7 Dec 2011 06:30:51 -0800 (PST) Subject: [R] Hist and extra space Message-ID: <1323268251333-4169121.post@n4.nabble.com> Hi everyone. I have an histogram like this one: http://imageshack.us/photo/my-images/442/dfsdfsdj.jpg/ I would like to remove the extra space under the histogram so it "touch" the x axis. Is it possible? Here's my code. hist(X, freq = F, col = 'gray', axes = FALSE) abline(v = cyano_euk_min, col = 'red', lty = 3, lw = 2) abline(v = cyano_euk_max, col = 'red', lty = 3, lw = 2) axis(1, tck = -0.02) axis(2, tck = -0.02) box(bty = 'l') Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Hist-and-extra-space-tp4169121p4169121.html Sent from the R help mailing list archive at Nabble.com. From bia.cdc at gmail.com Wed Dec 7 15:52:09 2011 From: bia.cdc at gmail.com (bcdc) Date: Wed, 7 Dec 2011 06:52:09 -0800 (PST) Subject: [R] reading partial data set Message-ID: <1323269529129-4169210.post@n4.nabble.com> Hi all, I'm trying to read a data set into R, but the file is messy, so I have to do it partially. The whole data is in a .txt file, and the values are separated by a space. So far ok. The problem is that in this file, not all the lines have the same number of elements, and the reading stops. And I loose the reading of the previous lines. ex. of data set: 11 12 13 21 22 23 31 32 33 34 41 42 43 44 51 52 53 61 62 63 64 71 72 73 74 75 81 82 (...) If I use the following: > aux <- read.table(file="data.txt", sep=" ", header=F, > colClasses="numeric") it stops the reading with the error message: > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, > : line 3 did not have 3 elements Calls: read.table -> scan and I loose the reading of the previous reading. And since I'm running my data in a cluster (it's actually a big data set) the error halts my execution. What I tried at first was to do > aux1 <- read.table(file="data.txt", sep=" ", header=F, > colClasses="numeric", nrow=2) > aux2 <- read.table(file="data.txt", sep=" ", header=F, > colClasses="numeric", skip=2, nrow=2) > aux3 <- read.table(file="data.txt", sep=" ", header=F, > colClasses="numeric", skip=4, nrow=1) > (...) This procedure works. However, I have about 5000 lines to read, and I don't know precisely which ones are messy. So what I have to do, to keep the above procedure is: 1. try to read data set 2. check error message to find out which line has different size 3. read data set for the block of same sized lines (aux1) 4. read data set skipping the lines read in aux1; check error message to find out which line has different size 5. read data set for second block of same sized lines (aux2) 6. read data set skipping the lines read in aux1 and aux2; check error message to find out which line has different size (and so on) So, if I had only a hundred lines, this would be OK, but I have a few thousands, and It'll take me forever to finish reading if I need to read block by block and check manually where is the problem. My question is: is there anyway I can read my data with some "if's" or "while's" to control the read.table? What I'd like to do is something like: 1. read data set while all lines has the same length 2. if a line has different length from the previous ones, store what was read in a variable and abort reading 3. start reading data set from the line where it stopped, and read it while all lines has the same length 4. if a line has different length from the previous ones, store what was read in a variable and abort reading 5. start reading data set from the line where it stopped, and read it while all lines has the same length 6. if a line has different length from the previous ones, store what was read in a variable and abort reading (and so on until the whole data set was finally read) This would make the program run by itself, and solve my problem. It's OK if it returns a couple of variables, I can just bind them and assemble my data set as I need, since I know how it should look like in the end. Thanks in advance for suggestions! Beatriz -- View this message in context: http://r.789695.n4.nabble.com/reading-partial-data-set-tp4169210p4169210.html Sent from the R help mailing list archive at Nabble.com. From vodnyles at gmail.com Wed Dec 7 16:13:13 2011 From: vodnyles at gmail.com (senplanet) Date: Wed, 7 Dec 2011 07:13:13 -0800 (PST) Subject: [R] Raster:matrix rows as x dimension Message-ID: <1323270793682-4169292.post@n4.nabble.com> Hello, I am new in R. I have problem to plot raster plot. My data file consists 24 columns and approximately 18000 rows. I would like to create some kind of hovmuller plot. so I did: r <- raster("test", package="raster") but it automatically uses columns for x-dimension and rows for y-dimension. Is there way to use rows as X and columns as Y? -- View this message in context: http://r.789695.n4.nabble.com/Raster-matrix-rows-as-x-dimension-tp4169292p4169292.html Sent from the R help mailing list archive at Nabble.com. From bruce.moran at teagasc.ie Wed Dec 7 16:39:22 2011 From: bruce.moran at teagasc.ie (bmoran) Date: Wed, 7 Dec 2011 07:39:22 -0800 (PST) Subject: [R] Output table from for loop Message-ID: <1323272362813-4169386.post@n4.nabble.com> Hi, this might be basic but can't get it to work and it is hampering my R usage: #the loop is checking variance of rows, and cutting out rows with var>numVec[i] #I define outMat as object names I want to output to (does this make sense? how else #can I define sequential numbered output?) #numVec is numbers I use in the loop head(Counts) AN1 AN2 AN3 AN4 var GENE1 99 0 6 0 2360 GENE2 183 136 137 160 496 GENE3 301 199 233 187 1856 outMat<-paste("NewCounts", 1:5, sep="_") #names of numVec<-c(100,200,500,1000,1500) cutGenes<-function(x) { for (i in 1:5) { keep<- Counts$var References: Message-ID: Peter, You're quite right; it's nearly impossible to make progress without a working example. I created an ** extremely simplified ** example for distribution. The real data has numeric, character, and boolean classes. The file still takes 25.08 seconds to read, despite it's small size. I neglected to mention that I'm using R 2.13.0 and I"m on a windows 7 machine (not that it should particularly matter with this type of data / functions). ## The code: options(stringsAsFactors=FALSE) system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) str(dat, 0) Thanks again! On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard wrote: > > On Dec 6, 2011, at 22:33 , Gene Leynes wrote: > > > Mark, > > > > Thanks for your suggestions. > > > > That's a good idea about the NULL columns; I didn't think of that. > > Surprisingly, it didn't have any effect on the time. > > Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you > fix both? > > >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), > >> rep(NULL,3696)). > > As a general matter, if you want people to dig into this, they need some > paraphrase of the file to play with. Would it be possible to set up a small > R program that generates a data file which displays the issue? Everything I > try seems to take about a second to read in. > > -pd > > > > > This problem was just a curiosity, I already did the import using Excel > and > > VBA. I was just going to illustrate the power and simplicity of R, but > it > > ironically it's been much slower and harder in R... > > The VBA was painful and messy, and took me over an hour to write; but at > > least it worked quickly and reliably. > > The R code was clean and only took me about 5 minutes to write, but the > run > > time was prohibitively slow! > > > > I profiled the code, but that offers little insight to me. > > > > Profile results with 10 line file: > > > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > > $by.self > > self.time self.pct total.time total.pct > > scan 12.24 53.50 12.24 53.50 > > read.table 10.58 46.24 22.88 100.00 > > type.convert 0.04 0.17 0.04 0.17 > > make.names 0.02 0.09 0.02 0.09 > > > > $by.total > > total.time total.pct self.time self.pct > > read.table 22.88 100.00 10.58 46.24 > > scan 12.24 53.50 12.24 53.50 > > type.convert 0.04 0.17 0.04 0.17 > > make.names 0.02 0.09 0.02 0.09 > > > > $sample.interval > > [1] 0.02 > > > > $sampling.time > > [1] 22.88 > > > > > > Profile results with 250 line file: > > > >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > > $by.self > > self.time self.pct total.time total.pct > > scan 23.88 68.15 23.88 68.15 > > read.table 10.78 30.76 35.04 100.00 > > type.convert 0.30 0.86 0.32 0.91 > > character 0.02 0.06 0.02 0.06 > > file 0.02 0.06 0.02 0.06 > > lapply 0.02 0.06 0.02 0.06 > > unlist 0.02 0.06 0.02 0.06 > > > > $by.total > > total.time total.pct self.time self.pct > > read.table 35.04 100.00 10.78 30.76 > > scan 23.88 68.15 23.88 68.15 > > type.convert 0.32 0.91 0.30 0.86 > > sapply 0.04 0.11 0.00 0.00 > > character 0.02 0.06 0.02 0.06 > > file 0.02 0.06 0.02 0.06 > > lapply 0.02 0.06 0.02 0.06 > > unlist 0.02 0.06 0.02 0.06 > > simplify2array 0.02 0.06 0.00 0.00 > > > > $sample.interval > > [1] 0.02 > > > > $sampling.time > > [1] 35.04 > > > > > > > > > > On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: > > > >> hi gene: maybe someone else will reply with some subtleties that I'm > not > >> aware of. one other thing > >> that might help: if you know which columns you want , you can set the > >> others to NULL through > >> colClasses and this should speed things up also. For example, say you > knew > >> you only wanted the > >> first four columns and they were character. then you could do, > >> > >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), > >> rep(NULL,3696)). > >> > >> hopefully someone else will say something that does the trick. it seems > >> odd to me as far as the > >> difference in timings ? good luck. > >> > >> > >> > >> > >> > >> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: > >> > >>> Mark, > >>> > >>> Thank you for the reply > >>> > >>> I neglected to mention that I had already set > >>> options(stringsAsFactors=FALSE) > >>> > >>> I agree, skipping the factor determination can help performance. > >>> > >>> The main reason that I wanted to use read.table is because it will > >>> correctly determine the column classes for me. I don't really want to > >>> specify 3700 column classes! (I'm not sure what they are anyway). > >>> > >>> > >>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds > wrote: > >>> > >>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. > >>>> If you know what your variables are ahead of time and what you want > them to > >>>> be, this allows you to be specific by specifying, character or > numeric, > >>>> etc and often it makes things faster. others will have more to say. > >>>> > >>>> also, if most of your variables are characters, R will try to turn > >>>> convert them into factors by default. If you use as.is = TRUE it > won't > >>>> do this and that might speed things up also. > >>>> > >>>> > >>>> Rejoinder: above tidbits are just from experience. I don't know if > >>>> it's in stone or a hard and fast rule. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes > wrote: > >>>> > >>>>> ** Disclaimer: I'm looking for general suggestions ** > >>>>> I'm sorry, but can't send out the file I'm using, so there is no > >>>>> reproducible example. > >>>>> > >>>>> I'm using read.table and it's taking over 30 seconds to read a tiny > >>>>> file. > >>>>> The strange thing is that it takes roughly the same amount of time if > >>>>> the > >>>>> file is 100 times larger. > >>>>> > >>>>> After re-reviewing the data Import / Export manual I think the best > >>>>> approach would be to use Python, or perhaps the readLines function, > but > >>>>> I > >>>>> was hoping to understand why the simple read.table approach wasn't > >>>>> working > >>>>> as expected. > >>>>> > >>>>> Some relevant facts: > >>>>> > >>>>> 1. There are about 3700 columns. Maybe this is the problem? Still > >>>>> the > >>>>> > >>>>> file size is not very large. > >>>>> 2. The file encoding is ANSI, but I'm not specifying that in the > >>>>> > >>>>> function. Setting fileEncoding="ANSI" produces an "unsupported > >>>>> conversion" > >>>>> error > >>>>> 3. readLines imports the lines quickly > >>>>> 4. scan imports the file quickly also > >>>>> > >>>>> > >>>>> Obviously, scan and readLines would require more coding to identify > >>>>> columns, etc. > >>>>> > >>>>> my code: > >>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', > >>>>> header=TRUE)) > >>>>> > >>>>> It's taking 33.4 seconds and the file size is only 315 kb! > >>>>> > >>>>> Thanks > >>>>> > >>>>> Gene > >>>>> > >>>>> [[alternative HTML version deleted]] > >>>>> > >>>>> ______________________________________________ > >>>>> R-help at 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 code. > >>>>> > >>>> > >>>> > >>> > >> > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at 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 code. > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > > -------------- next part -------------- //Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Caesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Ununquadium Ununpentium Ununhexium Ununseptium Ununoctium Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 68.34640865 From vojtech.huser at gmail.com Wed Dec 7 17:23:00 2011 From: vojtech.huser at gmail.com (sakaton) Date: Wed, 7 Dec 2011 08:23:00 -0800 (PST) Subject: [R] Problem with xlsx package In-Reply-To: <4D544261.7080807@openanalytics.eu> References: <4D544261.7080807@openanalytics.eu> Message-ID: <1323274980580-4169522.post@n4.nabble.com> I have the same problem and same Java error. > sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] grDevices datasets splines graphics stats tcltk utils methods base other attached packages: [1] xlsx_0.3.0 xlsxjars_0.3.0 rJava_0.9-1 plyr_1.6 stringr_0.5 sqldf_0.4-2 [7] chron_2.3-42 gsubfn_0.5-7 proto_0.3-9.2 RSQLite.extfuns_0.0.1 RSQLite_0.9-4 DBI_0.2-5 [13] RODBC_1.3-3 svSocket_0.9-51 TinnR_1.0.3 R2HTML_2.2 Hmisc_3.8-3 survival_2.36-9 loaded via a namespace (and not attached): [1] cluster_1.14.0 grid_2.13.1 lattice_0.19-30 svMisc_0.9-63 tools_2.13.1 -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-xlsx-package-tp3298470p4169522.html Sent from the R help mailing list archive at Nabble.com. From simon.gingins at unine.ch Wed Dec 7 17:51:23 2011 From: simon.gingins at unine.ch (GINGINS Simon) Date: Wed, 7 Dec 2011 16:51:23 +0000 Subject: [R] axis line width in boxplots Message-ID: Dear R-helpers, I've produced boxplots for a publication but I have a visual problem that I don't mamage to fix. For visual reasons, I reduced the line width with "lwd=0.5". It works nicely for all the lines (frame of the plot, boxes, notches and medians) exept for the axis line. Thus the two axes appear twice the width of the frame. How can I control only the width of the axis line? Or, other option, how can I get rid of the axis line without getting rid of the tickmarks (as below the axis, there is the line from the frame, I don't really need the axis line)? Thank you for all the help you guys provide, it is extremely useful! Regards Simon Gingins PhD student University of Neuch?tel Institute of Biology Department of Behavioural Ecology Rue Emile-Argand 11 2000 Neuch?tel Switzerland +41 32 718 31 09 From ifejobi at gmail.com Wed Dec 7 17:55:42 2011 From: ifejobi at gmail.com (ifejobi) Date: Wed, 7 Dec 2011 08:55:42 -0800 (PST) Subject: [R] survreg() provides same results with different distirbutions for left censored data Message-ID: <1323276942133-4169671.post@n4.nabble.com> Hello, I'm working with some left censored survival data using accelerated failure time models. I am interested in fitting different distributions to the data but seem to be getting the same results from the model fit using survreg regardless of the assumed distribution. These two codes seem to provide the same results: aft.gaussian <- summary(survreg(Surv(y,y>0),type="left")~ group),dist="gaussian") aft.weibull <- summary(survreg(Surv(y,y>0),type="left")~ group),dist="weibull") Thanks, Carmen -- View this message in context: http://r.789695.n4.nabble.com/survreg-provides-same-results-with-different-distirbutions-for-left-censored-data-tp4169671p4169671.html Sent from the R help mailing list archive at Nabble.com. From emma.raven at jbaconsulting.co.uk Wed Dec 7 18:16:33 2011 From: emma.raven at jbaconsulting.co.uk (bevare) Date: Wed, 7 Dec 2011 09:16:33 -0800 (PST) Subject: [R] using sample Message-ID: <1323278193316-4169747.post@n4.nabble.com> Hi, Can anyone help sort out the problem with the following script - I am a R newbie and I am self taught. obs.all = c() for(i in 1:386){ if (n.sim[i]>0){ obs = (1:133429)[event.details[,2] == i] obs.all = c(obs.all, sample(obs[obs < n.sim[i]], size = n.sim[i], replace=T)) } Basically, in the sample bit, I only want to get obs.all if the value of obs is less than the value of n.sim[i]. I get the error message Error in sample(obs[obs < n.sim[i]], size = n.sim[i], replace = T) : invalid first argument length(n.sim) is 386 Thanks in advance for your suggestions Emma -- View this message in context: http://r.789695.n4.nabble.com/using-sample-tp4169747p4169747.html Sent from the R help mailing list archive at Nabble.com. From rick at rrsanbar.com Wed Dec 7 19:51:18 2011 From: rick at rrsanbar.com (Rick Reeves) Date: Wed, 07 Dec 2011 10:51:18 -0800 Subject: [R] args() function does not list function prototype for locally-produced/installed R package In-Reply-To: <4EDD4A64.8040906@gmail.com> References: <4EDD23E3.2080802@west.net> <4EDD4A64.8040906@gmail.com> Message-ID: <4EDFB5A6.2030006@rrsanbar.com> Duncan: Indeed, adding the function names to the NAMESPACE file (in the form: export(functionName)) solved the problem, and the args() function displays the function argument lists. Thanks, Rick Reeves On 12/5/2011 2:49 PM, Duncan Murdoch wrote: > On 11-12-05 3:04 PM, Rick Reeves wrote: > > Greetings: > > > > I have check the 'Building R Extensions' manual and can find no advice > > on this issue, > > so I am asking -- > > > > I have created an R package consisting entirely of R source code, and > > created an installer > > using the R CMD build / R CMD check commands. The package installs > > correctly, using > > R CMD install, and the .Rd files for each function (one function per .R > > / .Rd file) are visible > > using the '?function' command. However, the 'args(function)' command > > does not list the > > function prototype; instead generating the error: > > > > Error in args(function) : object "function" not found. > > > > Question: If it is possible, what changes do I make to my package and > > install process to get > > args() to display the function prototype(s) for the functions in my > > local package? > > Is the function visible (e.g., if you type the name of the function, > does it print)? I would guess not: I think you have a NAMESPACE > file, and you haven't listed this function in it. > > If you don't have a NAMESPACE file, or you do have one and you list > this function, then I think you need to be more forthcoming with > accurate information. When I type args(function), I don't get the > error you get, since "function" is a reserved word: > > > args(function) > Error: unexpected ')' in "args(function)" > > Duncan Murdoch > > Duncan Murdoch > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Wed Dec 7 20:15:42 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 13:15:42 -0600 Subject: [R] nice time series viewer? Message-ID: Hi all, I am looking for a nice time series grapher/viewer in R ... with the feature of scrolling, zooming, etc. Hopefully it could be of the quality at the report-generation-and-sending-to-boss level... Could anybody please give me some recommendations/pointers? Thanks a lot! From michael.weylandt at gmail.com Wed Dec 7 20:17:29 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Wed, 7 Dec 2011 14:17:29 -0500 Subject: [R] Object xxx not found In-Reply-To: <4EDF72EC020000930000BD35@gwise.up.ac.za> References: <4EDF72EC020000930000BD35@gwise.up.ac.za> Message-ID: <183AB3B3-BB4C-4683-AF26-4027B2A12E65@gmail.com> You never create a "sector" object inR so it can't be found. Perhaps you meant hist(SouthAfrica$exports) Michael On Dec 7, 2011, at 7:06 AM, "John Visagie" wrote: > Dear All, > > I am having a very basic error, but somehow do not know how to resolve it. I've read a dataset in .csv into R with two columns - sector, export. When trying to plot the data it says "sector not found" This is the formula. > > SouthAfrica<-read.csv(c,header=T) >> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") > > Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") : > object 'sector' not found > > Could somebody please assist? > > Kind regards, > > John > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Wed Dec 7 20:21:17 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 20:21:17 +0100 Subject: [R] Object xxx not found In-Reply-To: <4EDF72EC020000930000BD35@gwise.up.ac.za> References: <4EDF72EC020000930000BD35@gwise.up.ac.za> Message-ID: <4EDFBCAD.7080604@statistik.tu-dortmund.de> On 07.12.2011 13:06, John Visagie wrote: > Dear All, > > I am having a very basic error, but somehow do not know how to resolve it. I've read a dataset in .csv into R with two columns - sector, export. When trying to plot the data it says "sector not found" This is the formula. > > SouthAfrica<-read.csv(c,header=T) >> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") Err, you either want SouthAfrica$sector or SouthAfrica$exports. Uwe Ligges > Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") : > object 'sector' not found > > Could somebody please assist? > > Kind regards, > > John > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From fuertejn at vcu.edu Wed Dec 7 20:15:05 2011 From: fuertejn at vcu.edu (Jeffrey Fuerte) Date: Wed, 7 Dec 2011 14:15:05 -0500 Subject: [R] Convert a string to a variable name Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Wed Dec 7 20:25:00 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 20:25:00 +0100 Subject: [R] Hist and extra space In-Reply-To: <1323268251333-4169121.post@n4.nabble.com> References: <1323268251333-4169121.post@n4.nabble.com> Message-ID: <4EDFBD8C.2080008@statistik.tu-dortmund.de> On 07.12.2011 15:30, Filoche wrote: > Hi everyone. > > I have an histogram like this one: > > http://imageshack.us/photo/my-images/442/dfsdfsdj.jpg/ > > I would like to remove the extra space under the histogram so it "touch" the > x axis. Is it possible? Here's my code. See ?par and its argument yaxs. Uwe Ligges > hist(X, freq = F, col = 'gray', axes = FALSE) > abline(v = cyano_euk_min, col = 'red', lty = 3, lw = 2) > abline(v = cyano_euk_max, col = 'red', lty = 3, lw = 2) > axis(1, tck = -0.02) > axis(2, tck = -0.02) > box(bty = 'l') > > Regards, > Phil > > -- > View this message in context: http://r.789695.n4.nabble.com/Hist-and-extra-space-tp4169121p4169121.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From peter.langfelder at gmail.com Wed Dec 7 20:26:25 2011 From: peter.langfelder at gmail.com (Peter Langfelder) Date: Wed, 7 Dec 2011 11:26:25 -0800 Subject: [R] reading partial data set In-Reply-To: <1323269529129-4169210.post@n4.nabble.com> References: <1323269529129-4169210.post@n4.nabble.com> Message-ID: On Wed, Dec 7, 2011 at 6:52 AM, bcdc wrote: > Hi all, > > I'm trying to read a data set into R, but the file is messy, so I have to do > it partially. The whole data is in a .txt file, and the values are separated > by a space. So far ok. The problem is that in this file, not all the lines > have the same number of elements, and the reading stops. And I loose the > reading of the previous lines. > > ex. of data set: > 11 ? 12 ? 13 > 21 ? 22 ? 23 > 31 ? 32 ? 33 ? 34 > 41 ? 42 ? 43 ? 44 > 51 ? 52 ? 53 > 61 ? 62 ? 63 ? 64 > 71 72 73 74 75 > 81 ? 82 > (...) > > If I use the following: > >> aux <- read.table(file="data.txt", sep=" ", header=F, >> colClasses="numeric") > > it stops the reading with the error message: > >> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, >> : > ? line 3 did not have 3 elements > ? Calls: read.table -> scan > > and I loose the reading of the previous reading. And since I'm running my > data in a cluster (it's actually a big data set) the error halts my > execution. > > What I tried at first was to do > >> aux1 <- read.table(file="data.txt", sep=" ", header=F, >> colClasses="numeric", nrow=2) >> aux2 <- read.table(file="data.txt", sep=" ", header=F, >> colClasses="numeric", skip=2, nrow=2) >> aux3 <- read.table(file="data.txt", sep=" ", header=F, >> colClasses="numeric", skip=4, nrow=1) >> (...) > > This procedure works. However, I have about 5000 lines to read, and I don't > know precisely which ones are messy. So what I have to do, to keep the above > procedure is: > > 1. try to read data set > 2. check error message to find out which line has different size > 3. read data set for the block of same sized lines (aux1) > 4. read data set skipping the lines read in aux1; > ? check error message to find out which line has different size > 5. read data set for second block of same sized lines (aux2) > 6. read data set skipping the lines read in aux1 and aux2; > ? check error message to find out which line has different size > (and so on) > > So, if I had only a hundred lines, this would be OK, but I have a few > thousands, and It'll take me forever to finish reading if I need to read > block by block and check manually where is the problem. > > My question is: is there anyway I can read my data with some "if's" or > "while's" to control the read.table? What I'd like to do is something like: > > 1. read data set while all lines has the same length > 2. if a line has different length from the previous ones, store what was > read in a variable and abort reading > 3. start reading data set from the line where it stopped, and read it while > all lines has the same length > 4. if a line has different length from the previous ones, store what was > read in a variable and abort reading > 5. start reading data set from the line where it stopped, and read it while > all lines has the same length > 6. if a line has different length from the previous ones, store what was > read in a variable and abort reading > (and so on until the whole data set was finally read) > > This would make the program run by itself, and solve my problem. It's OK if > it returns a couple of variables, I can just bind them and assemble my data > set as I need, since I know how it should look like in the end. > > Thanks in advance for suggestions! > Beatriz > I think you make it too complicated. Look at the help file for read.table, particularly for argument fill (whose default AFAICS is FALSE). If you set it to TRUE, the function will automatically fill missing entries with NAs. After reading the file you can decide what to do with lines that have some missing values. HTH, Peter > -- > View this message in context: http://r.789695.n4.nabble.com/reading-partial-data-set-tp4169210p4169210.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Wed Dec 7 20:27:38 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 14:27:38 -0500 Subject: [R] Object xxx not found In-Reply-To: <4EDFD867020000930000BDC0@gwise.up.ac.za> References: <4EDFD867020000930000BDC0@gwise.up.ac.za> Message-ID: " I'm not creating a sector' Exactly, but your code (sector$exports) tells R to "find a variable called sector and then look inside of it for something called exports". It never bothers with the second part because it can't execute the first because it can't find anything called sector (as the error message says) Also, please cc the list on all replies for archival purposes. Michael On Wed, Dec 7, 2011 at 2:19 PM, John Visagie wrote: > I'm not creating a sector - it is one of my variable headings. > > ---------------- > This message and attachments are subject to a disclaimer. > Please refer to www.it.up.ac.za/documentation/governance/disclaimer/ for full details. > > >>>> "R. Michael Weylandt " 2011/12/07 09:17:29 PM >>> > > You never create a "sector" object inR so it can't be found. Perhaps you meant > > hist(SouthAfrica$exports) > > Michael > > On Dec 7, 2011, at 7:06 AM, "John Visagie" wrote: > >> Dear All, >> >> I am having a very basic error, but somehow do not know how to resolve it. ?I've read a dataset in .csv into R with two columns - sector, export. ?When trying to plot the data it says "sector not found" ?This is the formula. >> >> SouthAfrica<-read.csv(c,header=T) >>> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") >> >> Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") : >> ?object 'sector' not found >> >> Could somebody please assist? >> >> Kind regards, >> >> John >> >> ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > From michael.weylandt at gmail.com Wed Dec 7 20:31:38 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 14:31:38 -0500 Subject: [R] nice time series viewer? In-Reply-To: References: Message-ID: plot.xts() chartSeries() if you are using financial data? It's going to depend on your (unstated) form of time series, but generally R isn't set up for interactive graphics. (chartSeries being the only time-series specific exception I know; you can also do Rgl and Rggobi stuff with a little bit of work) Also, please don't cross post to two lists. Michael On Wed, Dec 7, 2011 at 2:15 PM, Michael wrote: > Hi all, > > I am looking for a nice time series grapher/viewer in R ... with the > feature of scrolling, zooming, etc. > > Hopefully it could be of the quality at the > report-generation-and-sending-to-boss level... > > Could anybody please give me some recommendations/pointers? > > Thanks a lot! > > ______________________________________________ > R-help at 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 code. From sarah.goslee at gmail.com Wed Dec 7 20:33:37 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Wed, 7 Dec 2011 14:33:37 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: On Wed, Dec 7, 2011 at 1:50 PM, Michael wrote: > Thanks a lot! > > Typically the console output will be something like this: > > Analysis of Variance Table > > Response: as.double(my.delta) > ? ? ? ? ? ? Df Sum Sq Mean Sq F value Pr(>F) > my.factor ? ?1 ? ? ?0 ? 0.005 ? 2e-04 ?0.988 > Residuals ?1484 ?32630 ?21.988 > > I am looking for a report-generator to make this look nicer and tabularize it... > > It doesn't matter if the outputs are in HTML, PDF, etc. > > As long as it looks fantastic, that's what we are looking for ... and > also the convenience is important... we dont' want to create Latex > document with manual insertaion of tables and plots... These need > automation... thx a lot! That's what sweave is *for* - automation and reproducible research. It takes care of the heavy lifting of generating and inserting tables and figures. You will almost certainly need some tweaking to match your own definition of "looks fantastic" though. Sarah >> On 07.12.2011 19:19, Sarah Goslee wrote: >>> Sweave. >>> >>> Or ODFWeave, if Sweave/LaTeX are too much overhead. >>> >>> But really, it depends on what kind of report output you need to >>> deliver. Printed? HTML? PDF? >>> >>> Sarah >>> >>> On Wed, Dec 7, 2011 at 1:14 PM, Michael ?wrote: >>>> Hi all, >>>> >>>> I am looking for recommendations/pointers about best report generator you >>>> think that are currently available? >>>> >>>> i.e. the package that can help turn console output into nice-looking neat >>>> report to send to bosses? >>>> >>>> thanks a lot! >>>> . >>> -- Sarah Goslee http://www.functionaldiversity.org From sarah.goslee at gmail.com Wed Dec 7 20:37:17 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Wed, 7 Dec 2011 14:37:17 -0500 Subject: [R] Object xxx not found In-Reply-To: <4EDF72EC020000930000BD35@gwise.up.ac.za> References: <4EDF72EC020000930000BD35@gwise.up.ac.za> Message-ID: You should probably read some of the intro to R documents, as this is a critical component of using R. On Wed, Dec 7, 2011 at 7:06 AM, John Visagie wrote: > Dear All, > > I am having a very basic error, but somehow do not know how to resolve it. ?I've read a dataset in .csv into R with two columns - sector, export. ?When trying to plot the data it says "sector not found" ?This is the formula. > > ?SouthAfrica<-read.csv(c,header=T) Your data frame is named SouthAfrica and it has two columns, sector and export. They can be referred to as SouthAfrica$sector and SouthAfrica$export >> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") You've just told R that you want to create a histogram of the column exports from the data frame named sector, which doesn't exist. hist(SouthAfrica$exports) seems more likely to succeed. > > Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") : > ?object 'sector' not found > > Could somebody please assist? > > Kind regards, > > John > -- Sarah Goslee http://www.functionaldiversity.org From gleynes+r at gmail.com Wed Dec 7 20:38:26 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Wed, 7 Dec 2011 13:38:26 -0600 Subject: [R] select integer intervals from a integer space In-Reply-To: References: <7AE956BD-CF1F-4A92-ADB7-943C60693FE9@comcast.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ligges at statistik.tu-dortmund.de Wed Dec 7 21:02:09 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 21:02:09 +0100 Subject: [R] Raster:matrix rows as x dimension In-Reply-To: <1323270793682-4169292.post@n4.nabble.com> References: <1323270793682-4169292.post@n4.nabble.com> Message-ID: <4EDFC641.5020509@statistik.tu-dortmund.de> On 07.12.2011 16:13, senplanet wrote: > Hello, > > I am new in R. I have problem to plot raster plot. > My data file consists 24 columns and approximately 18000 rows. > I would like to create some kind of hovmuller plot. > so I did: > r<- raster("test", package="raster") > but it automatically uses columns for x-dimension and rows for y-dimension. > Is there way to use rows as X and columns as Y? Are you looking for ?t Uwe Ligges > > -- > View this message in context: http://r.789695.n4.nabble.com/Raster-matrix-rows-as-x-dimension-tp4169292p4169292.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Wed Dec 7 21:05:49 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 21:05:49 +0100 Subject: [R] axis line width in boxplots In-Reply-To: References: Message-ID: <4EDFC71D.7020102@statistik.tu-dortmund.de> On 07.12.2011 17:51, GINGINS Simon wrote: > Dear R-helpers, > > I've produced boxplots for a publication but I have a visual problem that I don't mamage to fix. For visual reasons, I reduced the line width with "lwd=0.5". It works nicely for all the lines (frame of the plot, boxes, notches and medians) exept for the axis line. Thus the two axes appear twice the width of the frame. How can I control only the width of the axis line? Or, other option, how can I get rid of the axis line without getting rid of the tickmarks (as below the axis, there is the line from the frame, I don't really need the axis line)? > > Thank you for all the help you guys provide, it is extremely useful! par(lwd=0.5) boxplot(1:10, lwd=0.5) Uwe Ligges > > Regards > > > Simon Gingins > PhD student > > University of Neuch?tel > Institute of Biology > Department of Behavioural Ecology > Rue Emile-Argand 11 > 2000 Neuch?tel > Switzerland > > +41 32 718 31 09 > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Wed Dec 7 21:06:28 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 21:06:28 +0100 Subject: [R] Convert a string to a variable name In-Reply-To: References: Message-ID: <4EDFC744.2080102@statistik.tu-dortmund.de> On 07.12.2011 20:15, Jeffrey Fuerte wrote: > Hello, > > I am trying to ask the user for which column their data is in, and then use > this information in a function. So far I have: > > data<- read.csv(file.choose(), header=TRUE) > col<- (winDialogString("Which column contains your data?","")) > > and I want to be able to reference such as: > > meas<- data$col meas <- data[[col]] Uwe Ligges > > and use this meas in the function. > > However, I can't seem to get this to work because the input is read into a > string, and I can't figure out how to convert this string to the vector > name that I want. > > Any help is appreciated. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From murdoch.duncan at gmail.com Wed Dec 7 21:07:19 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Wed, 07 Dec 2011 15:07:19 -0500 Subject: [R] running texi2dvi without running bibtex In-Reply-To: References: <4EDF82B6.3040106@gmail.com> Message-ID: <4EDFC777.80606@gmail.com> On 07/12/2011 12:24 PM, Aidan Corcoran wrote: > Hi Duncan, > > thanks for your help. Unfortunately > > texi2dvi("onepager", pdf = TRUE, texi2dvi = "pdflatex") > > seems to run into the same issue. I searched the documentation as you > suggested (http://docs.miktex.org/2.9/manual/pdftex.html) and also > checked pdflatex --help, but can't find a command line option to > prevent the bibtex call. I think there should be one, since it's an > option in texniccenter, but I guess this is now a latex not an r > question (although I'm not sure exactly where I would put the command > line option in the texi2dvi call above). If I can't find a way to do > it then I'll take the batch approach as you suggested. I suspect it's a different problem: pdflatex shouldn't run bibtex. But who knows what MikTeX might choose to do... Duncan Murdoch > Thanks again! > > Aidan > > > > I know texniccenter has an option to not run bibtex when calling > pdflatex, but this is a tick box so I can?t find out what the command > line option is from there. > > On Wed, Dec 7, 2011 at 3:13 PM, Duncan Murdoch wrote: > > On 07/12/2011 6:47 AM, Aidan Corcoran wrote: > >> > >> Dear all, > >> > >> I was hoping someone may know a way of running texi2dvi while ignoring > >> bibtex errors, or any other work around (such as not running bibtex at > >> all, if possible). > >> > >> The context is that I have an R program that does some calculations > >> and writes a table into various folders, one per country for several > >> countries. I have a latex file that takes the table as an input, and > >> this latex file is copied into each folder. I would like to use R to > >> compile the latex files, to avoid having to open and compile them > >> individually. The files are simple one page files with no citations, > >> so need no biblio. > >> > >> If I switch to one of the folders containing a table and a latex file and > >> run > >> texi2dvi("onepager", pdf = TRUE, clean = FALSE, quiet = FALSE, > >> texi2dvi = getOption("texi2dvi"), > >> texinputs = NULL, index = TRUE) > >> I get > >> running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" > >> --pdf "onepager" -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/tex/latex" > >> -I "C:/PROGRA~1/R/R-213~1.0/share/texmf/bibtex/bst"' had status 1 > >> and no pdf produced. > >> > >> I think the problem is that the absence of a biblio causes an error. > >> The files compile in Texniccenter (with a warning on "no \citation > >> commands" etc). Does anyone know of a trick to avoid this problem? > >> > >> Thanks very much for any help! > > > > > > You might want to check the MikTeX documentation to see if there's an option > > to do that, but I couldn't spot one listed in "texi2dvi --help". So I'd > > suggest that you don't use the texi2dvi executable, just run pdflatex via > > > > texi2dvi("onepager", texi2dvi="pdflatex", ...) > > > > (or by setting the texi2dvi option) with the ... being appropriate other > > commands. If that doesn't work, then write a batch or cmd file to do > > exactly what you want, and use system() to run it. > > > > Duncan Murdoch From murdoch.duncan at gmail.com Wed Dec 7 21:12:03 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Wed, 7 Dec 2011 15:12:03 -0500 Subject: [R] nice report generator? In-Reply-To: References: Message-ID: <4EDFC893.7070308@gmail.com> On 07/12/2011 1:14 PM, Michael wrote: > Hi all, > > I am looking for recommendations/pointers about best report generator you > think that are currently available? > > i.e. the package that can help turn console output into nice-looking neat > report to send to bosses? You might find the latex() command in Hmisc or the equivalent in the xtable package does what you want. For simple reports in a single table you don't need Sweave; for more complex ones it would make your life easier. My tables package (now on CRAN) might simplify the production of the table. It is set up to work with Hmisc currently. Duncan Murdoch From jianfeng.mao at gmail.com Wed Dec 7 21:15:57 2011 From: jianfeng.mao at gmail.com (Mao Jianfeng) Date: Wed, 7 Dec 2011 21:15:57 +0100 Subject: [R] select integer intervals from a integer space In-Reply-To: References: <7AE956BD-CF1F-4A92-ADB7-943C60693FE9@comcast.net> Message-ID: Dear Gene, Thanks a lot for your kindness. > isp <- data.frame(begin=c(1,5,6,15,31,51,102), end=c(7,9,13,21,49,52,109)) > isp > ints = apply(isp, 1, function(x)seq(x[1],x[2])) > ints > ints = do.call(c, ints) > ints > ## option to fix if the regions are overlapping > ## and you don't want overlapping regions resampled > ints = unique(ints) > ## sample from ints > sample(ints, 5) > sample(ints, 5, replace=TRUE) I learned much from your code, such as the function do.call(). Could you please give me more helps on finding ways to sample consecutive integer interval? And you may reply me through here (http://stackoverflow.com/questions/8413990/selecting-integer-intervals-with-specific-intra-inter-length-from-random-integer/8421698#8421698). This question have attracted several responses, but still now no answer came out. I am still struggling with it. Best wishes, Jian-Feng, From NutterB at ccf.org Wed Dec 7 21:18:56 2011 From: NutterB at ccf.org (Nutter, Benjamin) Date: Wed, 7 Dec 2011 15:18:56 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: <07773E68C32A644CA47651463E79E5C204A82A1C@CCHSCLEXMB68.cc.ad.cchs.net> With any sort of reproducible report, you'll have to 'manually place' all of the tables and figures at least once. If done well, however, you'll only have to ever do it once. I'm not an Sweave expert (yet, regrettably), but using lazyWeave, you could generate a customized ANOVA table using the code below. If you're familiar with Sweave, I'd recommend using it. library(lazyWeave) #*** Function to produce the latex code for an ANOVA table anova.table <- function(aov.object, caption="", ...){ out <- data.frame(Source = rownames(anova(aov.object)), SS = anova(aov.object)[, 2], D.F. = anova(aov.object)[, 1], stringsAsFactors=FALSE) out$MS <- out$SS / out$D.F. out$F <- NA out$F[-nrow(out)] <- out$MS[-nrow(out)] / out$MS[nrow(out)] out$p <- 1 - pf(out$F, out$D.F., out$D.F.[nrow(out)]) out <- rbind(out, data.frame(Source = "Total", SS=sum(out$SS), D.F.=sum(out$D.F.), MS=NA, F=NA, p=NA)) out$SS <- round(out$SS, 3) out$MS <- round(out$MS, 3) out$F <- round(out$F, 3) rownames(out) <- NULL out[is.na(out)] <- "" paste(lazy.table(colnames(out), rborder=c(0, 0, 1), open=TRUE, close=FALSE, caption=caption), lazy.table(out, rborder=2, open=FALSE, close=TRUE), sep="\n") } #*** #*** Analysis of Variance m1 <- aov(mpg ~ cyl, data=mtcars) #*** #*** Write the result to a file lazy.write( lazy.file.start(), anova.table(m1, caption="An example ANOVA table from the dataset \\tt mtcars\\rm."), lazy.file.end(), OutFile="TestFile.tex") lazy.build("TestFile.tex") ? Benjamin Nutter |??Biostatistician ? |??Quantitative Health Sciences ? Cleveland Clinic? | ?9500 Euclid Ave.? | ?Cleveland, OH 44195? |?(216) 445-1365 -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Sarah Goslee Sent: Wednesday, December 07, 2011 2:34 PM Cc: r-help; Janko Thyson Subject: Re: [R] nice report generator? On Wed, Dec 7, 2011 at 1:50 PM, Michael wrote: > Thanks a lot! > > Typically the console output will be something like this: > > Analysis of Variance Table > > Response: as.double(my.delta) > ? ? ? ? ? ? Df Sum Sq Mean Sq F value Pr(>F) my.factor ? ?1 ? ? ?0 ? > 0.005 ? 2e-04 ?0.988 Residuals ?1484 ?32630 ?21.988 > > I am looking for a report-generator to make this look nicer and tabularize it... > > It doesn't matter if the outputs are in HTML, PDF, etc. > > As long as it looks fantastic, that's what we are looking for ... and > also the convenience is important... we dont' want to create Latex > document with manual insertaion of tables and plots... These need > automation... thx a lot! That's what sweave is *for* - automation and reproducible research. It takes care of the heavy lifting of generating and inserting tables and figures. You will almost certainly need some tweaking to match your own definition of "looks fantastic" though. Sarah >> On 07.12.2011 19:19, Sarah Goslee wrote: >>> Sweave. >>> >>> Or ODFWeave, if Sweave/LaTeX are too much overhead. >>> >>> But really, it depends on what kind of report output you need to >>> deliver. Printed? HTML? PDF? >>> >>> Sarah >>> >>> On Wed, Dec 7, 2011 at 1:14 PM, Michael ?wrote: >>>> Hi all, >>>> >>>> I am looking for recommendations/pointers about best report >>>> generator you think that are currently available? >>>> >>>> i.e. the package that can help turn console output into >>>> nice-looking neat report to send to bosses? >>>> >>>> thanks a lot! >>>> . >>> -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help at 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 code. =================================== Please consider the environment before printing this e-mail Cleveland Clinic is ranked one of the top hospitals in America by U.S.News & World Report (2010). Visit us online at http://www.clevelandclinic.org for a complete listing of our services, staff and locations. Confidentiality Note: This message is intended for use\...{{dropped:13}} From ligges at statistik.tu-dortmund.de Wed Dec 7 21:20:51 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Wed, 07 Dec 2011 21:20:51 +0100 Subject: [R] How to scale arrows to approximately fill a plot region? In-Reply-To: <4EDFA7F4.1050104@yorku.ca> References: <4EDFA7F4.1050104@yorku.ca> Message-ID: <4EDFCAA3.2080400@statistik.tu-dortmund.de> On 07.12.2011 18:52, Michael Friendly wrote: > In a variety of graphic applications, I plot some data, together with > arrows representing variables > or linear transformations of variables as vectors in the same space, as > in a biplot. > > In my applications, the scale of the arrows is arbitrary -- all that > matters is relative length. > I'd like to blow them up or shrink them to fit the available space in > the plot. > The origin is typically at some mean for (x,y), but that is not > necessarily so. > There must be some general, perhaps approximate solution for this problem, > but I can't see it. > > Below is a simple test case. I found the approximate solution, scale <- > 14 by trial and error. > [I'm ignoring aspect ratio, because that determines the bbox I calculate > from the plot.] > > > set.seed(123135251) > x <- 2 + 5* rnorm(50) > y <- 5 + 2* rnorm(50) > plot(x,y) > > # get bounding box of plot region, in data coordinates > bbox <- matrix(par("usr"), 2, 2, dimnames=list(c("min", "max"),c("x", > "y"))) > # center vectors here > origin <- colMeans(bbox) > points(origin[1], origin[2], pch=16, cex=2) > > # vectors to be displayed in this space > vectors <- cbind( runif(5), (runif(5)-.5)) > > # draw arrows, given origin and length in xy > Arrows <- function(xy, lenxy, length=.1, angle=10, ...) { > arrows(xy[1], xy[2], xy[1]+lenxy[,1], xy[2]+lenxy[,2], length=length, > angle=angle, ...) > } > > ## How to determine scale so that vectors ~ fill the bounding box??? > scale <- 14 > Arrows(origin, scale*vectors) > > Michael, you know it. Go and grab a coffee, this is school maths: If you have a starting point and a direction as well as the plotting region, you can simply calculate a (positive ?) scale so that an arrow crosses the border. Now do this for all arrows and all borders and take the minimal positive value. Should be few lines of code only. Therefore: scale <- c(sapply(bbox[,"x"] - origin["x"], function(i) i/vectors[,1]), sapply(bbox[,"y"] - origin["y"], function(i) i/vectors[,2])) scale <- min(scale[scale > 0]) Best wishes, Uwe From comtech.usa at gmail.com Wed Dec 7 21:21:30 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 14:21:30 -0600 Subject: [R] nice report generator? In-Reply-To: <4EDFC893.7070308@gmail.com> References: <4EDFC893.7070308@gmail.com> Message-ID: Thanks a lot Duncan! I did some home-work and found out that in terms of table looks, it's neater to generate Excel 2010 style colorful tables, not the Latex style plain/math-geek tables... Therefore, a report generator would hopefully generate Excel 2010 style tables, plus R plots, etc. Any thoughts? Thanks a lot! On 12/7/11, Duncan Murdoch wrote: > On 07/12/2011 1:14 PM, Michael wrote: >> Hi all, >> >> I am looking for recommendations/pointers about best report generator you >> think that are currently available? >> >> i.e. the package that can help turn console output into nice-looking neat >> report to send to bosses? > > You might find the latex() command in Hmisc or the equivalent in the > xtable package does what you want. For simple reports in a single table > you don't need Sweave; for more complex ones it would make your life easier. > > My tables package (now on CRAN) might simplify the production of the > table. It is set up to work with Hmisc currently. > > Duncan Murdoch > From proebuck at mdanderson.org Wed Dec 7 21:27:24 2011 From: proebuck at mdanderson.org (Roebuck,Paul L) Date: Wed, 7 Dec 2011 14:27:24 -0600 Subject: [R] How to de-source and re-source a file? In-Reply-To: Message-ID: So create a checkpoint... -----------------------------myfile.R--------------------------------- checkpoint.file <- "checkpoint_appname.RData" if (!file.exists(checkpoint.file) { ## Do compute intensive processing... { my.seed <- 1234 ans <- long.comp( my.seed) } objects2save <- c("ans", "my.seed") save(list=objects2save, file=checkpoint.file) } else { load(checkpoint.file) } browser() ... ----------------------------------------------------------------------- On 12/6/11 12:44 PM, "Michael" wrote: > the problem with restarting R is that I then have to re-execute the program > until the point where I wanted to debug, which is a very long-waiting > time... > > On Tue, Dec 6, 2011 at 12:17 PM, Duncan Murdoch > wrote: > >> On 06/12/2011 1:10 PM, Michael wrote: >> >>> i.e. how to make sure the function that was loaded into workspace/memory >>> is >>> the version that I edited latest... not some stale version... >>> >>> This might solve some of my breakpoint and browser/debug problem, even the >>> RStudio problem that I've met.... >>> >> >> You can use rm() to remove a function. >> >> You can also quit and restart R, making sure that it *does not* load an >> existing workspace (by deleting the .Rdata file if it exists, and never >> answering "yes" to the question to save it.) This gives you a nice clean >> slate. >> >> Duncan Murdoch >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From jtor14 at gmail.com Wed Dec 7 21:31:36 2011 From: jtor14 at gmail.com (Justin Haynes) Date: Wed, 7 Dec 2011 12:31:36 -0800 Subject: [R] using sample In-Reply-To: <1323278193316-4169747.post@n4.nabble.com> References: <1323278193316-4169747.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Wed Dec 7 21:37:23 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 15:37:23 -0500 Subject: [R] Select a set of rows based on a condition In-Reply-To: <1323256998142-4168594.post@n4.nabble.com> References: <1323256998142-4168594.post@n4.nabble.com> Message-ID: If you know the index letters are unique. df <- data.frame(indx = LETTERS[1:7], levels = sample(7)) ind1 <- which(df$indx == "A") ind2 <- which(df$indx == "B") df[ind1:ind2, ] Michael On Wed, Dec 7, 2011 at 6:23 AM, RaoulD wrote: > Hi, > > I need help with selecting a set of rows from a column in a dataset, that > matches a string criteria - start and end. The dataset is : > > ? > ? List|Index ? ? ? ? ? 10 > ? ABC ? ? ? ? ? ? ? ? ?20 > ? DEF ? ? ? ? ? ? ? ? ? 10 > ? GHI ? ? ? ? ? ? ? ? ? 50 > ? JKL ? ? ? ? ? ? ? ? ? ?40 > ? MNO ? ? ? ? ? ? ? ? ?20 > ? PQR ? ? ? ? ? ? ? ? ? 10 > > Start="DEF" > End = "MNO" > > Ideally, I would like to select the data from DEF to MNO into a new data > set. My logic is > 1) get the row number for DEF > 2) get the row number for MNO > 3) subset the rows from DEF to MNO > > Can someone please help me with the R code for this as am a little rusty. > Please let me know if you have questions. > > Thanks in advance! > Raoul > > -- > View this message in context: http://r.789695.n4.nabble.com/Select-a-set-of-rows-based-on-a-condition-tp4168594p4168594.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From aikidasgupta at gmail.com Wed Dec 7 21:39:12 2011 From: aikidasgupta at gmail.com (Abhijit Dasgupta) Date: Wed, 7 Dec 2011 15:39:12 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFC893.7070308@gmail.com> Message-ID: <4EDFCEF0.8070503@araastat.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ieortools at gmail.com Wed Dec 7 21:40:04 2011 From: ieortools at gmail.com (Larry D'Agostino) Date: Wed, 7 Dec 2011 14:40:04 -0600 Subject: [R] confusion about factor scores from princomp function In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Wed Dec 7 21:42:02 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 15:42:02 -0500 Subject: [R] Output table from for loop In-Reply-To: <1323272362813-4169386.post@n4.nabble.com> References: <1323272362813-4169386.post@n4.nabble.com> Message-ID: I'd do it like this: nums = 10:30 OutList <- vector("list", length(nums)) # The key is that you need to return in a list: your loop iterations were all operating on the same object OutMat and accessing different elements thereof instead of creating new objects for(cn in seq_along(nums)) OutList[[i]] <- Counts[Counts$var < nums[cn], ] Michael On Wed, Dec 7, 2011 at 10:39 AM, bmoran wrote: > Hi, this might be basic but can't get it to work and it is hampering my R > usage: > > #the loop is checking variance of rows, and cutting out rows with > var>numVec[i] > #I define outMat as object names I want to output to (does this make sense? > how else > #can I define sequential numbered output?) > #numVec is numbers I use in the loop > > head(Counts) > > ? ? ? ? ? ? AN1 ?AN2 ? AN3 ? AN4 ? var > GENE1 ? ? ?99 ? ? 0 ? ? 6 ? ? ?0 ? ? ?2360 > GENE2 ? ?183 ? 136 ? 137 ? ?160 ? 496 > GENE3 ? ?301 ? 199 ? 233 ? ?187 ? 1856 > > outMat<-paste("NewCounts", 1:5, sep="_") #names of > numVec<-c(100,200,500,1000,1500) > cutGenes<-function(x) { > ? ? ? ?for (i in 1:5) { > ? ? ? ? ? ? ? ?keep<- Counts$var ? ? ? ? ? ? ? ?keep<-Counts[keep=="TRUE",] #apply logical vector to count data (table) > ? ? ? ? ? ? ? ?outMat[i]<-keep > } > } > > #this all works fine if I define 'outMat[i]' as 'outMat' but then I can't > use the loop! The loop seems to make #outMat[i] take the i element of 'keep' > and only stores this. > > #Help much appreciated, sorry if it is VERY basic, just a head scratcher for > me. > > Thanks, > > Bruce. > > -- > View this message in context: http://r.789695.n4.nabble.com/Output-table-from-for-loop-tp4169386p4169386.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From Greg.Snow at imail.org Wed Dec 7 21:43:30 2011 From: Greg.Snow at imail.org (Greg Snow) Date: Wed, 7 Dec 2011 13:43:30 -0700 Subject: [R] axis thickness in plot() In-Reply-To: <1323189326756-4165430.post@n4.nabble.com> References: <1323189326756-4165430.post@n4.nabble.com> Message-ID: Often when someone wants lines (axes) in R plots to be thicker or thinner it is because they are producing the plots at the wrong size, then changing the size of the plot in some other program (like MSword) and the lines do not look as nice. If this is your case, then the better approach is to produce the original graph at the appropriate size, then you don't need to worry about the effects of resizing. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111 > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of AlexC > Sent: Tuesday, December 06, 2011 9:35 AM > To: r-help at r-project.org > Subject: [R] axis thickness in plot() > > Hello, > > I am trying to increase the thickness of the axis in plot() without > reverting to the use of paint programs > > i see posts on that topic for the xyplot function but want to see if i > can > do it with plot() because i've already setup my graph script using that > > i thought i could use axis() function and specify lwd="thickness" or > lwd.axis= but that does not work like it does for lwd.ticks > > If anyone has an idea, sincerely > > heres the script > > windows(width=7,height=7) > plot(data$Winter,data$NbFirstBroods,ylab="number of breeding > pairs",xlab="winter > harshness",cex=1.5,cex.lab=1.5,cex.axis=1.5,font.axis=2,axes=FALSE) > points(data$Winter,data$NbFirstBroods,cex=1.5,col="black",pch=19) > abline(lm(data$NbFirstBroods~data$Winter),col="red",lwd=4) > > i tried axis(1, lwd.axis = 3,lwd.ticks=3) for example > > also when adding the y axis axis(2...) x and y axes are disconnected > > Thank you for your kind help in advance, > > Alexandre > > -- > View this message in context: http://r.789695.n4.nabble.com/axis- > thickness-in-plot-tp4165430p4165430.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Wed Dec 7 21:45:41 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 15:45:41 -0500 Subject: [R] Problem with xlsx package In-Reply-To: <1323274980580-4169522.post@n4.nabble.com> References: <4D544261.7080807@openanalytics.eu> <1323274980580-4169522.post@n4.nabble.com> Message-ID: And did you try giving more memory to the JVM as suggested above? I'd imagine that if you have the same problem and the same error, you would expect to get the same advice directed at the same solution. Otherwise, I'd personally plug the XLConnect package over xlsx. I switched to it recently and have been very pleased with increased speed and flexibility. Michael On Wed, Dec 7, 2011 at 11:23 AM, sakaton wrote: > I have the same problem and same Java error. > > > > > > > >> sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 ?LC_CTYPE=English_United > States.1252 ? ?LC_MONETARY=English_United States.1252 > [4] LC_NUMERIC=C ? ? ? ? ? ? ? ? ? ? ? ? ? LC_TIME=English_United > States.1252 > > attached base packages: > [1] grDevices datasets ?splines ? graphics ?stats ? ? tcltk ? ? utils > methods ? base > > other attached packages: > ?[1] xlsx_0.3.0 ? ? ? ? ? ?xlsxjars_0.3.0 ? ? ? ?rJava_0.9-1 > plyr_1.6 ? ? ? ? ? ? ?stringr_0.5 ? ? ? ? ? sqldf_0.4-2 > ?[7] chron_2.3-42 ? ? ? ? ?gsubfn_0.5-7 ? ? ? ? ?proto_0.3-9.2 > RSQLite.extfuns_0.0.1 RSQLite_0.9-4 ? ? ? ? DBI_0.2-5 > [13] RODBC_1.3-3 ? ? ? ? ? svSocket_0.9-51 ? ? ? TinnR_1.0.3 > R2HTML_2.2 ? ? ? ? ? ?Hmisc_3.8-3 ? ? ? ? ? survival_2.36-9 > > loaded via a namespace (and not attached): > [1] cluster_1.14.0 ?grid_2.13.1 ? ? lattice_0.19-30 svMisc_0.9-63 > tools_2.13.1 > > -- > View this message in context: http://r.789695.n4.nabble.com/Problem-with-xlsx-package-tp3298470p4169522.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From landronimirc at gmail.com Wed Dec 7 22:21:54 2011 From: landronimirc at gmail.com (Liviu Andronic) Date: Wed, 7 Dec 2011 22:21:54 +0100 Subject: [R] nice report generator? In-Reply-To: <4EDFB3E7.1070302@googlemail.com> References: <4EDFB3E7.1070302@googlemail.com> Message-ID: On Wed, Dec 7, 2011 at 7:43 PM, Janko Thyson wrote: > I like knitr. IMHO Yihui really came up with a killer package there: > http://yihui.github.com/knitr/ > If we're talking about nice, I'll chip in for LyX. It has support for Sweave, and will soon support knitr. This eliminates (most of) the burden of learning LaTeX. Liviu From jholtman at gmail.com Wed Dec 7 22:30:31 2011 From: jholtman at gmail.com (jim holtman) Date: Wed, 7 Dec 2011 16:30:31 -0500 Subject: [R] Problem with xlsx package In-Reply-To: References: <4D544261.7080807@openanalytics.eu> <1323274980580-4169522.post@n4.nabble.com> Message-ID: I have had better luck with the XLConnect package. On Wed, Dec 7, 2011 at 3:45 PM, R. Michael Weylandt wrote: > And did you try giving more memory to the JVM as suggested above? I'd > imagine that if you have the same problem and the same error, you > would expect to get the same advice directed at the same solution. > > Otherwise, I'd personally plug the XLConnect package over xlsx. I > switched to it recently and have been very pleased with increased > speed and flexibility. > > Michael > > On Wed, Dec 7, 2011 at 11:23 AM, sakaton wrote: >> I have the same problem and same Java error. >> >> >> >> >> >> >> >>> sessionInfo() >> R version 2.13.1 (2011-07-08) >> Platform: x86_64-pc-mingw32/x64 (64-bit) >> >> locale: >> [1] LC_COLLATE=English_United States.1252 ?LC_CTYPE=English_United >> States.1252 ? ?LC_MONETARY=English_United States.1252 >> [4] LC_NUMERIC=C ? ? ? ? ? ? ? ? ? ? ? ? ? LC_TIME=English_United >> States.1252 >> >> attached base packages: >> [1] grDevices datasets ?splines ? graphics ?stats ? ? tcltk ? ? utils >> methods ? base >> >> other attached packages: >> ?[1] xlsx_0.3.0 ? ? ? ? ? ?xlsxjars_0.3.0 ? ? ? ?rJava_0.9-1 >> plyr_1.6 ? ? ? ? ? ? ?stringr_0.5 ? ? ? ? ? sqldf_0.4-2 >> ?[7] chron_2.3-42 ? ? ? ? ?gsubfn_0.5-7 ? ? ? ? ?proto_0.3-9.2 >> RSQLite.extfuns_0.0.1 RSQLite_0.9-4 ? ? ? ? DBI_0.2-5 >> [13] RODBC_1.3-3 ? ? ? ? ? svSocket_0.9-51 ? ? ? TinnR_1.0.3 >> R2HTML_2.2 ? ? ? ? ? ?Hmisc_3.8-3 ? ? ? ? ? survival_2.36-9 >> >> loaded via a namespace (and not attached): >> [1] cluster_1.14.0 ?grid_2.13.1 ? ? lattice_0.19-30 svMisc_0.9-63 >> tools_2.13.1 >> >> -- >> View this message in context: http://r.789695.n4.nabble.com/Problem-with-xlsx-package-tp3298470p4169522.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From michael.weylandt at gmail.com Wed Dec 7 22:37:59 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 16:37:59 -0500 Subject: [R] read.table performance In-Reply-To: References: Message-ID: R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file verbatim: system.time(read.table("test2.txt")) Michael 2011/12/7 Gene Leynes : > Peter, > > You're quite right; it's nearly impossible to make progress without a > working example. > > I created an ** extremely simplified ** example for distribution. ?The real > data has numeric, character, and boolean classes. > > The file still takes 25.08 seconds to read, despite it's small size. > > I neglected to mention that I'm using R 2.13.0 and I"m on a windows 7 > machine (not that it should particularly matter with this type of data / > functions). > > ## The code: > options(stringsAsFactors=FALSE) > system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) > str(dat, 0) > > > Thanks again! > > > > On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard wrote: > >> >> On Dec 6, 2011, at 22:33 , Gene Leynes wrote: >> >> > Mark, >> > >> > Thanks for your suggestions. >> > >> > That's a good idea about the NULL columns; I didn't think of that. >> > Surprisingly, it didn't have any effect on the time. >> >> Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you >> fix both? >> >> >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >> >> rep(NULL,3696)). >> >> As a general matter, if you want people to dig into this, they need some >> paraphrase of the file to play with. Would it be possible to set up a small >> R program that generates a data file which displays the issue? Everything I >> try seems to take about a second to read in. >> >> -pd >> >> > >> > This problem was just a curiosity, I already did the import using Excel >> and >> > VBA. ?I was just going to illustrate the power and simplicity of R, but >> it >> > ironically it's been much slower and harder in R... >> > The VBA was painful and messy, and took me over an hour to write; but at >> > least it worked quickly and reliably. >> > The R code was clean and only took me about 5 minutes to write, but the >> run >> > time was prohibitively slow! >> > >> > I profiled the code, but that offers little insight to me. >> > >> > Profile results with 10 line file: >> > >> >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >> > $by.self >> > ? ? ? ? ? ? self.time self.pct total.time total.pct >> > scan ? ? ? ? ? ? 12.24 ? ?53.50 ? ? ?12.24 ? ? 53.50 >> > read.table ? ? ? 10.58 ? ?46.24 ? ? ?22.88 ? ?100.00 >> > type.convert ? ? ?0.04 ? ? 0.17 ? ? ? 0.04 ? ? ?0.17 >> > make.names ? ? ? ?0.02 ? ? 0.09 ? ? ? 0.02 ? ? ?0.09 >> > >> > $by.total >> > ? ? ? ? ? ? total.time total.pct self.time self.pct >> > read.table ? ? ? ?22.88 ? ?100.00 ? ? 10.58 ? ?46.24 >> > scan ? ? ? ? ? ? ?12.24 ? ? 53.50 ? ? 12.24 ? ?53.50 >> > type.convert ? ? ? 0.04 ? ? ?0.17 ? ? ?0.04 ? ? 0.17 >> > make.names ? ? ? ? 0.02 ? ? ?0.09 ? ? ?0.02 ? ? 0.09 >> > >> > $sample.interval >> > [1] 0.02 >> > >> > $sampling.time >> > [1] 22.88 >> > >> > >> > Profile results with 250 line file: >> > >> >> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >> > $by.self >> > ? ? ? ? ? ? self.time self.pct total.time total.pct >> > scan ? ? ? ? ? ? 23.88 ? ?68.15 ? ? ?23.88 ? ? 68.15 >> > read.table ? ? ? 10.78 ? ?30.76 ? ? ?35.04 ? ?100.00 >> > type.convert ? ? ?0.30 ? ? 0.86 ? ? ? 0.32 ? ? ?0.91 >> > character ? ? ? ? 0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 >> > file ? ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 >> > lapply ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 >> > unlist ? ? ? ? ? ?0.02 ? ? 0.06 ? ? ? 0.02 ? ? ?0.06 >> > >> > $by.total >> > ? ? ? ? ? ? ? total.time total.pct self.time self.pct >> > read.table ? ? ? ? ?35.04 ? ?100.00 ? ? 10.78 ? ?30.76 >> > scan ? ? ? ? ? ? ? ?23.88 ? ? 68.15 ? ? 23.88 ? ?68.15 >> > type.convert ? ? ? ? 0.32 ? ? ?0.91 ? ? ?0.30 ? ? 0.86 >> > sapply ? ? ? ? ? ? ? 0.04 ? ? ?0.11 ? ? ?0.00 ? ? 0.00 >> > character ? ? ? ? ? ?0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 >> > file ? ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 >> > lapply ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 >> > unlist ? ? ? ? ? ? ? 0.02 ? ? ?0.06 ? ? ?0.02 ? ? 0.06 >> > simplify2array ? ? ? 0.02 ? ? ?0.06 ? ? ?0.00 ? ? 0.00 >> > >> > $sample.interval >> > [1] 0.02 >> > >> > $sampling.time >> > [1] 35.04 >> > >> > >> > >> > >> > On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: >> > >> >> hi gene: maybe someone else will reply with some ?subtleties that I'm >> not >> >> aware of. one other thing >> >> that might help: if you know which columns you want , you can set the >> >> others to NULL through >> >> colClasses and this should speed things up also. For example, say you >> knew >> >> you only wanted the >> >> first four columns and they were character. then you could do, >> >> >> >> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >> >> rep(NULL,3696)). >> >> >> >> hopefully someone else will say something that does the trick. it seems >> >> odd to me as far as the >> >> difference in timings ? good luck. >> >> >> >> >> >> >> >> >> >> >> >> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: >> >> >> >>> Mark, >> >>> >> >>> Thank you for the reply >> >>> >> >>> I neglected to mention that I had already set >> >>> options(stringsAsFactors=FALSE) >> >>> >> >>> I agree, skipping the factor determination can help performance. >> >>> >> >>> The main reason that I wanted to use read.table is because it will >> >>> correctly determine the column classes for me. ?I don't really want to >> >>> specify 3700 column classes! ?(I'm not sure what they are anyway). >> >>> >> >>> >> >>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds >> wrote: >> >>> >> >>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. >> >>>> If you know what your variables are ahead of time and what you want >> them to >> >>>> be, this allows you to be specific ?by specifying, character or >> numeric, >> >>>> etc ?and often it makes things faster. others will have more to say. >> >>>> >> >>>> also, if most of your variables are characters, R will try to turn >> >>>> convert them into factors by default. If you use as.is = TRUE it >> won't >> >>>> do this and that might speed things up also. >> >>>> >> >>>> >> >>>> Rejoinder: ?above tidbits are ?just from experience. I don't know if >> >>>> it's in stone or a hard and fast rule. >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes >> wrote: >> >>>> >> >>>>> ** Disclaimer: I'm looking for general suggestions ** >> >>>>> I'm sorry, but can't send out the file I'm using, so there is no >> >>>>> reproducible example. >> >>>>> >> >>>>> I'm using read.table and it's taking over 30 seconds to read a tiny >> >>>>> file. >> >>>>> The strange thing is that it takes roughly the same amount of time if >> >>>>> the >> >>>>> file is 100 times larger. >> >>>>> >> >>>>> After re-reviewing the data Import / Export manual I think the best >> >>>>> approach would be to use Python, or perhaps the readLines function, >> but >> >>>>> I >> >>>>> was hoping to understand why the simple read.table approach wasn't >> >>>>> working >> >>>>> as expected. >> >>>>> >> >>>>> Some relevant facts: >> >>>>> >> >>>>> ?1. There are about 3700 columns. ?Maybe this is the problem? ?Still >> >>>>> the >> >>>>> >> >>>>> ?file size is not very large. >> >>>>> ?2. The file encoding is ANSI, but I'm not specifying that in the >> >>>>> >> >>>>> ?function. ?Setting fileEncoding="ANSI" produces an "unsupported >> >>>>> conversion" >> >>>>> ?error >> >>>>> ?3. readLines imports the lines quickly >> >>>>> ?4. scan imports the file quickly also >> >>>>> >> >>>>> >> >>>>> Obviously, scan and readLines would require more coding to identify >> >>>>> columns, etc. >> >>>>> >> >>>>> my code: >> >>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', >> >>>>> header=TRUE)) >> >>>>> >> >>>>> It's taking 33.4 seconds and the file size is only 315 kb! >> >>>>> >> >>>>> Thanks >> >>>>> >> >>>>> Gene >> >>>>> >> >>>>> ? ? ? [[alternative HTML version deleted]] >> >>>>> >> >>>>> ______________________________________________ >> >>>>> R-help at 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 code. >> >>>>> >> >>>> >> >>>> >> >>> >> >> >> > >> > ? ? ? [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at 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 code. >> >> -- >> Peter Dalgaard, Professor, >> Center for Statistics, Copenhagen Business School >> Solbjerg Plads 3, 2000 Frederiksberg, Denmark >> Phone: (+45)38153501 >> Email: pd.mes at cbs.dk ?Priv: PDalgd at gmail.com >> >> >> >> >> >> >> >> >> > > ______________________________________________ > R-help at 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 code. > From jhallman at frb.gov Wed Dec 7 22:51:20 2011 From: jhallman at frb.gov (Jeffrey J. Hallman) Date: Wed, 7 Dec 2011 16:51:20 -0500 Subject: [R] Plotting Time Series Data by Month References: <1323125906801-4162534.post@n4.nabble.com> Message-ID: If you can wait a day or two, the next version (1.18) of the 'tis' package that I will put on CRAN very soon has a function called "tierChart" that does what you want with a 'tis' series. -- Jeff From jhallman at frb.gov Wed Dec 7 22:54:13 2011 From: jhallman at frb.gov (Jeffrey J. Hallman) Date: Wed, 7 Dec 2011 16:54:13 -0500 Subject: [R] Time series merge? References: <001e01ccac53$e2e91190$a8bb34b0$@charter.net> Message-ID: Or see "mergeSeries" in package 'tis'. -- Jeff From pdalgd at gmail.com Wed Dec 7 23:11:10 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Wed, 7 Dec 2011 23:11:10 +0100 Subject: [R] read.table performance In-Reply-To: References: Message-ID: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote: > R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file > verbatim: system.time(read.table("test2.txt")) About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8. Gene, are you by any chance storing the file in a heavily virus-scanned system directory? -pd > Michael > > 2011/12/7 Gene Leynes : >> Peter, >> >> You're quite right; it's nearly impossible to make progress without a >> working example. >> >> I created an ** extremely simplified ** example for distribution. The real >> data has numeric, character, and boolean classes. >> >> The file still takes 25.08 seconds to read, despite it's small size. >> >> I neglected to mention that I'm using R 2.13.0 and I"m on a windows 7 >> machine (not that it should particularly matter with this type of data / >> functions). >> >> ## The code: >> options(stringsAsFactors=FALSE) >> system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) >> str(dat, 0) >> >> >> Thanks again! >> >> >> >> On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard wrote: >> >>> >>> On Dec 6, 2011, at 22:33 , Gene Leynes wrote: >>> >>>> Mark, >>>> >>>> Thanks for your suggestions. >>>> >>>> That's a good idea about the NULL columns; I didn't think of that. >>>> Surprisingly, it didn't have any effect on the time. >>> >>> Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you >>> fix both? >>> >>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >>>>> rep(NULL,3696)). >>> >>> As a general matter, if you want people to dig into this, they need some >>> paraphrase of the file to play with. Would it be possible to set up a small >>> R program that generates a data file which displays the issue? Everything I >>> try seems to take about a second to read in. >>> >>> -pd >>> >>>> >>>> This problem was just a curiosity, I already did the import using Excel >>> and >>>> VBA. I was just going to illustrate the power and simplicity of R, but >>> it >>>> ironically it's been much slower and harder in R... >>>> The VBA was painful and messy, and took me over an hour to write; but at >>>> least it worked quickly and reliably. >>>> The R code was clean and only took me about 5 minutes to write, but the >>> run >>>> time was prohibitively slow! >>>> >>>> I profiled the code, but that offers little insight to me. >>>> >>>> Profile results with 10 line file: >>>> >>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>> $by.self >>>> self.time self.pct total.time total.pct >>>> scan 12.24 53.50 12.24 53.50 >>>> read.table 10.58 46.24 22.88 100.00 >>>> type.convert 0.04 0.17 0.04 0.17 >>>> make.names 0.02 0.09 0.02 0.09 >>>> >>>> $by.total >>>> total.time total.pct self.time self.pct >>>> read.table 22.88 100.00 10.58 46.24 >>>> scan 12.24 53.50 12.24 53.50 >>>> type.convert 0.04 0.17 0.04 0.17 >>>> make.names 0.02 0.09 0.02 0.09 >>>> >>>> $sample.interval >>>> [1] 0.02 >>>> >>>> $sampling.time >>>> [1] 22.88 >>>> >>>> >>>> Profile results with 250 line file: >>>> >>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>> $by.self >>>> self.time self.pct total.time total.pct >>>> scan 23.88 68.15 23.88 68.15 >>>> read.table 10.78 30.76 35.04 100.00 >>>> type.convert 0.30 0.86 0.32 0.91 >>>> character 0.02 0.06 0.02 0.06 >>>> file 0.02 0.06 0.02 0.06 >>>> lapply 0.02 0.06 0.02 0.06 >>>> unlist 0.02 0.06 0.02 0.06 >>>> >>>> $by.total >>>> total.time total.pct self.time self.pct >>>> read.table 35.04 100.00 10.78 30.76 >>>> scan 23.88 68.15 23.88 68.15 >>>> type.convert 0.32 0.91 0.30 0.86 >>>> sapply 0.04 0.11 0.00 0.00 >>>> character 0.02 0.06 0.02 0.06 >>>> file 0.02 0.06 0.02 0.06 >>>> lapply 0.02 0.06 0.02 0.06 >>>> unlist 0.02 0.06 0.02 0.06 >>>> simplify2array 0.02 0.06 0.00 0.00 >>>> >>>> $sample.interval >>>> [1] 0.02 >>>> >>>> $sampling.time >>>> [1] 35.04 >>>> >>>> >>>> >>>> >>>> On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: >>>> >>>>> hi gene: maybe someone else will reply with some subtleties that I'm >>> not >>>>> aware of. one other thing >>>>> that might help: if you know which columns you want , you can set the >>>>> others to NULL through >>>>> colClasses and this should speed things up also. For example, say you >>> knew >>>>> you only wanted the >>>>> first four columns and they were character. then you could do, >>>>> >>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >>>>> rep(NULL,3696)). >>>>> >>>>> hopefully someone else will say something that does the trick. it seems >>>>> odd to me as far as the >>>>> difference in timings ? good luck. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: >>>>> >>>>>> Mark, >>>>>> >>>>>> Thank you for the reply >>>>>> >>>>>> I neglected to mention that I had already set >>>>>> options(stringsAsFactors=FALSE) >>>>>> >>>>>> I agree, skipping the factor determination can help performance. >>>>>> >>>>>> The main reason that I wanted to use read.table is because it will >>>>>> correctly determine the column classes for me. I don't really want to >>>>>> specify 3700 column classes! (I'm not sure what they are anyway). >>>>>> >>>>>> >>>>>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds >>> wrote: >>>>>> >>>>>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. >>>>>>> If you know what your variables are ahead of time and what you want >>> them to >>>>>>> be, this allows you to be specific by specifying, character or >>> numeric, >>>>>>> etc and often it makes things faster. others will have more to say. >>>>>>> >>>>>>> also, if most of your variables are characters, R will try to turn >>>>>>> convert them into factors by default. If you use as.is = TRUE it >>> won't >>>>>>> do this and that might speed things up also. >>>>>>> >>>>>>> >>>>>>> Rejoinder: above tidbits are just from experience. I don't know if >>>>>>> it's in stone or a hard and fast rule. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes >>> wrote: >>>>>>> >>>>>>>> ** Disclaimer: I'm looking for general suggestions ** >>>>>>>> I'm sorry, but can't send out the file I'm using, so there is no >>>>>>>> reproducible example. >>>>>>>> >>>>>>>> I'm using read.table and it's taking over 30 seconds to read a tiny >>>>>>>> file. >>>>>>>> The strange thing is that it takes roughly the same amount of time if >>>>>>>> the >>>>>>>> file is 100 times larger. >>>>>>>> >>>>>>>> After re-reviewing the data Import / Export manual I think the best >>>>>>>> approach would be to use Python, or perhaps the readLines function, >>> but >>>>>>>> I >>>>>>>> was hoping to understand why the simple read.table approach wasn't >>>>>>>> working >>>>>>>> as expected. >>>>>>>> >>>>>>>> Some relevant facts: >>>>>>>> >>>>>>>> 1. There are about 3700 columns. Maybe this is the problem? Still >>>>>>>> the >>>>>>>> >>>>>>>> file size is not very large. >>>>>>>> 2. The file encoding is ANSI, but I'm not specifying that in the >>>>>>>> >>>>>>>> function. Setting fileEncoding="ANSI" produces an "unsupported >>>>>>>> conversion" >>>>>>>> error >>>>>>>> 3. readLines imports the lines quickly >>>>>>>> 4. scan imports the file quickly also >>>>>>>> >>>>>>>> >>>>>>>> Obviously, scan and readLines would require more coding to identify >>>>>>>> columns, etc. >>>>>>>> >>>>>>>> my code: >>>>>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', >>>>>>>> header=TRUE)) >>>>>>>> >>>>>>>> It's taking 33.4 seconds and the file size is only 315 kb! >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> Gene >>>>>>>> >>>>>>>> [[alternative HTML version deleted]] >>>>>>>> >>>>>>>> ______________________________________________ >>>>>>>> R-help at 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 code. >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>> >>> -- >>> Peter Dalgaard, Professor, >>> Center for Statistics, Copenhagen Business School >>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark >>> Phone: (+45)38153501 >>> Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com >>> >>> >>> >>> >>> >>> >>> >>> >>> >> >> ______________________________________________ >> R-help at 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 code. >> -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From bravegag at gmail.com Wed Dec 7 23:13:30 2011 From: bravegag at gmail.com (Giovanni Azua) Date: Wed, 7 Dec 2011 23:13:30 +0100 Subject: [R] data frame and cumulative sum Message-ID: <3244EC72-E145-4C5E-A395-B206233D4658@gmail.com> Hello, I have a data frame that looks like this (containing interarrival times): > str(df) 'data.frame': 18233 obs. of 1 variable: $ Interarrival: int 135 806 117 4 14 1 9 104 169 0 ... > head(df) Interarrival 1 135 2 806 3 117 4 4 5 14 6 1 > This corresponds to the time differences (in ms) of a poisson arrival process where Interarrival{i+1} = time_{i+1} - time_{i} I want to get the Time bin (in minutes) of every interarrival basically something like: 1) df$Time <- sum(of all df$Interarrival up to "this rownum") # cumulative sum 2) df$Time <- floor(df$Time / 60000) + 1 then I should get the first minute of Interarrival having 1 and so forth. The problem is I have no idea how to accomplish 1) in R. Can anyone advice? Thanks in advance, Best regards, Giovanni From comtech.usa at gmail.com Wed Dec 7 23:14:01 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 16:14:01 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... Message-ID: Hi all, I am stuck at ploting multiple graphs on one page. I don't why it doesn't work. All the 6 plots are either exactly the same, or they simply don't plot at all. I made sure that in each iteration the "datasub" and "factorsub" are different ... Could you please help me? Thanks a lot! I did my homework and followed the following advice: http://stackoverflow.com/questions/1249548/side-by-side-plots-with-ggplot2-in-r my.multiplot <- function(..., plotlist=NULL, cols) { require(grid) # Make a list from the ... arguments and plotlist plots <- c(list(...), plotlist) numPlots = length(plots) # Make the panel plotCols = cols # Number of columns of plots plotRows = ceiling(numPlots/plotCols) # Number of rows needed, calculated from # of cols # Set up the page grid.newpage() pushViewport(viewport(layout = grid.layout(plotRows, plotCols))) vplayout <- function(x, y) viewport(layout.pos.row = x, layout.pos.col = y) # Make each plot, in the correct location for (i in 1:numPlots) { curRow = ceiling(i/plotCols) curCol = (i-1) %% plotCols + 1 print(plots[[i]], vp = vplayout(curRow, curCol )) } } My code is as below: ---------------------------- myplotlist=vector('list', 6) nCount=0; for (j in myyears) { print(j) nCount=nCount+1 #... # prepare datasub and factorsub for different j... #... tmp<-data.frame(as.double(datasub),as.numeric(factorsub)) tt=qplot(factor(as.numeric(factorsub)),as.double(datasub),data=tmp,geom = "boxplot",ylab='Chg',xlab='Hours', main=j) myplotlist[nCount]=tt } my.multiplot(plotlist=myplotlist,cols=3) From comtech.usa at gmail.com Wed Dec 7 23:17:29 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 16:17:29 -0600 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: Thanks Liviu. I actually knew Latex... so it's not a problem for me. But honestly Latex tables cannot compete with Excel 2010 tables in looks... the latter are for business users and for managers... I am looking for a fast/convenient way to generate those tables... Thanks! On 12/7/11, Liviu Andronic wrote: > On Wed, Dec 7, 2011 at 7:43 PM, Janko Thyson > wrote: >> I like knitr. IMHO Yihui really came up with a killer package there: >> http://yihui.github.com/knitr/ >> > If we're talking about nice, I'll chip in for LyX. It has support for > Sweave, and will soon support knitr. This eliminates (most of) the > burden of learning LaTeX. > > Liviu > > ______________________________________________ > R-help at 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 code. > From michael.weylandt at gmail.com Wed Dec 7 23:20:45 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 17:20:45 -0500 Subject: [R] data frame and cumulative sum In-Reply-To: <3244EC72-E145-4C5E-A395-B206233D4658@gmail.com> References: <3244EC72-E145-4C5E-A395-B206233D4658@gmail.com> Message-ID: ??"cumulative sum" would almost certainly lead you to cumsum with only a modicum of effort Michael On Wed, Dec 7, 2011 at 5:13 PM, Giovanni Azua wrote: > Hello, > > I have a data frame that looks like this (containing interarrival times): > >> str(df) > 'data.frame': ? 18233 obs. of ?1 variable: > ?$ Interarrival: int ?135 806 117 4 14 1 9 104 169 0 ... >> head(df) > ?Interarrival > 1 ? ? ? ? ?135 > 2 ? ? ? ? ?806 > 3 ? ? ? ? ?117 > 4 ? ? ? ? ? ?4 > 5 ? ? ? ? ? 14 > 6 ? ? ? ? ? ?1 >> > > This corresponds to the time differences (in ms) of a poisson arrival process where Interarrival{i+1} = time_{i+1} - time_{i} > > I want to get the Time bin (in minutes) of every interarrival basically something like: > > 1) df$Time <- sum(of all df$Interarrival up to "this rownum") # cumulative sum > > 2) df$Time <- floor(df$Time / 60000) + 1 > > then I should get the first minute of Interarrival having 1 and so forth. The problem is I have no idea how to accomplish 1) in R. > > Can anyone advice? > > Thanks in advance, > Best regards, > Giovanni > ______________________________________________ > R-help at 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 code. From rmh at temple.edu Wed Dec 7 23:26:59 2011 From: rmh at temple.edu (Richard M. Heiberger) Date: Wed, 7 Dec 2011 17:26:59 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From xie at yihui.name Wed Dec 7 23:30:42 2011 From: xie at yihui.name (Yihui Xie) Date: Wed, 7 Dec 2011 16:30:42 -0600 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: Could you show us a few screenshots of what you believe are "good-looking Excel 2010 tables"? (e.g. via imgur.com) Sorry I do not have Excel 2010. I feel this post is more like a matter of style, so it is likely to be a personal matter of taste. Anyway, I'd like to see what is a beautiful table in your eyes. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Dec 7, 2011 at 4:17 PM, Michael wrote: > Thanks Liviu. > > I actually knew Latex... so it's not a problem for me. > > But honestly Latex tables cannot compete with Excel 2010 tables in > looks... the latter are for business users and for managers... > > I am looking for a fast/convenient way to generate those tables... Thanks! > > On 12/7/11, Liviu Andronic wrote: >> On Wed, Dec 7, 2011 at 7:43 PM, Janko Thyson >> wrote: >>> I like knitr. IMHO Yihui really came up with a killer package there: >>> http://yihui.github.com/knitr/ >>> >> If we're talking about nice, I'll chip in for LyX. It has support for >> Sweave, and will soon support knitr. This eliminates (most of) the >> burden of learning LaTeX. >> >> Liviu >> From comtech.usa at gmail.com Wed Dec 7 23:32:08 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 16:32:08 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: If I put a "windows()" in front of the qplot command in the above code and simply wanted to have each plot graphed on different pages... Six graph windows opened but none of them had any content... they are all blank... What's the problem? Thx On 12/7/11, Michael wrote: > Hi all, > > I am stuck at ploting multiple graphs on one page. I don't why it doesn't > work. > > All the 6 plots are either exactly the same, or they simply don't plot > at all. I made sure that in each iteration the "datasub" and > "factorsub" are different ... > > Could you please help me? > > Thanks a lot! > > I did my homework and followed the following advice: > > http://stackoverflow.com/questions/1249548/side-by-side-plots-with-ggplot2-in-r > > my.multiplot <- function(..., plotlist=NULL, cols) { > require(grid) > > # Make a list from the ... arguments and plotlist > plots <- c(list(...), plotlist) > > numPlots = length(plots) > > # Make the panel > plotCols = cols # Number of columns of plots > plotRows = ceiling(numPlots/plotCols) # Number of rows needed, > calculated from # of cols > > # Set up the page > grid.newpage() > pushViewport(viewport(layout = grid.layout(plotRows, plotCols))) > vplayout <- function(x, y) > viewport(layout.pos.row = x, layout.pos.col = y) > > # Make each plot, in the correct location > for (i in 1:numPlots) { > curRow = ceiling(i/plotCols) > curCol = (i-1) %% plotCols + 1 > print(plots[[i]], vp = vplayout(curRow, curCol )) > } > > } > > > My code is as below: > > ---------------------------- > > > myplotlist=vector('list', 6) > nCount=0; > > for (j in myyears) > { > print(j) > nCount=nCount+1 > > #... > # prepare datasub and factorsub for different j... > #... > tmp<-data.frame(as.double(datasub),as.numeric(factorsub)) > tt=qplot(factor(as.numeric(factorsub)),as.double(datasub),data=tmp,geom > = "boxplot",ylab='Chg',xlab='Hours', main=j) > > myplotlist[nCount]=tt > > } > > my.multiplot(plotlist=myplotlist,cols=3) > From comtech.usa at gmail.com Wed Dec 7 23:38:57 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 16:38:57 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: I found that if I run each "qplot" manually it would plot out something... but if I put it into the loop, it just doesn't work at all - sometimes it refused to plot anything... On 12/7/11, Michael wrote: > If I put a "windows()" in front of the qplot command in the above code > and simply wanted to have each plot graphed on different pages... > > > Six graph windows opened but none of them had any content... they are > all blank... > > What's the problem? > > Thx > > On 12/7/11, Michael wrote: >> Hi all, >> >> I am stuck at ploting multiple graphs on one page. I don't why it doesn't >> work. >> >> All the 6 plots are either exactly the same, or they simply don't plot >> at all. I made sure that in each iteration the "datasub" and >> "factorsub" are different ... >> >> Could you please help me? >> >> Thanks a lot! >> >> I did my homework and followed the following advice: >> >> http://stackoverflow.com/questions/1249548/side-by-side-plots-with-ggplot2-in-r >> >> my.multiplot <- function(..., plotlist=NULL, cols) { >> require(grid) >> >> # Make a list from the ... arguments and plotlist >> plots <- c(list(...), plotlist) >> >> numPlots = length(plots) >> >> # Make the panel >> plotCols = cols # Number of columns of plots >> plotRows = ceiling(numPlots/plotCols) # Number of rows needed, >> calculated from # of cols >> >> # Set up the page >> grid.newpage() >> pushViewport(viewport(layout = grid.layout(plotRows, plotCols))) >> vplayout <- function(x, y) >> viewport(layout.pos.row = x, layout.pos.col = y) >> >> # Make each plot, in the correct location >> for (i in 1:numPlots) { >> curRow = ceiling(i/plotCols) >> curCol = (i-1) %% plotCols + 1 >> print(plots[[i]], vp = vplayout(curRow, curCol )) >> } >> >> } >> >> >> My code is as below: >> >> ---------------------------- >> >> >> myplotlist=vector('list', 6) >> nCount=0; >> >> for (j in myyears) >> { >> print(j) >> nCount=nCount+1 >> >> #... >> # prepare datasub and factorsub for different j... >> #... >> tmp<-data.frame(as.double(datasub),as.numeric(factorsub)) >> tt=qplot(factor(as.numeric(factorsub)),as.double(datasub),data=tmp,geom >> = "boxplot",ylab='Chg',xlab='Hours', main=j) >> >> myplotlist[nCount]=tt >> >> } >> >> my.multiplot(plotlist=myplotlist,cols=3) >> > From gleynes+r at gmail.com Wed Dec 7 20:49:31 2011 From: gleynes+r at gmail.com (Gene Leynes) Date: Wed, 7 Dec 2011 13:49:31 -0600 Subject: [R] RSPython installation In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From John.Visagie at up.ac.za Wed Dec 7 20:31:01 2011 From: John.Visagie at up.ac.za (John Visagie) Date: Wed, 07 Dec 2011 21:31:01 +0200 Subject: [R] Object xxx not found Message-ID: <4EDFDB15020000930000BDC4@gwise.up.ac.za> Thank you, Michael. ---------------- This message and attachments are subject to a disclaimer. Please refer to www.it.up.ac.za/documentation/governance/disclaimer/ for full details. >>> "R. Michael Weylandt" 2011/12/07 09:27:38 PM >>> " I'm not creating a sector' Exactly, but your code (sector$exports) tells R to "find a variable called sector and then look inside of it for something called exports". It never bothers with the second part because it can't execute the first because it can't find anything called sector (as the error message says) Also, please cc the list on all replies for archival purposes. Michael On Wed, Dec 7, 2011 at 2:19 PM, John Visagie wrote: > I'm not creating a sector - it is one of my variable headings. > > ---------------- > This message and attachments are subject to a disclaimer. > Please refer to www.it.up.ac.za/documentation/governance/disclaimer/ for full details. > > >>>> "R. Michael Weylandt " 2011/12/07 09:17:29 PM >>> > > You never create a "sector" object inR so it can't be found. Perhaps you meant > > hist(SouthAfrica$exports) > > Michael > > On Dec 7, 2011, at 7:06 AM, "John Visagie" wrote: > >> Dear All, >> >> I am having a very basic error, but somehow do not know how to resolve it. I've read a dataset in .csv into R with two columns - sector, export. When trying to plot the data it says "sector not found" This is the formula. >> >> SouthAfrica<-read.csv(c,header=T) >>> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") >> >> Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") : >> object 'sector' not found >> >> Could somebody please assist? >> >> Kind regards, >> >> John >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > From smoochie3002 at gmail.com Wed Dec 7 21:02:43 2011 From: smoochie3002 at gmail.com (crazedruff) Date: Wed, 7 Dec 2011 12:02:43 -0800 (PST) Subject: [R] Plotting Time Series Data by Month In-Reply-To: <1323125906801-4162534.post@n4.nabble.com> References: <1323125906801-4162534.post@n4.nabble.com> Message-ID: <1323288163806-4170305.post@n4.nabble.com> Sorry about that, new to posting here! Your code was extremely helpful, and tweaking it a bit gave me the output I was looking for: plot( rep(1:12, 17), pox, col = rep(1:17, each = 12), xaxt = "n", ylab="Reported Cases",xlab = "Months", pch = 20, main="Monthly Trends of Chickenpox") axis(1, at = 1:12, labels = month.abb, padj = 0) legend(8, 28000,c("1993", "1994","1995","1996","1997","1998","1999","2000", "2001","2002","2003","2004","2005","2006","2007","2008","2009"), inset=.05, title="Years", c(1993:2009), pch=20, horiz=FALSE, cex=.7) Apparently there aren't enough colors for each year to have it's own individual color, but I think I can live with that. Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-Time-Series-Data-by-Month-tp4162534p4170305.html Sent from the R help mailing list archive at Nabble.com. From mark_difford at yahoo.co.uk Wed Dec 7 21:29:37 2011 From: mark_difford at yahoo.co.uk (Mark Difford) Date: Wed, 7 Dec 2011 12:29:37 -0800 (PST) Subject: [R] How to scale arrows to approximately fill a plot region? In-Reply-To: <4EDFCAA3.2080400@statistik.tu-dortmund.de> References: <4EDFA7F4.1050104@yorku.ca> <4EDFCAA3.2080400@statistik.tu-dortmund.de> Message-ID: <1323289777744-4170400.post@n4.nabble.com> On Dec 07, 2011 at 10:20pm Michael Friendly asked: > How to scale arrows to approximately fill a plot region? Michael, Following Uwe...If you want code that does it then look at what Daniel Chessel did in package ade4: ## > scatter.dudi function (x, xax = 1, yax = 2, clab.row = 0.75, clab.col = 1, permute = FALSE, posieig = "top", sub = NULL, ...) { if (!inherits(x, "dudi")) stop("Object of class 'dudi' expected") opar <- par(mar = par("mar")) on.exit(par(opar)) coolig <- x$li[, c(xax, yax)] coocol <- x$c1[, c(xax, yax)] if (permute) { coolig <- x$co[, c(xax, yax)] coocol <- x$l1[, c(xax, yax)] } s.label(coolig, clab = clab.row) born <- par("usr") k1 <- min(coocol[, 1])/born[1] k2 <- max(coocol[, 1])/born[2] k3 <- min(coocol[, 2])/born[3] k4 <- max(coocol[, 2])/born[4] k <- c(k1, k2, k3, k4) coocol <- 0.9 * coocol/max(k) s.arrow(coocol, clab = clab.col, add.p = TRUE, sub = sub, possub = "bottomright") add.scatter.eig(x$eig, x$nf, xax, yax, posi = posieig, ratio = 1/4) } Regards, Mark. ----- Mark Difford (Ph.D.) Research Associate Botany Department Nelson Mandela Metropolitan University Port Elizabeth, South Africa -- View this message in context: http://r.789695.n4.nabble.com/How-to-scale-arrows-to-approximately-fill-a-plot-region-tp4169871p4170400.html Sent from the R help mailing list archive at Nabble.com. From pierre-etienne.lessard.1 at ulaval.ca Wed Dec 7 21:37:42 2011 From: pierre-etienne.lessard.1 at ulaval.ca (PEL) Date: Wed, 7 Dec 2011 12:37:42 -0800 (PST) Subject: [R] Dividing rows when time is overlapping Message-ID: <1323290262544-4170428.post@n4.nabble.com> Hi all, I have dataframe that was created from the fusion of two dataframes. Both spanned over the same time intervall but contained different information. When I put them together, the info overlapped since there is no holes in the time interval of one of the dataframe. Here is an example where the rows "sp=A and B" are part of a first df and the rows "sp=C" come from a second. The first dataframe is continuous but the second consists of sporadic events. The final dataframe looks like this: start end sp 2010-06-01 17:00:00 2010-06-01 19:30:00 A 2010-06-01 19:30:01 2010-06-01 20:00:00 B 2010-06-01 19:45:00 2010-06-01 19:55:00 C 2010-06-01 20:00:01 2010-06-01 20:30:00 A 2010-06-01 20:05:00 2010-06-01 20:10:00 C 2010-06-01 20:12:00 2010-06-01 20:15:00 C 2010-06-01 20:30:01 2010-06-01 20:40:00 B 2010-06-01 20:35:00 2010-06-01 20:40:10 C 2010-06-01 20:40:01 2010-06-01 20:50:00 A I would like to prioritize "C" so when it overlaps the time interval of another "sp", the time interval of "A" or "B" is cut accordingly. As seen in the example, I sometimes have multiple events of "C" that overlap a single event of "A" or "B". The result would be this: start end sp 2010-06-01 17:00:00 2010-06-01 19:30:00 A 2010-06-01 19:30:01 2010-06-01 19:44:59 B 2010-06-01 19:45:00 2010-06-01 19:55:00 C 2010-06-01 19:55:01 2010-06-01 20:00:00 B 2010-06-01 20:00:01 2010-06-01 20:04:59 A 2010-06-01 20:05:00 2010-06-01 20:10:00 C 2010-06-01 20:10:01 2010-06-01 20:11:59 A 2010-06-01 20:12:00 2010-06-01 20:15:00 C 2010-06-01 20:15:01 2010-06-01 20:30:00 A 2010-06-01 20:30:01 2010-06-01 20:34:59 B 2010-06-01 20:35:00 2010-06-01 20:40:10 C 2010-06-01 20:40:11 2010-06-01 20:50:00 A My date/time columns are in POSIXct. Don't hesitate to ask if something is unclear. Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/Dividing-rows-when-time-is-overlapping-tp4170428p4170428.html Sent from the R help mailing list archive at Nabble.com. From pmassicotte at hotmail.com Wed Dec 7 21:45:21 2011 From: pmassicotte at hotmail.com (Filoche) Date: Wed, 7 Dec 2011 12:45:21 -0800 (PST) Subject: [R] Hist and extra space In-Reply-To: <4EDFBD8C.2080008@statistik.tu-dortmund.de> References: <1323268251333-4169121.post@n4.nabble.com> <4EDFBD8C.2080008@statistik.tu-dortmund.de> Message-ID: <1323290721207-4170452.post@n4.nabble.com> Thank you sire. It worked fine. I was using the parameter in the hist(...) function. I now use it with par and it works perfectly. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Hist-and-extra-space-tp4169121p4170452.html Sent from the R help mailing list archive at Nabble.com. From erin at the-ryans.com Wed Dec 7 22:51:05 2011 From: erin at the-ryans.com (Erin Ryan) Date: Wed, 7 Dec 2011 16:51:05 -0500 Subject: [R] MIXED MODEL WITH REPEATED MEASURES Message-ID: <003701ccb52a$5542d940$ffc88bc0$@com> I am trying to specify a mixed model for my research, but I can't quite get it to work. I've spent several weeks looking thru various online sources to no avail. I can't find an example of someone trying to do precisely what I'm trying to do. I'm hoping some smart member of this mailing list may be able to help. First off, full disclosure: (1) I'm an engineer by trade, so the problem may be related to my ignorance of statistics, and/or (2) I'm fairly new to R, so the problem may be related to my ignorance of R syntax. I have tried so many sources, my head is spinning, Here is the basic structure of my data (in longitudinal form): FixedVar1 FixedVar2 RandomVar1 RandomVar2 ... DepVar Subject1 1996 AF A 0.002 800 2.1 1997 AF A 0.002 760 2.1 1998 AF A 0.003 760 2.1 1999 AF A 0.005 760 2.1 2001 AF A NA 900 2.1 2002 AF A 0.004 880 2.1 2003 AF A 0.005 870 2.1 2004 AF A 0.006 870 2.1 2005 AF A 0.006 900 2.1 Subject2 2001 NA S 0.000 350 18.0 2002 NA S 0.000 350 18.0 2003 NA S 0.136 380 18.0 2005 NA S 0.146 390 18.0 2006 NA S 0.146 510 18.0 2007 NA S 0.161 510 18.0 2009 NA S 0.161 NA 18.0 2010 NA S 0.161 350 18.0 ... The rows below each subject are repeated measures (in years), with the specific pattern of repeated measurements unique to each subject. The data contains fixed effects and random effects, and there is clearly correlation in the random effects within each subject. The DepVar column represents the dependent variable which is a constant for each subject. All the data is empirical, but I wish to create a predictive model. Specifically, I wish to predict the value for DepVar for new subjects. So I understand enough about statistics to know that I must employ a mixed model. I further understand that I must specify a covariance matrix structure. Given the relatively high degree of correlation in consecutive years, an AR(1) structure seems like a good starting point. I have been trying to build the model in SPSS, but without success, so I've recently turned to R. My first attempt was as follows-- ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random = ~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr = corAR1()) I assume this can't be the right specification since it neglects the repeated measure aspect of the data, so I instead decided to employ the corCAR1 structure, i.e.-- ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random = ~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr = corCAR1(0.5, form = ~ Years | Subject)) Now perhaps neither correlation structure is the right one (probably a different discussion for another day), but the problem I'm experiencing seems to occur regardless of the structure I specify. In both cases, I get the following error-- Error in solve.default(estimates[dimE[1] - (p:1), dimE[2] - (p:1), drop = FALSE]) : system is computationally singular: reciprocal condition number = 5.42597e-022 Anybody know what is going wrong here? This error appears to be related to the fact that the DepVar is constant for each subject, because when I select a different dependent variable that is different for each repeated measure w/in the subject, I do not get this error. Sorry for the long post. Hope this makes sense. Erin From searl at vt.edu Wed Dec 7 23:01:37 2011 From: searl at vt.edu (Steve E.) Date: Wed, 7 Dec 2011 14:01:37 -0800 (PST) Subject: [R] help wrapping findInterval into a function In-Reply-To: <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> Message-ID: <1323295297948-4170688.post@n4.nabble.com> Thanks to everyone for continued assistance with this problem. I realize that I had not included enough information, hopefully I have done so here. I attached a dput output of a sample of the data titled 'WaterData' (and str output below). Below are dput outputs of the function I am trying to get working and the resulting array when I run it. Unfortunately, Michael, changing 'with' to 'within' did not solve the problem, as running the function in that case produced no discernible output or result. What I meant by the function now producing an array of values (though the result I am looking for) that are not attached to the data frame, is that they show up separately in a result window (in a similar format to what you get from dput() and are not at all associated with the data frame). Again, thanks so much! > dput(WQFunc) function (dataframe) { dataframe$CalcFlag <- with(dataframe, ifelse(variable == "CaD_ICP", (dataqualifier <- c("Y", "Q", "", "A")[findInterval(dataframe$value, c(-Inf, 0.027, 0.1, 100, Inf))]), "")) } > str(WaterData) 'data.frame': 126 obs. of 5 variables: $ Site : Factor w/ 6 levels "BV","CB","KP",..: 3 3 3 3 3 3 3 3 3 3 ... $ Time : Factor w/ 84 levels "0:00:00","0:00:52",..: 1 1 1 1 2 5 16 16 19 20 ... $ DateCorrectFmt: Factor w/ 9 levels "2010-08-17","2010-08-21",..: 4 8 1 3 8 5 5 8 8 8 ... $ variable : Factor w/ 3 levels "CaD_ICP","NaD_ICP",..: 1 1 1 1 1 1 1 1 1 1 ... $ value : num 0.044 0.1316 0.0101 0.0114 80.13 ... Below is the output I get if if I run the WQFunc as: flagged <- WQFunc(WaterData) > dput(Flagged) c("Q", "", "Y", "Y", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ) > Again, though, 'Flagged' is an array of those values in a output window but are not 'attached' to WaterData. -- View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4170688.html Sent from the R help mailing list archive at Nabble.com. From searl at vt.edu Wed Dec 7 23:03:14 2011 From: searl at vt.edu (Steve E.) Date: Wed, 7 Dec 2011 14:03:14 -0800 (PST) Subject: [R] help wrapping findInterval into a function In-Reply-To: <1323295297948-4170688.post@n4.nabble.com> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> <1323295297948-4170688.post@n4.nabble.com> Message-ID: <1323295394976-4170695.post@n4.nabble.com> forgot to attach the data set http://r.789695.n4.nabble.com/file/n4170695/WaterData.txt WaterData.txt -- View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4170695.html Sent from the R help mailing list archive at Nabble.com. From marie.com at gmail.com Wed Dec 7 23:24:00 2011 From: marie.com at gmail.com (Marie Duarte) Date: Thu, 8 Dec 2011 09:24:00 +1100 Subject: [R] Correlation of events over time Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ggrothendieck at gmail.com Wed Dec 7 23:43:59 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Wed, 7 Dec 2011 17:43:59 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: On Wed, Dec 7, 2011 at 5:26 PM, Richard M. Heiberger wrote: > Michael, > > that is a challenge. > > I accept it and suggest that it be a contest on the R-help list. > > Please post a pdf file showing some (more than one) tables that you think > look better in Excel than in LaTeX. > I,and probably some others, will send our versions of the tables. > > I think a new email thread with an appropriate catchy title would be the > way to do it. The problem is that its drop dead easy in Excel but its not readily accessible in R and latex (as opposed to the problem being raw capability). Simply exhibiting how to do it is not enough. What is needed is a function, accessible from CRAN, with a bunch of built in themes that are easy to apply: latex(DF, theme = "cherry orchard") -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From xie at yihui.name Wed Dec 7 23:47:26 2011 From: xie at yihui.name (Yihui Xie) Date: Wed, 7 Dec 2011 16:47:26 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: This is probably one of the most frequently asked questions. The answer is to print() the objects. See R FAQ 7.22. http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: > I found that if I run each "qplot" manually it would plot out something... > > but if I put it into the loop, > > it just doesn't work at all - sometimes it refused to plot anything... > From michael.weylandt at gmail.com Wed Dec 7 23:49:26 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 17:49:26 -0500 Subject: [R] Plotting Time Series Data by Month In-Reply-To: <1323288163806-4170305.post@n4.nabble.com> References: <1323125906801-4162534.post@n4.nabble.com> <1323288163806-4170305.post@n4.nabble.com> Message-ID: Glad to help! There are definitely enough colors, but they aren't all assigned numbers automatically: to see a list of built in ones, try colors() You can always use a character string to specify a color as well -- but I think the easiest thing to do might be to use one of the palette functions like rainbow() to make a whole set of colors equally spaced throughout the rainbow. For production/optimized colors, look into the RColorBrewer package -- there's a somewhat large body of research on the best way to choose colors and that package will help automate that process. Michael On Wed, Dec 7, 2011 at 3:02 PM, crazedruff wrote: > Sorry about that, new to posting here! Your code was extremely helpful, and > tweaking it a bit gave me the output I was looking for: > > plot( rep(1:12, 17), pox, col = rep(1:17, each = 12), xaxt = "n", > ylab="Reported Cases",xlab = > "Months", pch = 20, main="Monthly Trends of Chickenpox") > axis(1, at = 1:12, labels = month.abb, padj = 0) > legend(8, 28000,c("1993", "1994","1995","1996","1997","1998","1999","2000", > "2001","2002","2003","2004","2005","2006","2007","2008","2009"), inset=.05, > title="Years", > c(1993:2009), pch=20, horiz=FALSE, cex=.7) > > Apparently there aren't enough colors for each year to have it's own > individual color, but I think I can live with that. Thanks again! > > -- > View this message in context: http://r.789695.n4.nabble.com/Plotting-Time-Series-Data-by-Month-tp4162534p4170305.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From bravegag at gmail.com Wed Dec 7 23:53:44 2011 From: bravegag at gmail.com (Giovanni Azua) Date: Wed, 7 Dec 2011 23:53:44 +0100 Subject: [R] data frame and cumulative sum In-Reply-To: References: <3244EC72-E145-4C5E-A395-B206233D4658@gmail.com> Message-ID: Thank you Michael, indeed, my bad, I get so deep in trying to solve the problem that forget to try the most basic help first. Best regards, Giovanni On Dec 7, 2011, at 11:20 PM, R. Michael Weylandt wrote: > ??"cumulative sum" would almost certainly lead you to cumsum with only > a modicum of effort > > Michael > > On Wed, Dec 7, 2011 at 5:13 PM, Giovanni Azua wrote: >> Hello, >> >> I have a data frame that looks like this (containing interarrival times): >> >>> str(df) >> 'data.frame': 18233 obs. of 1 variable: >> $ Interarrival: int 135 806 117 4 14 1 9 104 169 0 ... >>> head(df) >> Interarrival >> 1 135 >> 2 806 >> 3 117 >> 4 4 >> 5 14 >> 6 1 >>> >> >> This corresponds to the time differences (in ms) of a poisson arrival process where Interarrival{i+1} = time_{i+1} - time_{i} >> >> I want to get the Time bin (in minutes) of every interarrival basically something like: >> >> 1) df$Time <- sum(of all df$Interarrival up to "this rownum") # cumulative sum >> >> 2) df$Time <- floor(df$Time / 60000) + 1 >> >> then I should get the first minute of Interarrival having 1 and so forth. The problem is I have no idea how to accomplish 1) in R. >> >> Can anyone advice? >> >> Thanks in advance, >> Best regards, >> Giovanni >> ______________________________________________ >> R-help at 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 code. From murdoch.duncan at gmail.com Wed Dec 7 23:58:55 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Wed, 7 Dec 2011 17:58:55 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> Message-ID: <4EDFEFAF.1090208@gmail.com> On 11-12-07 5:43 PM, Gabor Grothendieck wrote: > On Wed, Dec 7, 2011 at 5:26 PM, Richard M. Heiberger wrote: >> Michael, >> >> that is a challenge. >> >> I accept it and suggest that it be a contest on the R-help list. >> >> Please post a pdf file showing some (more than one) tables that you think >> look better in Excel than in LaTeX. >> I,and probably some others, will send our versions of the tables. >> >> I think a new email thread with an appropriate catchy title would be the >> way to do it. > > The problem is that its drop dead easy in Excel but its not readily > accessible in R and latex (as opposed to the problem being raw > capability). Simply exhibiting how to do it is not enough. What is > needed is a function, accessible from CRAN, with a bunch of built in > themes that are easy to apply: > > latex(DF, theme = "cherry orchard") > > I don't believe you. Show us some examples. Duncan Murdoch From ccquant at gmail.com Thu Dec 8 00:02:51 2011 From: ccquant at gmail.com (Ben quant) Date: Wed, 7 Dec 2011 16:02:51 -0700 Subject: [R] R on the cloud - Windows to Linux Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 8 00:04:04 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Wed, 7 Dec 2011 18:04:04 -0500 Subject: [R] help wrapping findInterval into a function In-Reply-To: <1323295297948-4170688.post@n4.nabble.com> References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> <1323295297948-4170688.post@n4.nabble.com> Message-ID: So I don't know what you are trying to do with your function (and I might have incidentally messed it up), but within certainly does add the desired column: WaterData <- structure(list(Site = structure(c(3L, 3L, 3L, 3L, 3L, 3L), .Label = c("BV", "CB", "KP", "LA", "MR", "PIE"), class = "factor"), Time = structure(c(1L, 1L, 1L, 1L, 2L, 5L), .Label = c("0:00:00", "0:00:52", "0:01:00", "0:06:00", "0:07:00", "0:11:00", "0:16:00", "0:21:00", "0:26:00", "0:36:00", "0:41:00", "0:51:00", "0:56:00", "1:01:00", "1:06:00", "1:07:00", "1:10:00", "1:11:00", "1:22:00", "1:37:00", "1:52:00", "10:22:00", "10:37:00", "10:52:00", "11:22:00", "15:55:00", "16:00:00", "17:25:00", "17:30:00", "18:00:00", "18:05:00", "18:20:00", "18:35:00", "18:50:00", "19:05:00", "19:20:00", "19:25:00", "19:35:00", "2:07:00", "2:14:00", "2:16:00", "2:21:00", "2:22:00", "2:26:00", "2:31:00", "2:36:00", "2:37:00", "2:38:00", "2:44:00", "2:46:00", "2:52:00", "20:20:00", "20:32:00", "20:35:00", "21:05:00", "21:17:00", "21:20:00", "21:32:00", "22:05:00", "22:20:00", "22:21:00", "22:32:00", "22:37:00", "22:42:00", "22:47:00", "22:50:00", "23:16:00", "23:26:00", "23:31:00", "23:36:00", "23:41:00", "23:46:00", "23:51:00", "23:56:00", "3:07:00", "3:22:00", "3:52:00", "4:22:00", "4:52:00", "5:22:00", "6:37:00", "6:57:00", "7:52:00", "9:22:00"), class = "factor"), DateCorrectFmt = structure(c(4L, 8L, 1L, 3L, 8L, 5L), .Label = c("2010-08-17", "2010-08-21", "2010-08-22", "2010-08-28", "2010-08-29", "2010-09-21", "2010-09-22", "2010-10-21", "2011-02-19"), class = "factor"), variable = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("CaD_ICP", "NaD_ICP", "ZnD_ICP" ), class = "factor"), value = c(0.044, 0.1316, 0.0101, 0.0114, 80.13, 15.42)), .Names = c("Site", "Time", "DateCorrectFmt", "variable", "value"), row.names = c(1L, 2L, 6L, 8L, 11L, 14L), class = "data.frame") WQFunc <- function(df){ within(df, CalcFlag <- ifelse(variable =="CaD_ICP", (dataqualifier <- c("Y", "Q", "","A")[findInterval(value,c(-Inf, 0.027, 0.1, 100, Inf))]), "")) } WQ <- WQFunc(WaterData) print(WaterData) print(WQ) On Wed, Dec 7, 2011 at 5:01 PM, Steve E. wrote: > Thanks to everyone for continued assistance with this problem. ?I realize > that I had not included enough information, hopefully I have done so here. > I attached a dput output of a sample of the data titled 'WaterData' (and str > output below). ?Below are dput outputs of the function I am trying to get > working and the resulting array when I run it. ?Unfortunately, Michael, > changing 'with' to 'within' did not solve the problem, as running the > function in that case produced no discernible output or result. ?What I > meant by the function now producing an array of values (though the result I > am looking for) that are not attached to the data frame, is that they show > up separately in a result window (in a similar format to what you get from > dput() and are not at all associated with the data frame). ?Again, thanks so > much! > >> dput(WQFunc) > function (dataframe) > { > ? ?dataframe$CalcFlag <- with(dataframe, ifelse(variable == > ? ? ? ?"CaD_ICP", (dataqualifier <- c("Y", "Q", "", > "A")[findInterval(dataframe$value, > ? ? ? ?c(-Inf, 0.027, 0.1, 100, Inf))]), "")) > } > >> str(WaterData) > 'data.frame': ? 126 obs. of ?5 variables: > ?$ Site ? ? ? ? ?: Factor w/ 6 levels "BV","CB","KP",..: 3 3 3 3 3 3 3 3 3 3 > ... > ?$ Time ? ? ? ? ?: Factor w/ 84 levels "0:00:00","0:00:52",..: 1 1 1 1 2 5 > 16 16 19 20 ... > ?$ DateCorrectFmt: Factor w/ 9 levels "2010-08-17","2010-08-21",..: 4 8 1 3 > 8 5 5 8 8 8 ... > ?$ variable ? ? ?: Factor w/ 3 levels "CaD_ICP","NaD_ICP",..: 1 1 1 1 1 1 1 > 1 1 1 ... > ?$ value ? ? ? ? : num ?0.044 0.1316 0.0101 0.0114 80.13 ... > > Below is the output I get if if I run the WQFunc as: > flagged <- WQFunc(WaterData) > >> dput(Flagged) > c("Q", "", "Y", "Y", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", > "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" > ) >> > > > Again, though, 'Flagged' is an array of those values in a output window but > are not 'attached' to WaterData. > > -- > View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4170688.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Thu Dec 8 00:08:11 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 17:08:11 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: Thanks a lot! Now I can see the individual plot, but still not the originally-desired multi-plot-on-one-page? Any thoughts? Thanks again! On 12/7/11, Yihui Xie wrote: > This is probably one of the most frequently asked questions. The > answer is to print() the objects. See R FAQ 7.22. > > http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f > > Regards, > Yihui > -- > Yihui Xie > Phone: 515-294-2465 Web: http://yihui.name > Department of Statistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > > On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: >> I found that if I run each "qplot" manually it would plot out something... >> >> but if I put it into the loop, >> >> it just doesn't work at all - sometimes it refused to plot anything... >> > From bby2103 at columbia.edu Thu Dec 8 00:12:16 2011 From: bby2103 at columbia.edu (bby2103 at columbia.edu) Date: Wed, 07 Dec 2011 18:12:16 -0500 Subject: [R] map at fips level using multiple variables Message-ID: <20111207181216.ov9bliufio84k0gk@cubmail.cc.columbia.edu> Hi, I just started playing with county FIPS feature in maps package which allows geospatial visualization of variables on US county level. Pretty cool. I did some search but couldn't find answer to this question--how can I map more than 2 variables on US map? For example, you can map by the breakdown of income or family size. How do you further breakdown based on the values of both variables and show them on the county FIPS level? Thanks in advance! Bonnie Yuan From xie at yihui.name Thu Dec 8 00:19:12 2011 From: xie at yihui.name (Yihui Xie) Date: Wed, 7 Dec 2011 17:19:12 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: This is another frequently asked question about ggplot2, but I don't know. What I can tell you is, if you use Sweave, you probably can consider the knitr package, which enables you to put any plots on one "page" (yes, I'm cheating via LaTeX); see Figure 1 in the manual: https://github.com/downloads/yihui/knitr/knitr-manual.pdf Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Dec 7, 2011 at 5:08 PM, Michael wrote: > Thanks a lot! > > Now I can see the individual plot, but still not the > originally-desired multi-plot-on-one-page? > > Any thoughts? Thanks again! > > On 12/7/11, Yihui Xie wrote: >> This is probably one of the most frequently asked questions. The >> answer is to print() the objects. See R FAQ 7.22. >> >> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f >> >> Regards, >> Yihui >> -- >> Yihui Xie >> Phone: 515-294-2465 Web: http://yihui.name >> Department of Statistics, Iowa State University >> 2215 Snedecor Hall, Ames, IA >> >> >> >> On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: >>> I found that if I run each "qplot" manually it would plot out something... >>> >>> but if I put it into the loop, >>> >>> it just doesn't work at all - sometimes it refused to plot anything... >>> >> From comtech.usa at gmail.com Thu Dec 8 00:19:17 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 17:19:17 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: I also did (inside the for loop): if (nCount==1) p1=tt if (nCount==2) p2=tt if (nCount==3) p3=tt if (nCount==4) p4=tt if (nCount==5) p5=tt if (nCount==6) p6=tt ... and then after the loop: windows() my.multiplot(p1, p2, p3, p4, p5, p6, cols=3) All the sub-plots in that multi-plot page are all identical! I cannot imagine how many hours I have been spending on fighting this issue! On 12/7/11, Michael wrote: > Thanks a lot! > > Now I can see the individual plot, but still not the > originally-desired multi-plot-on-one-page? > > Any thoughts? Thanks again! > > On 12/7/11, Yihui Xie wrote: >> This is probably one of the most frequently asked questions. The >> answer is to print() the objects. See R FAQ 7.22. >> >> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f >> >> Regards, >> Yihui >> -- >> Yihui Xie >> Phone: 515-294-2465 Web: http://yihui.name >> Department of Statistics, Iowa State University >> 2215 Snedecor Hall, Ames, IA >> >> >> >> On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: >>> I found that if I run each "qplot" manually it would plot out >>> something... >>> >>> but if I put it into the loop, >>> >>> it just doesn't work at all - sometimes it refused to plot anything... >>> >> > From yintengfei at gmail.com Thu Dec 8 00:21:44 2011 From: yintengfei at gmail.com (Tengfei Yin) Date: Wed, 7 Dec 2011 17:21:44 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Thu Dec 8 00:23:52 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 17:23:52 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: Very surprisingly in the generated multi-plot-on-the-same-page, the titles of the sub-plots are different... but their contents are the same(ie. the plotted curves are the same)... How could this happen? Any thoughts? On 12/7/11, Yihui Xie wrote: > This is another frequently asked question about ggplot2, but I don't > know. What I can tell you is, if you use Sweave, you probably can > consider the knitr package, which enables you to put any plots on one > "page" (yes, I'm cheating via LaTeX); see Figure 1 in the manual: > https://github.com/downloads/yihui/knitr/knitr-manual.pdf > > Regards, > Yihui > -- > Yihui Xie > Phone: 515-294-2465 Web: http://yihui.name > Department of Statistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > > On Wed, Dec 7, 2011 at 5:08 PM, Michael wrote: >> Thanks a lot! >> >> Now I can see the individual plot, but still not the >> originally-desired multi-plot-on-one-page? >> >> Any thoughts? Thanks again! >> >> On 12/7/11, Yihui Xie wrote: >>> This is probably one of the most frequently asked questions. The >>> answer is to print() the objects. See R FAQ 7.22. >>> >>> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f >>> >>> Regards, >>> Yihui >>> -- >>> Yihui Xie >>> Phone: 515-294-2465 Web: http://yihui.name >>> Department of Statistics, Iowa State University >>> 2215 Snedecor Hall, Ames, IA >>> >>> >>> >>> On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: >>>> I found that if I run each "qplot" manually it would plot out >>>> something... >>>> >>>> but if I put it into the loop, >>>> >>>> it just doesn't work at all - sometimes it refused to plot anything... >>>> >>> > From comtech.usa at gmail.com Thu Dec 8 00:29:31 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 17:29:31 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: Still the same problem - in the final aggregated plots, all the titles are diffrent(which is good), but the curve shapes are the same... How could this happen? Is this a bug? On 12/7/11, Tengfei Yin wrote: > library(gridExtra) > ?grid.arrange > > I found this function convenient to me, it could arrange multiple ggplot > object on the same view window > p1 <- qplot(...) > p2 <- qplot(...) > .... > grid.arrange(p1, p2, ..., nrow = 2) > > different from your design, but for the same purpose I guess. > > cheers > > Tengfei > > On Wed, Dec 7, 2011 at 5:08 PM, Michael wrote: > >> Thanks a lot! >> >> Now I can see the individual plot, but still not the >> originally-desired multi-plot-on-one-page? >> >> Any thoughts? Thanks again! >> >> On 12/7/11, Yihui Xie wrote: >> > This is probably one of the most frequently asked questions. The >> > answer is to print() the objects. See R FAQ 7.22. >> > >> > >> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f >> > >> > Regards, >> > Yihui >> > -- >> > Yihui Xie >> > Phone: 515-294-2465 Web: http://yihui.name >> > Department of Statistics, Iowa State University >> > 2215 Snedecor Hall, Ames, IA >> > >> > >> > >> > On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: >> >> I found that if I run each "qplot" manually it would plot out >> something... >> >> >> >> but if I put it into the loop, >> >> >> >> it just doesn't work at all - sometimes it refused to plot anything... >> >> >> > >> >> ______________________________________________ >> R-help at 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 code. >> > > > > -- > Tengfei Yin > MCDB PhD student > 1620 Howe Hall, 2274, > Iowa State University > Ames, IA,50011-2274 > Homepage: www.tengfei.name > From diviya.smith at gmail.com Thu Dec 8 01:02:00 2011 From: diviya.smith at gmail.com (Diviya Smith) Date: Wed, 7 Dec 2011 19:02:00 -0500 Subject: [R] R function implementation Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From wdunlap at tibco.com Thu Dec 8 01:03:14 2011 From: wdunlap at tibco.com (William Dunlap) Date: Thu, 8 Dec 2011 00:03:14 +0000 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: I've lost track of the changes you've done to your code and your original code was not runnable. However, I noticed it used the line myplotlist[nCount]=tt where myplotlist was a list. Try changing that to myplotlist[[nCount]] <- tt (the '=' is acceptable but the the '[' is wrong). I made that change to the code you posted at "Wed Dec 7 23:32:08 CET 2011" (in the R-help archives), along with some extra lines to generate data, and it seemed to work. When using the original myplotlist[nCount] <- tt I got one warning per plot Warning messages: 1: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length 2: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length 3: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length 4: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length 5: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length 6: In myplotlist[nCount] = tt : number of items to replace is not a multiple of replacement length and no plots were displayed. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com --- start of modified R script --- my.multiplot <- function(..., plotlist=NULL, cols) { require(grid) # Make a list from the ... arguments and plotlist plots <- c(list(...), plotlist) numPlots <- length(plots) # Make the panel plotCols <- cols # Number of columns of plots plotRows <- ceiling(numPlots/plotCols) # Number of rows needed # Set up the page grid.newpage() pushViewport(viewport(layout = grid.layout(plotRows, plotCols))) vplayout <- function(x, y) { viewport(layout.pos.row = x, layout.pos.col = y) } # Make each plot, in the correct location for (i in 1:numPlots) { curRow <- ceiling(i/plotCols) curCol <- (i-1) %% plotCols + 1 print(plots[[i]], vp = vplayout(curRow, curCol )) } } myyears <- 1996:2001 myplotlist <- vector('list', length(myyears)) nCount <- 0; for (j in myyears) { print(j) nCount <- nCount+1 #... # prepare datasub and factorsub for different j... datasub <- j + ((1:10)%%nCount)/12 # different shape of curve each year factorsub <- paste(month.name[1:10], j) #... tmp <- data.frame(datasub,factorsub=factor(factorsub, levels=unique(factorsub))) tt <- qplot(factorsub, datasub, data=tmp, geom = "boxplot", ylab='Chg', xlab='Hours', main=j) myplotlist[[nCount]] <- tt } my.multiplot(plotlist=myplotlist,cols=3) --- end of modified R script > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Michael > Sent: Wednesday, December 07, 2011 3:30 PM > To: Tengfei Yin > Cc: r-help > Subject: Re: [R] Help! I couldn't put multiple qplot on the same page... > > Still the same problem - in the final aggregated plots, all the titles > are diffrent(which is good), but the curve shapes are the same... > > How could this happen? > > Is this a bug? > > On 12/7/11, Tengfei Yin wrote: > > library(gridExtra) > > ?grid.arrange > > > > I found this function convenient to me, it could arrange multiple ggplot > > object on the same view window > > p1 <- qplot(...) > > p2 <- qplot(...) > > .... > > grid.arrange(p1, p2, ..., nrow = 2) > > > > different from your design, but for the same purpose I guess. > > > > cheers > > > > Tengfei > > > > On Wed, Dec 7, 2011 at 5:08 PM, Michael wrote: > > > >> Thanks a lot! > >> > >> Now I can see the individual plot, but still not the > >> originally-desired multi-plot-on-one-page? > >> > >> Any thoughts? Thanks again! > >> > >> On 12/7/11, Yihui Xie wrote: > >> > This is probably one of the most frequently asked questions. The > >> > answer is to print() the objects. See R FAQ 7.22. > >> > > >> > > >> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f > >> > > >> > Regards, > >> > Yihui > >> > -- > >> > Yihui Xie > >> > Phone: 515-294-2465 Web: http://yihui.name > >> > Department of Statistics, Iowa State University > >> > 2215 Snedecor Hall, Ames, IA > >> > > >> > > >> > > >> > On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: > >> >> I found that if I run each "qplot" manually it would plot out > >> something... > >> >> > >> >> but if I put it into the loop, > >> >> > >> >> it just doesn't work at all - sometimes it refused to plot anything... > >> >> > >> > > >> > >> ______________________________________________ > >> R-help at 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 code. > >> > > > > > > > > -- > > Tengfei Yin > > MCDB PhD student > > 1620 Howe Hall, 2274, > > Iowa State University > > Ames, IA,50011-2274 > > Homepage: www.tengfei.name > > > > ______________________________________________ > R-help at 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 code. From ggrothendieck at gmail.com Thu Dec 8 01:29:54 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Wed, 7 Dec 2011 19:29:54 -0500 Subject: [R] nice report generator? In-Reply-To: <4EDFEFAF.1090208@gmail.com> References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> Message-ID: On Wed, Dec 7, 2011 at 5:58 PM, Duncan Murdoch wrote: > On 11-12-07 5:43 PM, Gabor Grothendieck wrote: >> >> On Wed, Dec 7, 2011 at 5:26 PM, Richard M. Heiberger >> ?wrote: >>> >>> Michael, >>> >>> that is a challenge. >>> >>> I accept it and suggest that it be a contest on the R-help list. >>> >>> Please post a pdf file showing some (more than one) tables that you think >>> look better in Excel than in LaTeX. >>> I,and probably some others, will send our versions of the tables. >>> >>> I think a new email thread with an appropriate catchy title would be the >>> way to do it. >> >> >> The problem is that its drop dead easy in Excel but its not readily >> accessible in R and latex (as opposed to the problem being raw >> capability). Simply exhibiting how to do it is not enough. ?What is >> needed is a function, accessible from CRAN, with a bunch of built in >> themes that are easy to apply: >> >> latex(DF, theme = "cherry orchard") >> >> > > I don't believe you. ?Show us some examples. > As I mentioned, its not just a matter of replicating the output. Its a matter of how easy it is to generate it. With Excel 2007 enter a table into the cells, select it and on the Home tab in the Styles group of the ribbon click on Format a Table. Select any of the templates that are presented and that's it. I have produced quite fancy tables with R and latex beyond what the above instructions could do in Excel but I did not regard that effort as easy although it did produce very nice looking tables. There is a new tables package that just appeared on CRAN in the last few days. I haven't seriously used it yet but perhaps it has some of these capabilities (or if not will evolve into providing not only the tabular content but also the presentation aspects that are important to some users) or perhaps some other CRAN package has already gone in this direction. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From saptarshi.guha at gmail.com Thu Dec 8 01:47:17 2011 From: saptarshi.guha at gmail.com (Saptarshi Guha) Date: Wed, 7 Dec 2011 16:47:17 -0800 Subject: [R] Adding a modified top axis label using LatticeExtra and theEconomist theme Message-ID: Hello, I have the following code asTheEconomist(bwplot(ver~quans,data=z,cex=0.5,subset=abs(quans)<1.1,scales=list(x=list(tick.num=20,cex=0.55,alternating=3)) ,xscale.components = xscale.components.CF ,main=list('FOOO"',cex=0.8))) The xscale.components displays the exponent of the labels on the bottom x-axis. Without the asTheEconomist, it displays okay. Using TheEconomist, the top axis disappears. How can i force the top axis to appear? Thanks for your time Saptarshi From dwinsemius at comcast.net Thu Dec 8 01:50:11 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Wed, 7 Dec 2011 19:50:11 -0500 Subject: [R] map at fips level using multiple variables In-Reply-To: <20111207181216.ov9bliufio84k0gk@cubmail.cc.columbia.edu> References: <20111207181216.ov9bliufio84k0gk@cubmail.cc.columbia.edu> Message-ID: On Dec 7, 2011, at 6:12 PM, bby2103 at columbia.edu wrote: > Hi, I just started playing with county FIPS feature in maps package > which allows geospatial visualization of variables on US county > level. Pretty cool. Got code? > > I did some search but couldn't find answer to this question--how can > I map more than 2 variables on US map? "2 variables" is a bit on the vague side for programming purposes. > For example, you can map by the breakdown of income or family size. > How do you further breakdown based on the values of both variables > and show them on the county FIPS level? "breakdown" suggests a factor construct. If so, then : ?interaction But the "show" part of the question remains very vague. Can't you be a bit more specific? What DO you want? -- David Winsemius, MD West Hartford, CT From jholtman at gmail.com Thu Dec 8 02:10:24 2011 From: jholtman at gmail.com (jim holtman) Date: Wed, 7 Dec 2011 20:10:24 -0500 Subject: [R] R function implementation In-Reply-To: References: Message-ID: Before rewriting in C, especially if you are new at it, have you profiled (Rprof) your function to see the time is being spent? Are you using dataframe or matrices; there is a big speed different between them when accessing data. So profile your code, see where the time is spent and then decide what to do about it. Depending on your choice of data structures and algorithms, R can be very fast. So take some time, profile your code and provide a sample of the function so that we can see what you are trying to do and then maybe we would suggest other approaches. I have been using R/SPlus for a number of years, know C reasonably well, and have yet to write any function in C to improve the speed of R. On Wed, Dec 7, 2011 at 7:02 PM, Diviya Smith wrote: > Hello there, > > I recently wrote some code to perform pairwise correlations between all > samples in a large dataset. So we are talking about performing pairwise > correlations between 400K vectors. Since R has a very rich library of > functions, it was very easy to code this in R. However, R was probably not > the best choice as it is super slow for this large job. So my plan is to > recode it in C. I was wondering if it is possible to see the code between > some of the functions. > > I am looking for the raw code for simple data handling functions such as > split, cut, etc so that I can directly use those in C. I am fairly new to > programming in C and so this will be a big help. > > Thanks for you help in advance. > > Diviya > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. From armstrong.whit at gmail.com Thu Dec 8 03:00:53 2011 From: armstrong.whit at gmail.com (Whit Armstrong) Date: Wed, 7 Dec 2011 21:00:53 -0500 Subject: [R] R on the cloud - Windows to Linux In-Reply-To: References: Message-ID: subscribe to R-hpc. and check out these: https://github.com/armstrtw/rzmq https://github.com/armstrtw/AWS.tools https://github.com/armstrtw/deathstar and this: http://code.google.com/p/segue/ If you're willing to work, you can probably get deathstar to work using a local windows box and remote linux nodes. -Whit On Wed, Dec 7, 2011 at 6:02 PM, Ben quant wrote: > Hello, > > I'm working with the gam function and due to the amount of data I am > working with it is taking a long time to run. I looked at the tips to get > it to run faster, but none have acceptable side effects. That is the real > problem. > > I have accepted that gam will run a long time. I will be running gam many > times for many different models. To make gam useable I am looking at > splitting the work up and putting all of it on an Amazon EC2 cloud. I have > a Windows machine and I'm (planning on) running Linux EC2 instances via > Amazon. > > I have R running on one EC2 instance now. Now I'm looking to: > > 1) division of processing > 2) creating/terminating instances via R > 3) porting code and data to the cloud > 4) producing plots on the cloud and getting them back on my (Windows) > computer for review > 5) do all of the above programmically (over night) > > I am new'ish to R, brand new to the cloud, and I am new to Linux (but I > have access to a Linux expert at my company). I'm looking for 1) guidance > so I am headed in the best direction from the start, 2) any gotchas I can > learn from, 3) package suggestions. > > Thank you very much for your assistance! > > Regards, > > Ben > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From xie at yihui.name Thu Dec 8 03:51:39 2011 From: xie at yihui.name (Yihui Xie) Date: Wed, 7 Dec 2011 20:51:39 -0600 Subject: [R] Help! I couldn't put multiple qplot on the same page... In-Reply-To: References: Message-ID: The two plots are in two PDF files, and I said I cheated via LaTeX, i.e. nothing but putting two \includegraphics{} commands in the same paragraph. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Dec 7, 2011 at 5:23 PM, Michael wrote: > Very surprisingly in the generated multi-plot-on-the-same-page, the > titles of the sub-plots are different... but their contents are the > same(ie. the plotted curves are the same)... > > How could this happen? > > Any thoughts? > > On 12/7/11, Yihui Xie wrote: >> This is another frequently asked question about ggplot2, but I don't >> know. What I can tell you is, if you use Sweave, you probably can >> consider the knitr package, which enables you to put any plots on one >> "page" (yes, I'm cheating via LaTeX); see Figure 1 in the manual: >> https://github.com/downloads/yihui/knitr/knitr-manual.pdf >> >> Regards, >> Yihui >> -- >> Yihui Xie >> Phone: 515-294-2465 Web: http://yihui.name >> Department of Statistics, Iowa State University >> 2215 Snedecor Hall, Ames, IA >> From bates at stat.wisc.edu Thu Dec 8 03:54:35 2011 From: bates at stat.wisc.edu (Douglas Bates) Date: Wed, 7 Dec 2011 20:54:35 -0600 Subject: [R] MIXED MODEL WITH REPEATED MEASURES In-Reply-To: <003701ccb52a$5542d940$ffc88bc0$@com> References: <003701ccb52a$5542d940$ffc88bc0$@com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From erinm.hodgess at gmail.com Thu Dec 8 04:15:05 2011 From: erinm.hodgess at gmail.com (Erin Hodgess) Date: Wed, 7 Dec 2011 21:15:05 -0600 Subject: [R] a weird "cut" question Message-ID: Dear R People: I have the following data: > ail.df[,1] [1] 47677 47602 47678 47905 47909 47906 47605 47673 47607 > cut(ail.df[,1],breaks=3) [1] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] [4] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] [7] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] Levels: (4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] > so I have cut ail.df[,1] into 3 levels. However, the second level never appears in the data set. Is there a way to set cut such that every level appears, please? thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com From wdunlap at tibco.com Thu Dec 8 04:32:49 2011 From: wdunlap at tibco.com (William Dunlap) Date: Thu, 8 Dec 2011 03:32:49 +0000 Subject: [R] a weird "cut" question In-Reply-To: References: Message-ID: You could use quantile() to create the breakpoints > x <- c(47677, 47602, 47678, 47905, 47909, 47906, 47605, 47673, 47607) > cutX <- cut(x, breaks=quantile(x, (0:3)/3), include.lowest=TRUE) > cutX [1] (4.77e+04,4.78e+04] [4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] [5] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] [4.76e+04,4.77e+04] (4.77e+04,4.78e+04] [9] [4.76e+04,4.77e+04] Levels: [4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] > table(cutX) cutX [4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] 3 3 3 This will fail if there are only 2 distinct values in the dataset. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Erin Hodgess > Sent: Wednesday, December 07, 2011 7:15 PM > To: R help > Subject: [R] a weird "cut" question > > Dear R People: > > I have the following data: > > > ail.df[,1] > [1] 47677 47602 47678 47905 47909 47906 47605 47673 47607 > > cut(ail.df[,1],breaks=3) > [1] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] > [4] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] > [7] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] > Levels: (4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] > > > so I have cut ail.df[,1] into 3 levels. However, the second level > never appears in the data set. > > Is there a way to set cut such that every level appears, please? > > thanks in advance, > Sincerely, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > R-help at 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 code. From Rainer.Schuermann at gmx.net Thu Dec 8 04:55:25 2011 From: Rainer.Schuermann at gmx.net (Rainer Schuermann) Date: Thu, 8 Dec 2011 04:55:25 +0100 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> Message-ID: <20111208035525.17370@gmx.net> > ... or perhaps some other CRAN package has already gone in > this direction. The tableGrob function in the gridExtra package probably is one of them. -------- Original-Nachricht -------- > Datum: Wed, 7 Dec 2011 19:29:54 -0500 > Von: Gabor Grothendieck > An: Duncan Murdoch > CC: r-help , Janko Thyson > Betreff: Re: [R] nice report generator? > On Wed, Dec 7, 2011 at 5:58 PM, Duncan Murdoch > wrote: > > On 11-12-07 5:43 PM, Gabor Grothendieck wrote: > >> > >> On Wed, Dec 7, 2011 at 5:26 PM, Richard M. Heiberger > >> ?wrote: > >>> > >>> Michael, > >>> > >>> that is a challenge. > >>> > >>> I accept it and suggest that it be a contest on the R-help list. > >>> > >>> Please post a pdf file showing some (more than one) tables that you > think > >>> look better in Excel than in LaTeX. > >>> I,and probably some others, will send our versions of the tables. > >>> > >>> I think a new email thread with an appropriate catchy title would be > the > >>> way to do it. > >> > >> > >> The problem is that its drop dead easy in Excel but its not readily > >> accessible in R and latex (as opposed to the problem being raw > >> capability). Simply exhibiting how to do it is not enough. ?What is > >> needed is a function, accessible from CRAN, with a bunch of built in > >> themes that are easy to apply: > >> > >> latex(DF, theme = "cherry orchard") > >> > >> > > > > I don't believe you. ?Show us some examples. > > > > As I mentioned, its not just a matter of replicating the output. Its a > matter of how easy it is to generate it. With Excel 2007 enter a > table into the cells, select it and on the Home tab in the Styles > group of the ribbon click on Format a Table. Select any of the > templates that are presented and that's it. > > I have produced quite fancy tables with R and latex beyond what the > above instructions could do in Excel but I did not regard that effort > as easy although it did produce very nice looking tables. > > There is a new tables package that just appeared on CRAN in the last > few days. I haven't seriously used it yet but perhaps it has some of > these capabilities (or if not will evolve into providing not only the > tabular content but also the presentation aspects that are important > to some users) or perhaps some other CRAN package has already gone in > this direction. > > -- > Statistics & Software Consulting > GKX Group, GKX Associates Inc. > tel: 1-877-GKX-GROUP > email: ggrothendieck at gmail.com > > ______________________________________________ > R-help at 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 code. -- ------- Gentoo Linux with KDE From eric.fail at gmx.us Thu Dec 8 05:07:54 2011 From: eric.fail at gmx.us (Eric Fail) Date: Wed, 7 Dec 2011 20:07:54 -0800 Subject: [R] plotting and coloring longitudinal data with three time points (ggplot2) In-Reply-To: References: <20111207090233.276920@gmx.com> Message-ID: Thank you for solving my problem, it worked out beautifully. This was exactly what I was looking for, the ggplot2 package keeps impressing me. Thanks, Eric On Wed, Dec 7, 2011 at 6:01 AM, Hadley Wickham wrote: > On Wed, Dec 7, 2011 at 4:02 AM, Eric Fail wrote: >> ?Dear list, >> >> I have been struggling with this for some time now, and for the last hour I have been struggling to make a working example for the list. I hope someone out there have some experience with plotting longitudinal data that they will share. >> >> My data is some patient data with three different time stamps. First the patients are identified at different times (first time stamp). Second, they go through an assessment phase and begin their treatment (time stamp 2). Finally they are admitted from the hospital at some point (time stamp 3), >> >> I would like to make a spaghetti plot with the assessment phase in one color and the treatment phase in another color. >> >> I used ggplot2, and with this example data and only two time points; it works fine (I call it my working example), >> >> library(ggplot2) >> df <- data.frame( >> ??date = seq(Sys.Date(), len=104, by="1 day")[sample(104, 52)], >> ?? patient = factor(rep(1:26, 2), labels = LETTERS) >> ?) >> df <- df[order(df$date), ] >> dt <- qplot(date, patient, data=df, geom="line") >> dt + scale_x_date() >> df[ which(df$patient=='E'), c("patient", "date")] >> >> But, if I have three time points, R, for some reason I do not yet understand, add the two second time points in some funny way. >> >> Finally, when that is solved; how do I colorize the different parts of the line so the assessment phase gets one color and the treatment phase another? >> >> I want to be able to show how long we have been in contact with our patients, how much of the contact time that was assessment and how much that was actual treatment. >> >> Below is an example (I call it the not-working example) >> >> df2 <- data.frame( >> ??date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], >> ??patient2 = factor(rep(1:26, 3), labels = LETTERS) >> ?) >> >> df2 <- df2[order(df2$date2), ] >> dt2 <- qplot(date2, patient2, data=df2, geom="line") >> dt2 + scale_x_date(major="months", minor="weeks") >> df2[ which(df2$patient2=='B'), c("patient2", "date2")] > > Did you mean something like this? > > library(ggplot2) > library(plyr) > > df2 <- data.frame( > ?date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], > ?patient2 = factor(rep(1:26, 3), labels = LETTERS) > ) > > df2 <- ddply(df2, "patient2", mutate, visit = order(date2)) > > qplot(date2, patient2, data = df2, geom = "line") + > ?geom_point(aes(colour = factor(visit))) > > # or this? > > library(ggplot2) > library(plyr) > > df2 <- data.frame( > ?date2 = seq(Sys.Date(), len= 156, by="2 day")[sample(156, 78)], > ?patient2 = factor(rep(1:26, 3), labels = LETTERS) > ) > > df2 <- ddply(df2, "patient2", mutate, visit = order(date2)) > > qplot(date2, patient2, data = df2, geom = "line", colour = > factor(visit), group = patient2) > > # Obviously the lines are drawn between the observations so you only > see the first two visits. > > Hadley > > -- > Assistant Professor / Dobelman Family Junior Chair > Department of Statistics / Rice University > http://had.co.nz/ From bby2103 at columbia.edu Thu Dec 8 05:14:27 2011 From: bby2103 at columbia.edu (bby2103 at columbia.edu) Date: Wed, 07 Dec 2011 23:14:27 -0500 Subject: [R] map at fips level using multiple variables In-Reply-To: References: <20111207181216.ov9bliufio84k0gk@cubmail.cc.columbia.edu> Message-ID: <20111207231427.illmhymh6sc8ks8o@cubmail.cc.columbia.edu> Hi David, Sorry it sounds vague. Here is my current code, which gives the distribution of family size at US county level. You will see on a US map family size distribution represented by different colors. Now if i have another variable income, which has 3 categories(<50k, 50k-80k,>80k). How do I show 5x3 categories on the map? I guess I could always create a third variable to do this. Just wondering maybe there is a function to do this readily? Thank you! Bonnie Yuan y=data1$size x11() hist(y,nclass=15) # histogram of y fivenum(y) # specify the cut-off point of y y.colorBuckets=as.numeric(cut(y, c(1,2, 3,6))) # legend showing the cut-off points. legend.txt=c("0-1","1-2","2-3","3-6",">6") colorsmatched=y.colorBuckets[match(county.fips$fips,fips[,1])] x11() map("county", col = colors[colorsmatched], fill = TRUE, resolution = 0) map("state", col = "white", fill = FALSE, add = TRUE, lty = 1, lwd = 0.2) title("Family Size") legend("bottom", legend.txt, horiz = TRUE, fill = colors, cex=0.7) Quoting David Winsemius : > > On Dec 7, 2011, at 6:12 PM, bby2103 at columbia.edu wrote: > >> Hi, I just started playing with county FIPS feature in maps package >> which allows geospatial visualization of variables on US county >> level. Pretty cool. > > Got code? > >> >> I did some search but couldn't find answer to this question--how >> can I map more than 2 variables on US map? > > "2 variables" is a bit on the vague side for programming purposes. > >> For example, you can map by the breakdown of income or family size. >> How do you further breakdown based on the values of both variables >> and show them on the county FIPS level? > > "breakdown" suggests a factor construct. If so, then : > > ?interaction > > But the "show" part of the question remains very vague. > > Can't you be a bit more specific? What DO you want? > > -- > David Winsemius, MD > West Hartford, CT From comtech.usa at gmail.com Thu Dec 8 05:42:29 2011 From: comtech.usa at gmail.com (Michael) Date: Wed, 7 Dec 2011 22:42:29 -0600 Subject: [R] nice report generator? In-Reply-To: <20111208035525.17370@gmx.net> References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From ggrothendieck at gmail.com Thu Dec 8 05:58:48 2011 From: ggrothendieck at gmail.com (Gabor Grothendieck) Date: Wed, 7 Dec 2011 23:58:48 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: On Wed, Dec 7, 2011 at 11:42 PM, Michael wrote: > Do you have an example...? Thanks a lot! See this video: http://www.woopid.com/video/1388/Format-as-Table -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com From michael.weylandt at gmail.com Thu Dec 8 06:16:27 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 8 Dec 2011 00:16:27 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: And for tableGrob, you can see some very basic functionality by typing library(gridExtra) example(tableGrob) Michael On Wed, Dec 7, 2011 at 11:58 PM, Gabor Grothendieck wrote: > On Wed, Dec 7, 2011 at 11:42 PM, Michael wrote: >> Do you have an example...? Thanks a lot! > > See this video: > http://www.woopid.com/video/1388/Format-as-Table > > -- > Statistics & Software Consulting > GKX Group, GKX Associates Inc. > tel: 1-877-GKX-GROUP > email: ggrothendieck at gmail.com > > ______________________________________________ > R-help at 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 code. From kfvankirk at alaska.edu Thu Dec 8 01:36:47 2011 From: kfvankirk at alaska.edu (K. VanKirk) Date: Wed, 7 Dec 2011 16:36:47 -0800 (PST) Subject: [R] Label margins in multiple perspective plots per page Message-ID: <1323304607464-4171096.post@n4.nabble.com> Hi folks~ As yet I've been unable to determine how to expand the distance between the tick marks and tick labels in perspective plots. None of the 'par' setting appear to be applicable to this (including mfg), and placing multiple plots per page results in a bit obscurity, with the tick values overlapping either the tick marks or the axes themselves. The code: main.grid<-layout(matrix(c(1,2,3,4,5,6,7,8),nr=4), widths=c(20,20), heights=c(20,20,20,20)) ticks <- pretty(z) par(mar=c(2,2,2,2)) z <- TPSSLmc x <- (1:nrow(z)+1980) y <- (1:ncol(z)) z0 <- min(z) z <- rbind(z0, cbind(z0, z, z0), z0) x <- c(min(x) - 1e-10, x, max(x) + 1e-10) y <- c(min(y) - 1e-10, y, max(y) + 1e-10) fill <- matrix("seagreen", nr = nrow(z)-1, nc = ncol(z)-1) fill[ , i2 <- c(1,ncol(fill))] <- "grey" fill[i1 <- c(1,nrow(fill)) , ] <- "grey" fcol <- fill zi <- TPSSLmc[-1,-1] + TPSSLmc[ -1,-12] + TPSSLmc[-20,-1] + TPSSLmc[-20,-12] ## / 4 fcol[-i1,-i2] <- heat.colors(30)[cut(zi, quantile(zi, seq(0,1, len = 20)), include.lowest = TRUE)] persp(x, y, z, theta = 140, phi = 20, col = fcol, scale = FALSE, axes=TRUE, ylab="Prey_Age",xlab="",zlab="", nticks=4,ticktype="detailed",expand=17,shade=0.2,cex.axis=1.4,cex.lab=1.5) title("OPERATING MODEL", font.main=3,cex.main=1.5) [plot code repeated 7x for 8 plots per page] dev.off() Thanks so much!! K. VanKirk -- View this message in context: http://r.789695.n4.nabble.com/Label-margins-in-multiple-perspective-plots-per-page-tp4171096p4171096.html Sent from the R help mailing list archive at Nabble.com. From sharkbrainpdx at gmail.com Thu Dec 8 03:24:01 2011 From: sharkbrainpdx at gmail.com (Dgnn) Date: Wed, 7 Dec 2011 18:24:01 -0800 (PST) Subject: [R] partial duplicates of dataframe rows, indexing and removal Message-ID: <1323311041598-4171322.post@n4.nabble.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rich at adgooroo.com Thu Dec 8 04:41:53 2011 From: rich at adgooroo.com (Rich Stokes) Date: Thu, 8 Dec 2011 03:41:53 +0000 Subject: [R] SVM performance using laplace kernel is too slow Message-ID: <70925BAF1CA72C40931E6FF992651DFC12A6BD57@SN2PRD0602MB106.namprd06.prod.outlook.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bernhard.konrad at googlemail.com Thu Dec 8 04:54:30 2011 From: bernhard.konrad at googlemail.com (Bernhard Konrad) Date: Wed, 7 Dec 2011 19:54:30 -0800 (PST) Subject: [R] Fit initial time with modFit and modCost Message-ID: <68b5b65d-230c-48ed-8b68-09c198cd529b@18g2000prn.googlegroups.com> Hello, I would like to use modFit and modCost from the package FME to find the optimal initial time t0 of a process. For simplicity, the process is either "off" (value 0) or "on" (value h). So I have a data vector with some zeros followed by some h's, e.g. > c(0,0,0,2,2,2,2,2,2,2) [1] 0 0 0 2 2 2 2 2 2 2 (hence h=2 here). I want to find the best guess for the initial time t0 when the process starts, in the example the process starts at t0 = 3 (in fact, t0 is any number between 3 and 4. All we know is that the process must have started before t=4). And I want to use modFit and modCost for this (in this example it's of course trivial, it suffices to find the first non-zero entry, but it become more challenging when e.g. the data is noisy). However, it seems that modFit can not do this, at least not in a straight forward manner. Here is my minimal example: ########### library(FME) #function makeframe creates a vector with 10 entries, the first t0 entries are 0, the remaining entries are h. Output is a #data.frame with "time" (1,2,...,10) and "M" (0,...,0,h,...,h) makeframe <- function(Par){ with(as.list(c(Par)),{ t <- seq(1,10,by=1) vec <- h*as.numeric(t>t0) return(data.frame(time=t,M=vec)) }) } #Let the "measurement" be (0,0,0,2,2,2,2,2,2,2) fakeobs <- makeframe(c(t0=3,h=2)) #cost function provided by modCost cost <- function(Par){ out <- makeframe(Par) cost <- modCost(model=out,obs=fakeobs) return(cost) } #Fit for best t0 and h value, initial guess t0=5.5, h=1.2 initial <- c(t0=5.5,h=1.2) Fit <- modFit(f=cost,p=initial) coef(Fit) #this should be t0=3 (or and value t0 in the interval [3,4)) and h=2. #h=2 is fitted correctly, but t0 remains at the initial guess. #plot results for illustration plot(fakeobs) lines(makeframe(initial),lty=2) lines(makeframe(coef(Fit))) legend("bottomright",c("data","initial","fitted"),lty=c(NA, 2,1),pch=c(1,NA,NA)) ########### > coef(Fit) t0 h 5.5 2.0 As you can see, the height h is fitted correctly, but the initial time t0 remains at the initial guess. I assume this is because the cost function does not change for any t0 in the interval (5,6), as makeframe(c(t0=5.5,h=...)) is the same as makeframe(c(t0=5,h=...)). Hence the numerical solver is at a local minimum for any value of t0 in (5,6), when h=2. So the x-values can not be fitted because they are discrete; the y-values can be fitted because they are continuous. Is there a common "trick" used in such a situation? How can I find the best t0 (more precisely: a best t0)? Thank you and kind regards! From gleynes at gmail.com Thu Dec 8 06:10:51 2011 From: gleynes at gmail.com (Gene Leynes) Date: Wed, 7 Dec 2011 23:10:51 -0600 Subject: [R] read.table performance In-Reply-To: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> References: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> Message-ID: <-5016323606172784197@unknownmsgid> No, it was just on my desktop (and on a network drive, and in a temp folder on my c drive). There have been some new policies put into place at work though, and perhaps that includes more / some monitoring software, but I don't know. Sent from my iPhone On Dec 7, 2011, at 4:11 PM, peter dalgaard wrote: > > On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote: > >> R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file >> verbatim: system.time(read.table("test2.txt")) > > About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8. > > Gene, are you by any chance storing the file in a heavily virus-scanned system directory? > > -pd > >> Michael >> >> 2011/12/7 Gene Leynes : >>> Peter, >>> >>> You're quite right; it's nearly impossible to make progress without a >>> working example. >>> >>> I created an ** extremely simplified ** example for distribution. The real >>> data has numeric, character, and boolean classes. >>> >>> The file still takes 25.08 seconds to read, despite it's small size. >>> >>> I neglected to mention that I'm using R 2.13.0 and I"m on a windows 7 >>> machine (not that it should particularly matter with this type of data / >>> functions). >>> >>> ## The code: >>> options(stringsAsFactors=FALSE) >>> system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) >>> str(dat, 0) >>> >>> >>> Thanks again! >>> >>> >>> >>> On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard wrote: >>> >>>> >>>> On Dec 6, 2011, at 22:33 , Gene Leynes wrote: >>>> >>>>> Mark, >>>>> >>>>> Thanks for your suggestions. >>>>> >>>>> That's a good idea about the NULL columns; I didn't think of that. >>>>> Surprisingly, it didn't have any effect on the time. >>>> >>>> Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you >>>> fix both? >>>> >>>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >>>>>> rep(NULL,3696)). >>>> >>>> As a general matter, if you want people to dig into this, they need some >>>> paraphrase of the file to play with. Would it be possible to set up a small >>>> R program that generates a data file which displays the issue? Everything I >>>> try seems to take about a second to read in. >>>> >>>> -pd >>>> >>>>> >>>>> This problem was just a curiosity, I already did the import using Excel >>>> and >>>>> VBA. I was just going to illustrate the power and simplicity of R, but >>>> it >>>>> ironically it's been much slower and harder in R... >>>>> The VBA was painful and messy, and took me over an hour to write; but at >>>>> least it worked quickly and reliably. >>>>> The R code was clean and only took me about 5 minutes to write, but the >>>> run >>>>> time was prohibitively slow! >>>>> >>>>> I profiled the code, but that offers little insight to me. >>>>> >>>>> Profile results with 10 line file: >>>>> >>>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>>> $by.self >>>>> self.time self.pct total.time total.pct >>>>> scan 12.24 53.50 12.24 53.50 >>>>> read.table 10.58 46.24 22.88 100.00 >>>>> type.convert 0.04 0.17 0.04 0.17 >>>>> make.names 0.02 0.09 0.02 0.09 >>>>> >>>>> $by.total >>>>> total.time total.pct self.time self.pct >>>>> read.table 22.88 100.00 10.58 46.24 >>>>> scan 12.24 53.50 12.24 53.50 >>>>> type.convert 0.04 0.17 0.04 0.17 >>>>> make.names 0.02 0.09 0.02 0.09 >>>>> >>>>> $sample.interval >>>>> [1] 0.02 >>>>> >>>>> $sampling.time >>>>> [1] 22.88 >>>>> >>>>> >>>>> Profile results with 250 line file: >>>>> >>>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>>> $by.self >>>>> self.time self.pct total.time total.pct >>>>> scan 23.88 68.15 23.88 68.15 >>>>> read.table 10.78 30.76 35.04 100.00 >>>>> type.convert 0.30 0.86 0.32 0.91 >>>>> character 0.02 0.06 0.02 0.06 >>>>> file 0.02 0.06 0.02 0.06 >>>>> lapply 0.02 0.06 0.02 0.06 >>>>> unlist 0.02 0.06 0.02 0.06 >>>>> >>>>> $by.total >>>>> total.time total.pct self.time self.pct >>>>> read.table 35.04 100.00 10.78 30.76 >>>>> scan 23.88 68.15 23.88 68.15 >>>>> type.convert 0.32 0.91 0.30 0.86 >>>>> sapply 0.04 0.11 0.00 0.00 >>>>> character 0.02 0.06 0.02 0.06 >>>>> file 0.02 0.06 0.02 0.06 >>>>> lapply 0.02 0.06 0.02 0.06 >>>>> unlist 0.02 0.06 0.02 0.06 >>>>> simplify2array 0.02 0.06 0.00 0.00 >>>>> >>>>> $sample.interval >>>>> [1] 0.02 >>>>> >>>>> $sampling.time >>>>> [1] 35.04 >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: >>>>> >>>>>> hi gene: maybe someone else will reply with some subtleties that I'm >>>> not >>>>>> aware of. one other thing >>>>>> that might help: if you know which columns you want , you can set the >>>>>> others to NULL through >>>>>> colClasses and this should speed things up also. For example, say you >>>> knew >>>>>> you only wanted the >>>>>> first four columns and they were character. then you could do, >>>>>> >>>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), >>>>>> rep(NULL,3696)). >>>>>> >>>>>> hopefully someone else will say something that does the trick. it seems >>>>>> odd to me as far as the >>>>>> difference in timings ? good luck. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: >>>>>> >>>>>>> Mark, >>>>>>> >>>>>>> Thank you for the reply >>>>>>> >>>>>>> I neglected to mention that I had already set >>>>>>> options(stringsAsFactors=FALSE) >>>>>>> >>>>>>> I agree, skipping the factor determination can help performance. >>>>>>> >>>>>>> The main reason that I wanted to use read.table is because it will >>>>>>> correctly determine the column classes for me. I don't really want to >>>>>>> specify 3700 column classes! (I'm not sure what they are anyway). >>>>>>> >>>>>>> >>>>>>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds >>>> wrote: >>>>>>> >>>>>>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. >>>>>>>> If you know what your variables are ahead of time and what you want >>>> them to >>>>>>>> be, this allows you to be specific by specifying, character or >>>> numeric, >>>>>>>> etc and often it makes things faster. others will have more to say. >>>>>>>> >>>>>>>> also, if most of your variables are characters, R will try to turn >>>>>>>> convert them into factors by default. If you use as.is = TRUE it >>>> won't >>>>>>>> do this and that might speed things up also. >>>>>>>> >>>>>>>> >>>>>>>> Rejoinder: above tidbits are just from experience. I don't know if >>>>>>>> it's in stone or a hard and fast rule. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes >>>> wrote: >>>>>>>> >>>>>>>>> ** Disclaimer: I'm looking for general suggestions ** >>>>>>>>> I'm sorry, but can't send out the file I'm using, so there is no >>>>>>>>> reproducible example. >>>>>>>>> >>>>>>>>> I'm using read.table and it's taking over 30 seconds to read a tiny >>>>>>>>> file. >>>>>>>>> The strange thing is that it takes roughly the same amount of time if >>>>>>>>> the >>>>>>>>> file is 100 times larger. >>>>>>>>> >>>>>>>>> After re-reviewing the data Import / Export manual I think the best >>>>>>>>> approach would be to use Python, or perhaps the readLines function, >>>> but >>>>>>>>> I >>>>>>>>> was hoping to understand why the simple read.table approach wasn't >>>>>>>>> working >>>>>>>>> as expected. >>>>>>>>> >>>>>>>>> Some relevant facts: >>>>>>>>> >>>>>>>>> 1. There are about 3700 columns. Maybe this is the problem? Still >>>>>>>>> the >>>>>>>>> >>>>>>>>> file size is not very large. >>>>>>>>> 2. The file encoding is ANSI, but I'm not specifying that in the >>>>>>>>> >>>>>>>>> function. Setting fileEncoding="ANSI" produces an "unsupported >>>>>>>>> conversion" >>>>>>>>> error >>>>>>>>> 3. readLines imports the lines quickly >>>>>>>>> 4. scan imports the file quickly also >>>>>>>>> >>>>>>>>> >>>>>>>>> Obviously, scan and readLines would require more coding to identify >>>>>>>>> columns, etc. >>>>>>>>> >>>>>>>>> my code: >>>>>>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', >>>>>>>>> header=TRUE)) >>>>>>>>> >>>>>>>>> It's taking 33.4 seconds and the file size is only 315 kb! >>>>>>>>> >>>>>>>>> Thanks >>>>>>>>> >>>>>>>>> Gene >>>>>>>>> >>>>>>>>> [[alternative HTML version deleted]] >>>>>>>>> >>>>>>>>> ______________________________________________ >>>>>>>>> R-help at 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 code. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> ______________________________________________ >>>>> R-help at 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 code. >>>> >>>> -- >>>> Peter Dalgaard, Professor, >>>> Center for Statistics, Copenhagen Business School >>>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark >>>> Phone: (+45)38153501 >>>> Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> ______________________________________________ >>> R-help at 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 code. >>> > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > From raoul.t.dsouza at gmail.com Thu Dec 8 07:51:16 2011 From: raoul.t.dsouza at gmail.com (RaoulD) Date: Wed, 7 Dec 2011 22:51:16 -0800 (PST) Subject: [R] Select a set of rows based on a condition In-Reply-To: References: <1323256998142-4168594.post@n4.nabble.com> Message-ID: <1323327076534-4171746.post@n4.nabble.com> Thanks a million Michael! Works perfectly! Really appreciate it! -- View this message in context: http://r.789695.n4.nabble.com/Select-a-set-of-rows-based-on-a-condition-tp4168594p4171746.html Sent from the R help mailing list archive at Nabble.com. From jdnewmil at dcn.davis.ca.us Thu Dec 8 09:18:28 2011 From: jdnewmil at dcn.davis.ca.us (Jeff Newmiller) Date: Thu, 8 Dec 2011 00:18:28 -0800 Subject: [R] a weird "cut" question In-Reply-To: References: Message-ID: You picked a data set and ask whether the function parameters can fix the partition. Perhaps you should consider a different data set: rep(47677,9). I think you cannot "fix" the partition without considering the data also. Given that, you may be able to go back and manually identify a partition that works with a particular data set (e.g. use quantiles), but you may be asking too much to automate that for all data sets. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Erin Hodgess wrote: >Dear R People: > >I have the following data: > >> ail.df[,1] >[1] 47677 47602 47678 47905 47909 47906 47605 47673 47607 >> cut(ail.df[,1],breaks=3) >[1] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] >[4] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] (4.78e+04,4.79e+04] >[7] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] (4.76e+04,4.77e+04] >Levels: (4.76e+04,4.77e+04] (4.77e+04,4.78e+04] (4.78e+04,4.79e+04] >> >so I have cut ail.df[,1] into 3 levels. However, the second level >never appears in the data set. > >Is there a way to set cut such that every level appears, please? > >thanks in advance, >Sincerely, >Erin > > >-- >Erin Hodgess >Associate Professor >Department of Computer and Mathematical Sciences >University of Houston - Downtown >mailto: erinm.hodgess at gmail.com > >______________________________________________ >R-help at 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 code. From petr.pikal at precheza.cz Thu Dec 8 09:32:25 2011 From: petr.pikal at precheza.cz (Petr PIKAL) Date: Thu, 8 Dec 2011 09:32:25 +0100 Subject: [R] read.table performance In-Reply-To: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> References: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> Message-ID: Hi > system.time(dat<-read.table("test2.txt")) user system elapsed 32.38 0.00 32.40 > system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) user system elapsed 32.30 0.03 32.36 Couldn't.it be a Windows issue? _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Under development (unstable) major 2 minor 14.0 year 2011 month 04 day 27 svn rev 55657 language R version.string R version 2.14.0 Under development (unstable) (2011-04-27 r55657) > > dim(dat) [1] 7 3765 > But from the dat file it seems to me that its structure is somehow weird. > head(names(dat)) [1] "X..Hydrogen" "Helium" "Lithium" "Beryllium" "Boron" [6] "Carbon" > tail(names(dat)) [1] "Sulfur.32" "Chlorine.32" "Argon.32" "Potassium.32" "Calcium.32" [6] "Scandium.32" > There is row of names which has repeating values. Maybe the most time is spent by checking the names validity. Regards Petr r-help-bounces at r-project.org napsal dne 07.12.2011 23:11:10: > peter dalgaard > Odeslal: r-help-bounces at r-project.org > > 07.12.2011 23:11 > > Komu > > "R. Michael Weylandt" > > Kopie > > r-help at r-project.org, Gene Leynes > > P?edm?t > > Re: [R] read.table performance > > > On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote: > > > R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file > > verbatim: system.time(read.table("test2.txt")) > > About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8. > > Gene, are you by any chance storing the file in a heavily virus-scanned > system directory? > > -pd > > > Michael > > > > 2011/12/7 Gene Leynes : > >> Peter, > >> > >> You're quite right; it's nearly impossible to make progress without a > >> working example. > >> > >> I created an ** extremely simplified ** example for distribution. The real > >> data has numeric, character, and boolean classes. > >> > >> The file still takes 25.08 seconds to read, despite it's small size. > >> > >> I neglected to mention that I'm using R 2.13.0 and I"m on a windows 7 > >> machine (not that it should particularly matter with this type of data / > >> functions). > >> > >> ## The code: > >> options(stringsAsFactors=FALSE) > >> system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', header=TRUE)) > >> str(dat, 0) > >> > >> > >> Thanks again! > >> > >> > >> > >> On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard wrote: > >> > >>> > >>> On Dec 6, 2011, at 22:33 , Gene Leynes wrote: > >>> > >>>> Mark, > >>>> > >>>> Thanks for your suggestions. > >>>> > >>>> That's a good idea about the NULL columns; I didn't think of that. > >>>> Surprisingly, it didn't have any effect on the time. > >>> > >>> Hmm, I think you want "character" and "NULL" there (i.e., quoted). Did you > >>> fix both? > >>> > >>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), > >>>>> rep(NULL,3696)). > >>> > >>> As a general matter, if you want people to dig into this, they need some > >>> paraphrase of the file to play with. Would it be possible to set up a small > >>> R program that generates a data file which displays the issue? Everything I > >>> try seems to take about a second to read in. > >>> > >>> -pd > >>> > >>>> > >>>> This problem was just a curiosity, I already did the import using Excel > >>> and > >>>> VBA. I was just going to illustrate the power and simplicity of R, but > >>> it > >>>> ironically it's been much slower and harder in R... > >>>> The VBA was painful and messy, and took me over an hour to write; but at > >>>> least it worked quickly and reliably. > >>>> The R code was clean and only took me about 5 minutes to write, but the > >>> run > >>>> time was prohibitively slow! > >>>> > >>>> I profiled the code, but that offers little insight to me. > >>>> > >>>> Profile results with 10 line file: > >>>> > >>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > >>>> $by.self > >>>> self.time self.pct total.time total.pct > >>>> scan 12.24 53.50 12.24 53.50 > >>>> read.table 10.58 46.24 22.88 100.00 > >>>> type.convert 0.04 0.17 0.04 0.17 > >>>> make.names 0.02 0.09 0.02 0.09 > >>>> > >>>> $by.total > >>>> total.time total.pct self.time self.pct > >>>> read.table 22.88 100.00 10.58 46.24 > >>>> scan 12.24 53.50 12.24 53.50 > >>>> type.convert 0.04 0.17 0.04 0.17 > >>>> make.names 0.02 0.09 0.02 0.09 > >>>> > >>>> $sample.interval > >>>> [1] 0.02 > >>>> > >>>> $sampling.time > >>>> [1] 22.88 > >>>> > >>>> > >>>> Profile results with 250 line file: > >>>> > >>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") > >>>> $by.self > >>>> self.time self.pct total.time total.pct > >>>> scan 23.88 68.15 23.88 68.15 > >>>> read.table 10.78 30.76 35.04 100.00 > >>>> type.convert 0.30 0.86 0.32 0.91 > >>>> character 0.02 0.06 0.02 0.06 > >>>> file 0.02 0.06 0.02 0.06 > >>>> lapply 0.02 0.06 0.02 0.06 > >>>> unlist 0.02 0.06 0.02 0.06 > >>>> > >>>> $by.total > >>>> total.time total.pct self.time self.pct > >>>> read.table 35.04 100.00 10.78 30.76 > >>>> scan 23.88 68.15 23.88 68.15 > >>>> type.convert 0.32 0.91 0.30 0.86 > >>>> sapply 0.04 0.11 0.00 0.00 > >>>> character 0.02 0.06 0.02 0.06 > >>>> file 0.02 0.06 0.02 0.06 > >>>> lapply 0.02 0.06 0.02 0.06 > >>>> unlist 0.02 0.06 0.02 0.06 > >>>> simplify2array 0.02 0.06 0.00 0.00 > >>>> > >>>> $sample.interval > >>>> [1] 0.02 > >>>> > >>>> $sampling.time > >>>> [1] 35.04 > >>>> > >>>> > >>>> > >>>> > >>>> On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds wrote: > >>>> > >>>>> hi gene: maybe someone else will reply with some subtleties that I'm > >>> not > >>>>> aware of. one other thing > >>>>> that might help: if you know which columns you want , you can set the > >>>>> others to NULL through > >>>>> colClasses and this should speed things up also. For example, say you > >>> knew > >>>>> you only wanted the > >>>>> first four columns and they were character. then you could do, > >>>>> > >>>>> read.table(whatever, as.is=TRUE, colClasses = c(rep(character,4), > >>>>> rep(NULL,3696)). > >>>>> > >>>>> hopefully someone else will say something that does the trick. it seems > >>>>> odd to me as far as the > >>>>> difference in timings ? good luck. > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes wrote: > >>>>> > >>>>>> Mark, > >>>>>> > >>>>>> Thank you for the reply > >>>>>> > >>>>>> I neglected to mention that I had already set > >>>>>> options(stringsAsFactors=FALSE) > >>>>>> > >>>>>> I agree, skipping the factor determination can help performance. > >>>>>> > >>>>>> The main reason that I wanted to use read.table is because it will > >>>>>> correctly determine the column classes for me. I don't really want to > >>>>>> specify 3700 column classes! (I'm not sure what they are anyway). > >>>>>> > >>>>>> > >>>>>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds > >>> wrote: > >>>>>> > >>>>>>> Hi Gene: Sometimes using colClasses in read.table can speed things up. > >>>>>>> If you know what your variables are ahead of time and what you want > >>> them to > >>>>>>> be, this allows you to be specific by specifying, character or > >>> numeric, > >>>>>>> etc and often it makes things faster. others will have more to say. > >>>>>>> > >>>>>>> also, if most of your variables are characters, R will try to turn > >>>>>>> convert them into factors by default. If you use as.is = TRUE it > >>> won't > >>>>>>> do this and that might speed things up also. > >>>>>>> > >>>>>>> > >>>>>>> Rejoinder: above tidbits are just from experience. I don't know if > >>>>>>> it's in stone or a hard and fast rule. > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes > >>> wrote: > >>>>>>> > >>>>>>>> ** Disclaimer: I'm looking for general suggestions ** > >>>>>>>> I'm sorry, but can't send out the file I'm using, so there is no > >>>>>>>> reproducible example. > >>>>>>>> > >>>>>>>> I'm using read.table and it's taking over 30 seconds to read a tiny > >>>>>>>> file. > >>>>>>>> The strange thing is that it takes roughly the same amount of time if > >>>>>>>> the > >>>>>>>> file is 100 times larger. > >>>>>>>> > >>>>>>>> After re-reviewing the data Import / Export manual I think the best > >>>>>>>> approach would be to use Python, or perhaps the readLines function, > >>> but > >>>>>>>> I > >>>>>>>> was hoping to understand why the simple read.table approach wasn't > >>>>>>>> working > >>>>>>>> as expected. > >>>>>>>> > >>>>>>>> Some relevant facts: > >>>>>>>> > >>>>>>>> 1. There are about 3700 columns. Maybe this is the problem? Still > >>>>>>>> the > >>>>>>>> > >>>>>>>> file size is not very large. > >>>>>>>> 2. The file encoding is ANSI, but I'm not specifying that in the > >>>>>>>> > >>>>>>>> function. Setting fileEncoding="ANSI" produces an "unsupported > >>>>>>>> conversion" > >>>>>>>> error > >>>>>>>> 3. readLines imports the lines quickly > >>>>>>>> 4. scan imports the file quickly also > >>>>>>>> > >>>>>>>> > >>>>>>>> Obviously, scan and readLines would require more coding to identify > >>>>>>>> columns, etc. > >>>>>>>> > >>>>>>>> my code: > >>>>>>>> system.time(dat <- read.table('C:/test.txt', nrows=-1, sep='\t', > >>>>>>>> header=TRUE)) > >>>>>>>> > >>>>>>>> It's taking 33.4 seconds and the file size is only 315 kb! > >>>>>>>> > >>>>>>>> Thanks > >>>>>>>> > >>>>>>>> Gene > >>>>>>>> > >>>>>>>> [[alternative HTML version deleted]] > >>>>>>>> > >>>>>>>> ______________________________________________ > >>>>>>>> R-help at 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 code. > >>>>>>>> > >>>>>>> > >>>>>>> > >>>>>> > >>>>> > >>>> > >>>> [[alternative HTML version deleted]] > >>>> > >>>> ______________________________________________ > >>>> R-help at 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 code. > >>> > >>> -- > >>> Peter Dalgaard, Professor, > >>> Center for Statistics, Copenhagen Business School > >>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark > >>> Phone: (+45)38153501 > >>> Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >> > >> ______________________________________________ > >> R-help at 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 code. > >> > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > ______________________________________________ > R-help at 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 code. From r.m.krug at gmail.com Thu Dec 8 09:57:43 2011 From: r.m.krug at gmail.com (Rainer M Krug) Date: Thu, 08 Dec 2011 09:57:43 +0100 Subject: [R] Create checkpoint - was: How to de-source and re-source a file? In-Reply-To: References: Message-ID: <4EE07C07.4040804@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/12/11 21:27, Roebuck,Paul L wrote: > So create a checkpoint... > > > -----------------------------myfile.R--------------------------------- > > checkpoint.file <- "checkpoint_appname.RData" > if (!file.exists(checkpoint.file) { ## Do compute intensive > processing... { my.seed <- 1234 ans <- long.comp( my.seed) } > objects2save <- c("ans", "my.seed") save(list=objects2save, > file=checkpoint.file) } else { load(checkpoint.file) } browser() > ... > > ----------------------------------------------------------------------- Nice > idea - like it. I am going to use it in my next simulation. As the simulation is starting from a vanilla R session, I am going to use save.image() to save the complete workspace. Am I right in assuming, that everything in my workspace gets saved, and if I want to start off from this checkpoint, I have to 1) load all packages again 2) load() the workspace as saved by save.image() 3) and voil?, I can continue? Or is there anything which will *not* be restored with an approach like this (assuming a S3 and S4 classes etc.)? Cheers, Rainer > > > On 12/6/11 12:44 PM, "Michael" wrote: > >> the problem with restarting R is that I then have to re-execute >> the program until the point where I wanted to debug, which is a >> very long-waiting time... >> >> On Tue, Dec 6, 2011 at 12:17 PM, Duncan Murdoch >> wrote: >> >>> On 06/12/2011 1:10 PM, Michael wrote: >>> >>>> i.e. how to make sure the function that was loaded into >>>> workspace/memory is the version that I edited latest... not >>>> some stale version... >>>> >>>> This might solve some of my breakpoint and browser/debug >>>> problem, even the RStudio problem that I've met.... >>>> >>> >>> You can use rm() to remove a function. >>> >>> You can also quit and restart R, making sure that it *does not* >>> load an existing workspace (by deleting the .Rdata file if it >>> exists, and never answering "yes" to the question to save it.) >>> This gives you a nice clean slate. >>> >>> Duncan Murdoch >>> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ R-help at 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 code. - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7gfAcACgkQoYgNqgF2egqDiwCcDlZrtLf9xRhsKx7N41y0fD7q E4EAnj0WO9lWCfyshTmIBYGYeH31TgCp =oJNS -----END PGP SIGNATURE----- From aidan.corcoran11 at gmail.com Thu Dec 8 10:00:09 2011 From: aidan.corcoran11 at gmail.com (Aidan Corcoran) Date: Thu, 8 Dec 2011 09:00:09 +0000 Subject: [R] running texi2dvi without running bibtex In-Reply-To: <4EDFC777.80606@gmail.com> References: <4EDF82B6.3040106@gmail.com> <4EDFC777.80606@gmail.com> Message-ID: Hi Duncan, I think you're right. I should have read the texi2dvi help more carefully - it says Run latex and bibtex until all cross-references are resolved and create either a dvi or PDF file. there doesn't seem to be a way to not run bibtex. But as you suggested, all I have to do is system("pdflatex onepager.tex") (I didn't know about this system command before you mentioned it). thanks for your help! Aidan On Wed, Dec 7, 2011 at 8:07 PM, Duncan Murdoch wrote: > On 07/12/2011 12:24 PM, Aidan Corcoran wrote: >> >> Hi Duncan, >> >> thanks for your help. Unfortunately >> >> ? texi2dvi("onepager", pdf = TRUE, texi2dvi = "pdflatex") >> >> seems to run into the same issue. I searched the documentation as you >> suggested (http://docs.miktex.org/2.9/manual/pdftex.html) and also >> checked pdflatex --help, but can't find a command line option to >> prevent the bibtex call. I think there should be one, since it's an >> option in texniccenter, but I guess this is now a latex not an r >> question (although I'm not sure exactly where I would put the command >> line option in the texi2dvi call above). If I can't find a way to do >> it then I'll take the batch approach as you suggested. > > > I suspect it's a different problem: ?pdflatex shouldn't run bibtex. ?But who > knows what MikTeX might choose to do... > > Duncan Murdoch > > >> Thanks again! >> >> Aidan >> >> >> >> I know texniccenter has an option to not run bibtex when calling >> pdflatex, but this is a tick box so I can?t find out what the command >> line option is from there. >> >> On Wed, Dec 7, 2011 at 3:13 PM, Duncan Murdoch >> ?wrote: >> > ?On 07/12/2011 6:47 AM, Aidan Corcoran wrote: >> >> >> >> ?Dear all, >> >> >> >> ?I was hoping someone may know a way of running texi2dvi while ignoring >> >> ?bibtex errors, or any other work around (such as not running bibtex at >> >> ?all, if possible). >> >> >> >> ?The context is that I have an R program that does some calculations >> >> ?and writes a table into various folders, one per country for several >> >> ?countries. I have a latex file that takes the table as an input, and >> >> ?this latex file is copied into each folder. I would like to use R to >> >> ?compile the latex files, to avoid having to open and compile them >> >> ?individually. The files are simple one page files with no citations, >> >> ?so need no biblio. >> >> >> >> ?If I switch to one of the folders containing a table and a latex file >> >> and >> >> ?run >> >> ? ?texi2dvi("onepager", pdf = TRUE, clean = FALSE, quiet = FALSE, >> >> ? ? ? ? ? texi2dvi = getOption("texi2dvi"), >> >> ? ? ? ? ? texinputs = NULL, index = TRUE) >> >> ?I get >> >> ? running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" >> >> ?--pdf "onepager" ?-I "C:/PROGRA~1/R/R-213~1.0/share/texmf/tex/latex" >> >> ?-I "C:/PROGRA~1/R/R-213~1.0/share/texmf/bibtex/bst"' had status 1 >> >> ?and no pdf produced. >> >> >> >> ?I think the problem is that the absence of a biblio causes an error. >> >> ?The files compile in Texniccenter (with a warning on "no \citation >> >> ?commands" etc). Does anyone know of a trick to avoid this problem? >> >> >> >> ?Thanks very much for any help! >> > >> > >> > ?You might want to check the MikTeX documentation to see if there's an >> > option >> > ?to do that, but I couldn't spot one listed in "texi2dvi --help". ?So >> > I'd >> > ?suggest that you don't use the texi2dvi executable, just run pdflatex >> > via >> > >> > ?texi2dvi("onepager", texi2dvi="pdflatex", ...) >> > >> > ?(or by setting the texi2dvi option) with the ... being appropriate >> > other >> > ?commands. ?If that doesn't work, then write a batch or cmd file to do >> > ?exactly what you want, and use system() to run it. >> > >> > ?Duncan Murdoch > > From r.m.krug at gmail.com Thu Dec 8 10:06:03 2011 From: r.m.krug at gmail.com (Rainer M Krug) Date: Thu, 08 Dec 2011 10:06:03 +0100 Subject: [R] read.table performance In-Reply-To: References: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> Message-ID: <4EE07DFB.7010309@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 08/12/11 09:32, Petr PIKAL wrote: > Hi > >> system.time(dat<-read.table("test2.txt")) > user system elapsed 32.38 0.00 32.40 > >> system.time(dat <- read.table('test2.txt', nrows=-1, sep='\t', > header=TRUE)) user system elapsed 32.30 0.03 32.36 > > Couldn't.it be a Windows issue? Likely - here on Linux I get: > system.time(dat <- read.table('tmp/test2.txt', nrows=-1, sep='\t', header=TRUE)) user system elapsed 1.560 0.000 1.579 > sessionInfo() R version 2.14.0 (2011-10-31) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base > version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 14.0 year 2011 month 10 day 31 svn rev 57496 language R version.string R version 2.14.0 (2011-10-31) > Cheers, Rainer > _ platform i386-pc-mingw32 arch i386 os > mingw32 system i386, mingw32 status Under > development (unstable) major 2 minor 14.0 year > 2011 month 04 day 27 svn rev 55657 > language R version.string R version 2.14.0 Under development > (unstable) (2011-04-27 r55657) >> > > >> dim(dat) > [1] 7 3765 >> > > But from the dat file it seems to me that its structure is somehow > weird. > >> head(names(dat)) > [1] "X..Hydrogen" "Helium" "Lithium" "Beryllium" "Boron" > [6] "Carbon" >> tail(names(dat)) > [1] "Sulfur.32" "Chlorine.32" "Argon.32" "Potassium.32" > "Calcium.32" [6] "Scandium.32" >> > > There is row of names which has repeating values. Maybe the most > time is spent by checking the names validity. > > Regards Petr > > r-help-bounces at r-project.org napsal dne 07.12.2011 23:11:10: > >> peter dalgaard Odeslal: >> r-help-bounces at r-project.org >> >> 07.12.2011 23:11 >> >> Komu >> >> "R. Michael Weylandt" >> >> Kopie >> >> r-help at r-project.org, Gene Leynes >> >> P?edm?t >> >> Re: [R] read.table performance >> >> >> On Dec 7, 2011, at 22:37 , R. Michael Weylandt wrote: >> >>> R 2.13.2 on Mac OS X 10.5.8 takes about 1.8s to read the file >>> verbatim: system.time(read.table("test2.txt")) >> >> About 2.3s with 2.14 on a 1.86 GHz MacBook Air 10.6.8. >> >> Gene, are you by any chance storing the file in a heavily >> virus-scanned system directory? >> >> -pd >> >>> Michael >>> >>> 2011/12/7 Gene Leynes : >>>> Peter, >>>> >>>> You're quite right; it's nearly impossible to make progress >>>> without a working example. >>>> >>>> I created an ** extremely simplified ** example for >>>> distribution. The > real >>>> data has numeric, character, and boolean classes. >>>> >>>> The file still takes 25.08 seconds to read, despite it's >>>> small size. >>>> >>>> I neglected to mention that I'm using R 2.13.0 and I"m on a >>>> windows 7 machine (not that it should particularly matter >>>> with this type of > data / >>>> functions). >>>> >>>> ## The code: options(stringsAsFactors=FALSE) system.time(dat >>>> <- read.table('test2.txt', nrows=-1, sep='\t', > header=TRUE)) >>>> str(dat, 0) >>>> >>>> >>>> Thanks again! >>>> >>>> >>>> >>>> On Wed, Dec 7, 2011 at 1:21 AM, peter dalgaard >>>> > wrote: >>>> >>>>> >>>>> On Dec 6, 2011, at 22:33 , Gene Leynes wrote: >>>>> >>>>>> Mark, >>>>>> >>>>>> Thanks for your suggestions. >>>>>> >>>>>> That's a good idea about the NULL columns; I didn't think >>>>>> of that. Surprisingly, it didn't have any effect on the >>>>>> time. >>>>> >>>>> Hmm, I think you want "character" and "NULL" there (i.e., >>>>> quoted). > Did you >>>>> fix both? >>>>> >>>>>>> read.table(whatever, as.is=TRUE, colClasses = >>>>>>> c(rep(character,4), rep(NULL,3696)). >>>>> >>>>> As a general matter, if you want people to dig into this, >>>>> they need > some >>>>> paraphrase of the file to play with. Would it be possible >>>>> to set up > a small >>>>> R program that generates a data file which displays the >>>>> issue? > Everything I >>>>> try seems to take about a second to read in. >>>>> >>>>> -pd >>>>> >>>>>> >>>>>> This problem was just a curiosity, I already did the >>>>>> import using > Excel >>>>> and >>>>>> VBA. I was just going to illustrate the power and >>>>>> simplicity of R, > but >>>>> it >>>>>> ironically it's been much slower and harder in R... The >>>>>> VBA was painful and messy, and took me over an hour to >>>>>> write; > but at >>>>>> least it worked quickly and reliably. The R code was >>>>>> clean and only took me about 5 minutes to write, but > the >>>>> run >>>>>> time was prohibitively slow! >>>>>> >>>>>> I profiled the code, but that offers little insight to >>>>>> me. >>>>>> >>>>>> Profile results with 10 line file: >>>>>> >>>>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>>>> $by.self self.time self.pct total.time total.pct scan >>>>>> 12.24 53.50 12.24 53.50 read.table >>>>>> 10.58 46.24 22.88 100.00 type.convert >>>>>> 0.04 0.17 0.04 0.17 make.names 0.02 >>>>>> 0.09 0.02 0.09 >>>>>> >>>>>> $by.total total.time total.pct self.time self.pct >>>>>> read.table 22.88 100.00 10.58 46.24 scan >>>>>> 12.24 53.50 12.24 53.50 type.convert >>>>>> 0.04 0.17 0.04 0.17 make.names 0.02 >>>>>> 0.09 0.02 0.09 >>>>>> >>>>>> $sample.interval [1] 0.02 >>>>>> >>>>>> $sampling.time [1] 22.88 >>>>>> >>>>>> >>>>>> Profile results with 250 line file: >>>>>> >>>>>>> summaryRprof("C:/Users/gene.leynes/Desktop/test.out") >>>>>> $by.self self.time self.pct total.time total.pct scan >>>>>> 23.88 68.15 23.88 68.15 read.table >>>>>> 10.78 30.76 35.04 100.00 type.convert >>>>>> 0.30 0.86 0.32 0.91 character 0.02 >>>>>> 0.06 0.02 0.06 file 0.02 0.06 >>>>>> 0.02 0.06 lapply 0.02 0.06 0.02 >>>>>> 0.06 unlist 0.02 0.06 0.02 >>>>>> 0.06 >>>>>> >>>>>> $by.total total.time total.pct self.time self.pct >>>>>> read.table 35.04 100.00 10.78 30.76 >>>>>> scan 23.88 68.15 23.88 68.15 >>>>>> type.convert 0.32 0.91 0.30 0.86 >>>>>> sapply 0.04 0.11 0.00 0.00 >>>>>> character 0.02 0.06 0.02 0.06 >>>>>> file 0.02 0.06 0.02 0.06 >>>>>> lapply 0.02 0.06 0.02 0.06 >>>>>> unlist 0.02 0.06 0.02 0.06 >>>>>> simplify2array 0.02 0.06 0.00 0.00 >>>>>> >>>>>> $sample.interval [1] 0.02 >>>>>> >>>>>> $sampling.time [1] 35.04 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Dec 6, 2011 at 2:34 PM, Mark Leeds >>>>>> > wrote: >>>>>> >>>>>>> hi gene: maybe someone else will reply with some >>>>>>> subtleties that > I'm >>>>> not >>>>>>> aware of. one other thing that might help: if you know >>>>>>> which columns you want , you can set > the >>>>>>> others to NULL through colClasses and this should speed >>>>>>> things up also. For example, say > you >>>>> knew >>>>>>> you only wanted the first four columns and they were >>>>>>> character. then you could do, >>>>>>> >>>>>>> read.table(whatever, as.is=TRUE, colClasses = >>>>>>> c(rep(character,4), rep(NULL,3696)). >>>>>>> >>>>>>> hopefully someone else will say something that does the >>>>>>> trick. it > seems >>>>>>> odd to me as far as the difference in timings ? good >>>>>>> luck. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, Dec 6, 2011 at 1:55 PM, Gene Leynes >>>>>>> > wrote: >>>>>>> >>>>>>>> Mark, >>>>>>>> >>>>>>>> Thank you for the reply >>>>>>>> >>>>>>>> I neglected to mention that I had already set >>>>>>>> options(stringsAsFactors=FALSE) >>>>>>>> >>>>>>>> I agree, skipping the factor determination can help >>>>>>>> performance. >>>>>>>> >>>>>>>> The main reason that I wanted to use read.table is >>>>>>>> because it > will >>>>>>>> correctly determine the column classes for me. I >>>>>>>> don't really > want to >>>>>>>> specify 3700 column classes! (I'm not sure what they >>>>>>>> are > anyway). >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Dec 6, 2011 at 12:40 PM, Mark Leeds > >>>>> wrote: >>>>>>>> >>>>>>>>> Hi Gene: Sometimes using colClasses in read.table >>>>>>>>> can speed > things up. >>>>>>>>> If you know what your variables are ahead of time >>>>>>>>> and what you > want >>>>> them to >>>>>>>>> be, this allows you to be specific by specifying, >>>>>>>>> character or >>>>> numeric, >>>>>>>>> etc and often it makes things faster. others will >>>>>>>>> have more to > say. >>>>>>>>> >>>>>>>>> also, if most of your variables are characters, R >>>>>>>>> will try to > turn >>>>>>>>> convert them into factors by default. If you use >>>>>>>>> as.is = TRUE it >>>>> won't >>>>>>>>> do this and that might speed things up also. >>>>>>>>> >>>>>>>>> >>>>>>>>> Rejoinder: above tidbits are just from >>>>>>>>> experience. I don't > know if >>>>>>>>> it's in stone or a hard and fast rule. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, Dec 6, 2011 at 1:15 PM, Gene Leynes >>>>>>>>> >>>>> wrote: >>>>>>>>> >>>>>>>>>> ** Disclaimer: I'm looking for general >>>>>>>>>> suggestions ** I'm sorry, but can't send out the >>>>>>>>>> file I'm using, so there is > no >>>>>>>>>> reproducible example. >>>>>>>>>> >>>>>>>>>> I'm using read.table and it's taking over 30 >>>>>>>>>> seconds to read a > tiny >>>>>>>>>> file. The strange thing is that it takes roughly >>>>>>>>>> the same amount of > time if >>>>>>>>>> the file is 100 times larger. >>>>>>>>>> >>>>>>>>>> After re-reviewing the data Import / Export >>>>>>>>>> manual I think the > best >>>>>>>>>> approach would be to use Python, or perhaps the >>>>>>>>>> readLines > function, >>>>> but >>>>>>>>>> I was hoping to understand why the simple >>>>>>>>>> read.table approach > wasn't >>>>>>>>>> working as expected. >>>>>>>>>> >>>>>>>>>> Some relevant facts: >>>>>>>>>> >>>>>>>>>> 1. There are about 3700 columns. Maybe this is >>>>>>>>>> the problem? > Still >>>>>>>>>> the >>>>>>>>>> >>>>>>>>>> file size is not very large. 2. The file encoding >>>>>>>>>> is ANSI, but I'm not specifying that in > the >>>>>>>>>> >>>>>>>>>> function. Setting fileEncoding="ANSI" produces >>>>>>>>>> an > "unsupported >>>>>>>>>> conversion" error 3. readLines imports the lines >>>>>>>>>> quickly 4. scan imports the file quickly also >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Obviously, scan and readLines would require more >>>>>>>>>> coding to > identify >>>>>>>>>> columns, etc. >>>>>>>>>> >>>>>>>>>> my code: system.time(dat <- >>>>>>>>>> read.table('C:/test.txt', nrows=-1, > sep='\t', >>>>>>>>>> header=TRUE)) >>>>>>>>>> >>>>>>>>>> It's taking 33.4 seconds and the file size is >>>>>>>>>> only 315 kb! >>>>>>>>>> >>>>>>>>>> Thanks >>>>>>>>>> >>>>>>>>>> Gene >>>>>>>>>> >>>>>>>>>> [[alternative HTML version deleted]] >>>>>>>>>> >>>>>>>>>> ______________________________________________ >>>>>>>>>> R-help at 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 > code. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> [[alternative HTML version deleted]] >>>>>> >>>>>> ______________________________________________ >>>>>> R-help at 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 code. >>>>> >>>>> -- Peter Dalgaard, Professor, Center for Statistics, >>>>> Copenhagen Business School Solbjerg Plads 3, 2000 >>>>> Frederiksberg, Denmark Phone: (+45)38153501 Email: >>>>> pd.mes at cbs.dk Priv: PDalgd at gmail.com >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> ______________________________________________ >>>> R-help at 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 >>>> code. >>>> >> >> -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen >> Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark >> Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: >> PDalgd at gmail.com >> >> ______________________________________________ >> R-help at 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 >> code. > > ______________________________________________ R-help at 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 code. - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7gffsACgkQoYgNqgF2egpNpACeLbyAXB1pLGgyt7hAE7QAWe9i uV0An1Z8tvGw/1+40JM6YSe3aDqQoRkh =/mB7 -----END PGP SIGNATURE----- From r.m.krug at gmail.com Thu Dec 8 10:07:28 2011 From: r.m.krug at gmail.com (Rainer M Krug) Date: Thu, 8 Dec 2011 10:07:28 +0100 Subject: [R] nice time series viewer? In-Reply-To: References: Message-ID: <4EE07E50.4090903@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/12/11 20:31, R. Michael Weylandt wrote: > plot.xts() > > chartSeries() if you are using financial data? > > It's going to depend on your (unstated) form of time series, but > generally R isn't set up for interactive graphics. (chartSeries > being the only time-series specific exception I know; you can also > do Rgl and Rggobi stuff with a little bit of work) There is also iplot and ix - also very nice interactive graph packages, but as far as I know not specific to time series. Rainer > > Also, please don't cross post to two lists. > > Michael > > On Wed, Dec 7, 2011 at 2:15 PM, Michael > wrote: >> Hi all, >> >> I am looking for a nice time series grapher/viewer in R ... with >> the feature of scrolling, zooming, etc. >> >> Hopefully it could be of the quality at the >> report-generation-and-sending-to-boss level... >> >> Could anybody please give me some recommendations/pointers? >> >> Thanks a lot! >> >> ______________________________________________ >> R-help at 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 code. > > ______________________________________________ R-help at 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 code. - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7gflAACgkQoYgNqgF2egpPygCcDO98cjlJFWzQBBMEGuI4/GbG kM8An25wZVFPtJ8FZAYKUMKwEMQeaqWU =k5Lt -----END PGP SIGNATURE----- From bia.cdc at gmail.com Thu Dec 8 08:57:04 2011 From: bia.cdc at gmail.com (bcdc) Date: Wed, 7 Dec 2011 23:57:04 -0800 (PST) Subject: [R] reading partial data set In-Reply-To: References: <1323269529129-4169210.post@n4.nabble.com> Message-ID: <1323331024704-4171885.post@n4.nabble.com> Thank you! -- View this message in context: http://r.789695.n4.nabble.com/reading-partial-data-set-tp4169210p4171885.html Sent from the R help mailing list archive at Nabble.com. From mohammadianalimohammadian at gmail.com Thu Dec 8 09:12:04 2011 From: mohammadianalimohammadian at gmail.com (ali_protocol) Date: Thu, 8 Dec 2011 00:12:04 -0800 (PST) Subject: [R] span and epsilon in Cyclic loess Message-ID: <1323331924598-4171916.post@n4.nabble.com> Hi everyone, Is there any automated method to optimize span and epsilon in cyclic loess normalization? I'm using cyclic loess normalization for an array with <1000 genes. Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/span-and-epsilon-in-Cyclic-loess-tp4171916p4171916.html Sent from the R help mailing list archive at Nabble.com. From tal.galili at gmail.com Thu Dec 8 11:49:42 2011 From: tal.galili at gmail.com (Tal Galili) Date: Thu, 8 Dec 2011 12:49:42 +0200 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From jim at bitwrit.com.au Thu Dec 8 12:18:57 2011 From: jim at bitwrit.com.au (Jim Lemon) Date: Thu, 08 Dec 2011 22:18:57 +1100 Subject: [R] Hinton Diagram for a matrix of weights In-Reply-To: <20111207164459.GA6069@deu.xfim> References: <20111207164459.GA6069@deu.xfim> Message-ID: <4EE09D21.3020304@bitwrit.com.au> On 12/08/2011 03:45 AM, Xavier Fern?ndez i Mar?n wrote: > Hello, > > Although I have used a general search engine, r-seek, and browsed CRAN for > contributed packages and R Gallery, I have not been able to find an > implementation of Hinton Diagrams for representing weighting matrices using > R. > > Does anyone knows a way of plotting weighting matrices in R? > Hi Xavier, The Hinton diagram looks fairly close to an image plot, or the color2D.matplot function. The difference is that the area of the squares in the Hinton plot are proportional to some value rather than the color, which indicates the sign of the value. If you have no luck finding this, I think I could easily morph color2D.matplot into a Hinton diagram function. Jim From jim at bitwrit.com.au Thu Dec 8 12:22:40 2011 From: jim at bitwrit.com.au (Jim Lemon) Date: Thu, 08 Dec 2011 22:22:40 +1100 Subject: [R] How to scale arrows to approximately fill a plot region? In-Reply-To: <4EDFA7F4.1050104@yorku.ca> References: <4EDFA7F4.1050104@yorku.ca> Message-ID: <4EE09E00.3000701@bitwrit.com.au> On 12/08/2011 04:52 AM, Michael Friendly wrote: > In a variety of graphic applications, I plot some data, together with > arrows representing variables > or linear transformations of variables as vectors in the same space, as > in a biplot. > > In my applications, the scale of the arrows is arbitrary -- all that > matters is relative length. > I'd like to blow them up or shrink them to fit the available space in > the plot. > The origin is typically at some mean for (x,y), but that is not > necessarily so. > There must be some general, perhaps approximate solution for this problem, > but I can't see it. > > Below is a simple test case. I found the approximate solution, scale <- > 14 by trial and error. > [I'm ignoring aspect ratio, because that determines the bbox I calculate > from the plot.] > > > set.seed(123135251) > x <- 2 + 5* rnorm(50) > y <- 5 + 2* rnorm(50) > plot(x,y) > > # get bounding box of plot region, in data coordinates > bbox <- matrix(par("usr"), 2, 2, dimnames=list(c("min", "max"),c("x", > "y"))) > # center vectors here > origin <- colMeans(bbox) > points(origin[1], origin[2], pch=16, cex=2) > > # vectors to be displayed in this space > vectors <- cbind( runif(5), (runif(5)-.5)) > > # draw arrows, given origin and length in xy > Arrows <- function(xy, lenxy, length=.1, angle=10, ...) { > arrows(xy[1], xy[2], xy[1]+lenxy[,1], xy[2]+lenxy[,2], length=length, > angle=angle, ...) > } > > ## How to determine scale so that vectors ~ fill the bounding box??? > scale <- 14 > Arrows(origin, scale*vectors) > > Hi Michael, Have a look at the vectorField (plotrix) function. This scales the arrows to the unit cells in the plot, so it's trivial to change the code in the bottom half of the function to scale to the entire plot. Jim From jefferis at mrc-lmb.cam.ac.uk Thu Dec 8 13:14:11 2011 From: jefferis at mrc-lmb.cam.ac.uk (Dr Gregory Jefferis) Date: Thu, 8 Dec 2011 12:14:11 +0000 Subject: [R] Read Windows BMP format images In-Reply-To: <7DB1296C-D2B5-4B8B-825F-C53C8C66212C@mrc-lmb.cam.ac.uk> References: <7DB1296C-D2B5-4B8B-825F-C53C8C66212C@mrc-lmb.cam.ac.uk> Message-ID: <0E6A5649-4687-4EBC-B95E-551E115D51FA@mrc-lmb.cam.ac.uk> Answering my own question in case it is of help to anyone else in future: On 6 Dec 2011, at 09:20, Dr Gregory Jefferis wrote: > Does anyone know of an R package that can read Windows BMP format images? Many thanks, http://www.bioconductor.org/packages/release/bioc/html/EBImage.html https://github.com/jefferis/bmp EBimage appears to be the best (and very mature) solution that does a great deal else besides, but I had trouble with the ImageMagick dependency on one of the machines that I was targeting. The bmp package is just something that I hacked together quickly in pure R (no external dependencies). Best, Greg. -- Gregory Jefferis, PhD Division of Neurobiology MRC Laboratory of Molecular Biology, Hills Road, Cambridge, CB2 0QH, UK. http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2 http://flybrain.stanford.edu From jvadams at usgs.gov Thu Dec 8 13:21:13 2011 From: jvadams at usgs.gov (Jean V Adams) Date: Thu, 8 Dec 2011 06:21:13 -0600 Subject: [R] partial duplicates of dataframe rows, indexing and removal In-Reply-To: <1323311041598-4171322.post@n4.nabble.com> References: <1323311041598-4171322.post@n4.nabble.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From economics.vikram at gmail.com Thu Dec 8 13:25:04 2011 From: economics.vikram at gmail.com (Vikram Bahure) Date: Thu, 8 Dec 2011 17:55:04 +0530 Subject: [R] matching using "which" Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From djandrija at gmail.com Thu Dec 8 13:42:30 2011 From: djandrija at gmail.com (andrija djurovic) Date: Thu, 8 Dec 2011 13:42:30 +0100 Subject: [R] matching using "which" In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From djandrija at gmail.com Thu Dec 8 15:15:40 2011 From: djandrija at gmail.com (andrija djurovic) Date: Thu, 8 Dec 2011 15:15:40 +0100 Subject: [R] sum of deviations from the weighted mean Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 8 15:20:50 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt ) Date: Thu, 8 Dec 2011 09:20:50 -0500 Subject: [R] sum of deviations from the weighted mean In-Reply-To: References: Message-ID: R FAQ 7.31 I'd imagine. (Floating point arithmetic and limitations thereof) Michael On Dec 8, 2011, at 9:15 AM, andrija djurovic wrote: > Hi all. I tried to calculate sum of deviations from the weighted mean and i > didn't get what i expected - 0. Here is an example: > >> wt <- c(10,25,38,22,5) >> x <- 6:10 >> wm <- weighted.mean(x,wt) >> (x-wm)*wt > [1] -18.70 -21.75 4.94 24.86 10.65 >> sum((x-wm)*wt) > [1] -1.24345e-14 > > With simple mean I got 0: >> sum(x-mean(x)) > [1] 0 > > Could someone explain me why we didn't get 0, with weighted mean, as it is > expected? > Thanks in advance > > Andrija > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From S.J.Eglen at damtp.cam.ac.uk Thu Dec 8 15:22:05 2011 From: S.J.Eglen at damtp.cam.ac.uk (Stephen Eglen) Date: Thu, 08 Dec 2011 14:22:05 +0000 Subject: [R] Representation of scientific units Message-ID: Has anyone got a neat way in R to handle scientific units along with numeric vectors? e.g. in mathematica, there is a Units package to allow you to do the following: 85 Meter/Second * 10 Second answer: 850 Meter (taken from http://library.wolfram.com/howtos/units/) Thanks, Stephen From filipe.ferminiano at gmail.com Thu Dec 8 11:42:47 2011 From: filipe.ferminiano at gmail.com (Filipe Ferminiano Rodrigues) Date: Thu, 8 Dec 2011 08:42:47 -0200 Subject: [R] rjags in a Windows 7 64 bits machine Message-ID: Um texto embutido e sem conjunto de caracteres especificado foi limpo... Nome: n?o dispon?vel Url: From richardtoss at hotmail.com Thu Dec 8 14:32:35 2011 From: richardtoss at hotmail.com (RToss) Date: Thu, 8 Dec 2011 05:32:35 -0800 (PST) Subject: [R] Whites test Message-ID: <1323351155720-4172741.post@n4.nabble.com> Hi all! I am quite new to R, and therefore in the need for som help. I want to perform a Whites test for my OLS, how is this accomplished? Thanks a lot! /Richard -- View this message in context: http://r.789695.n4.nabble.com/Whites-test-tp4172741p4172741.html Sent from the R help mailing list archive at Nabble.com. From matematik.istatistik at gmail.com Thu Dec 8 14:51:58 2011 From: matematik.istatistik at gmail.com (MATEMATIK ISTATISTIK) Date: Thu, 8 Dec 2011 15:51:58 +0200 Subject: [R] help about Hannan-Rissanen model selection Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From djandrija at gmail.com Thu Dec 8 15:28:45 2011 From: djandrija at gmail.com (andrija djurovic) Date: Thu, 8 Dec 2011 15:28:45 +0100 Subject: [R] sum of deviations from the weighted mean In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From pdalgd at gmail.com Thu Dec 8 15:42:04 2011 From: pdalgd at gmail.com (peter dalgaard) Date: Thu, 8 Dec 2011 15:42:04 +0100 Subject: [R] Whites test In-Reply-To: <1323351155720-4172741.post@n4.nabble.com> References: <1323351155720-4172741.post@n4.nabble.com> Message-ID: <9865B2CB-0F8C-4BA9-B21B-2AD40EFB939B@gmail.com> On Dec 8, 2011, at 14:32 , RToss wrote: > Hi all! > > I am quite new to R, and therefore in the need for som help. > I want to perform a Whites test for my OLS, how is this accomplished? > > Thanks a lot! > > /Richard > Seems that there is a white.test in the bstats package. (And also a bp.test which might be a better idea if there is a sizable number of predictors.) -- Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com From pd.mes at cbs.dk Thu Dec 8 15:30:26 2011 From: pd.mes at cbs.dk (Peter Dalgaard) Date: Thu, 8 Dec 2011 15:30:26 +0100 Subject: [R] R 2.14.1 scheduled for December 22 Message-ID: <67151BB7-6F13-42BC-92C2-2AE4F3BFF136@cbs.dk> This is to announce that we plan to release R version 2.14.1 on Friday, December 22, 2011. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (barring build troubles) via http://cran.r-project.org/src/base-prerelease/ For the R Core Team Peter Dalgaard -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com _______________________________________________ R-announce at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-announce From Achim.Zeileis at uibk.ac.at Thu Dec 8 16:04:15 2011 From: Achim.Zeileis at uibk.ac.at (Achim Zeileis) Date: Thu, 8 Dec 2011 16:04:15 +0100 (CET) Subject: [R] Whites test In-Reply-To: <1323351155720-4172741.post@n4.nabble.com> References: <1323351155720-4172741.post@n4.nabble.com> Message-ID: On Thu, 8 Dec 2011, RToss wrote: > Hi all! > > I am quite new to R, and therefore in the need for som help. > I want to perform a Whites test for my OLS, how is this accomplished? You can use bptest() from the "lmtest" package and then supplying interactions and quadratic terms of all regressors for the auxiliary regression. See example("CigarettesB", package = "AER") for a worked example. Z > Thanks a lot! > > /Richard > > > -- > View this message in context: http://r.789695.n4.nabble.com/Whites-test-tp4172741p4172741.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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 code. > From ligges at statistik.tu-dortmund.de Thu Dec 8 16:05:58 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Thu, 08 Dec 2011 16:05:58 +0100 Subject: [R] rjags in a Windows 7 64 bits machine In-Reply-To: References: Message-ID: <4EE0D256.3040107@statistik.tu-dortmund.de> Works for me: Do you have the most recent Jags version? Is this 32-bit or 64-bit R? Uwe Ligges On 08.12.2011 11:42, Filipe Ferminiano Rodrigues wrote: > Hi. > I was trying to follow this rjags tutorial (example 1): > http://www.johnmyleswhite.com/notebook/2010/08/20/using-jags-in-r-with-the-rjags-package/comment-page-1/#comment-19468 > But when I try to run the following line in R, R crushes and close. > > jags<- jags.model('example1.bug', data = list('x' = x,'N' = N), > n.chains = 4, n.adapt = 100) > > I'm using a Windows 64 bits machine. I already tried to update to R last > version, but ocurred the same. > I tried in a Windows XP machine and worked well > Anyone can help me with this? > > > > ______________________________________________ > R-help at 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 code. From ligges at statistik.tu-dortmund.de Thu Dec 8 16:10:14 2011 From: ligges at statistik.tu-dortmund.de (Uwe Ligges) Date: Thu, 08 Dec 2011 16:10:14 +0100 Subject: [R] help about Hannan-Rissanen model selection In-Reply-To: References: Message-ID: <4EE0D356.7090002@statistik.tu-dortmund.de> Never ever cross post!!! On 08.12.2011 14:51, MATEMATIK ISTATISTIK wrote: > Dear all, > > I am sorry , I have not enough English or I am fool to understand the > helping system > > 1- if someone has written the code for Hannan-Rissanen model selection in > ARMA models, > > how can I find this R module or the code ? I just Googled for "Hannan-Rissanen R" and got several hits. > 2- I wrote the algorithm and the code for the Levy driven CARMA and COGARCH > models, > > could anybody check or verify that I have done? Given there is someone on the list who would be interested in reviewing it: you forgot to post it! > Best regards > > yours sincerely > > R-help at r-project.org,R-help-request at r-project.org,bioc-devel at r-project.org Interesting name you have.... Best, MATEMATIK ISTATISTIK > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From michael.weylandt at gmail.com Thu Dec 8 16:19:12 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 8 Dec 2011 10:19:12 -0500 Subject: [R] matching using "which" In-Reply-To: References: Message-ID: Here's one that is perhaps a little simpler: simply drop the which and use logical indexing. dat <- matrix(1:6, 2); colnames(dat) <- c("A","B","A") dat[, colnames(dat) %in% "A"] dat[, colnames(dat) %in% "B"] # Note that you may want drop = FALSE dat[, colnames(dat) %in% "C"] dat[, !(colnames(dat) %in% "A")] # Note that you may want drop = FALSE dat[, !(colnames(dat) %in% "B")] dat[, !(colnames(dat) %in% "C")] Michael On Thu, Dec 8, 2011 at 7:42 AM, andrija djurovic wrote: > Hi. Here is one approach: > > if (length(b)>0) data[,-b] else data > > Andrija > > On Thu, Dec 8, 2011 at 1:25 PM, Vikram Bahure wrote: > >> Dear R users, >> >> I have a very simple query. >> >> I am using the following command, which should give me row no. for the >> matching colnames. It works well for matching the colnames but if there is >> no column matching it gives me outcome as integer(0) which I am not able to >> use in further calculation. It would be very helpful to have some insight. >> * >> * >> *> b <- which(colnames(data)%in%c("X.","X"))* >> *> b* >> *integer(0)* >> *> b>0* >> *logical(0)* >> *>b<- data[,-b] ?# does not work properly* >> * >> * >> Regards >> Vikram >> >> ? ? ? ?[[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 code. >> > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From comtech.usa at gmail.com Thu Dec 8 16:24:52 2011 From: comtech.usa at gmail.com (Michael) Date: Thu, 8 Dec 2011 09:24:52 -0600 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From filipe.ferminiano at gmail.com Thu Dec 8 16:42:59 2011 From: filipe.ferminiano at gmail.com (Filipe Ferminiano Rodrigues) Date: Thu, 8 Dec 2011 13:42:59 -0200 Subject: [R] rjags in a Windows 7 64 bits machine In-Reply-To: <4EE0D256.3040107@statistik.tu-dortmund.de> References: <4EE0D256.3040107@statistik.tu-dortmund.de> Message-ID: Um texto embutido e sem conjunto de caracteres especificado foi limpo... Nome: n?o dispon?vel Url: From ml at z107.de Thu Dec 8 16:49:16 2011 From: ml at z107.de (smu) Date: Thu, 8 Dec 2011 16:49:16 +0100 Subject: [R] Date object and origin BC Message-ID: <20111208154916.GA5964@z107.de> hi everybody, is this intended behaviour? > x <- as.Date('0-01-01') > as.Date(as.character(x)) [1] "0-01-01" > a <- x - 365 > as.Date(a) [1] "-1-01-01" > as.Date(as.character(a)) Error in charToDate(x) : character string is not in a standard unambiguous format Is this a bug? I found this, while trying to convert dates stored as "months since -2-01-01 00:00:00". For the past I extracted this first_date string and converted my data using dates <- as.Date(x, origin=as.Date(first_date)) But this fails with -2-01-01 Any ideas how to solve this? thanks and best regards, Stefan From alaios at yahoo.com Thu Dec 8 16:52:30 2011 From: alaios at yahoo.com (Alaios) Date: Thu, 8 Dec 2011 07:52:30 -0800 (PST) Subject: [R] simple fit Message-ID: <1323359550.46989.YahooMailNeo@web120103.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From michael.weylandt at gmail.com Thu Dec 8 16:56:06 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 8 Dec 2011 10:56:06 -0500 Subject: [R] simple fit In-Reply-To: <1323359550.46989.YahooMailNeo@web120103.mail.ne1.yahoo.com> References: <1323359550.46989.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: Fit y-b without an intercept? (which you do by adding "+ 0" or "- 1" to the model formula) Not sure if this is the optimal result, but it will give you a pretty reasonable answer. Michael On Thu, Dec 8, 2011 at 10:52 AM, Alaios wrote: > Dear all, > ?I have a formula of the form > y=ax+b > I know everything except b. How I can ask R to do fitting to find only the value of b? > I already know the lm() but it always return both an intercept point (b) and the a. > > What should I do ? > > I would like to thank you in advance for your help > > B.R > Alex > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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 code. > From dwinsemius at comcast.net Thu Dec 8 16:57:17 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 8 Dec 2011 10:57:17 -0500 Subject: [R] Representation of scientific units In-Reply-To: References: Message-ID: <0FA29A23-A587-463D-B545-3392117FA469@comcast.net> On Dec 8, 2011, at 9:22 AM, Stephen Eglen wrote: > Has anyone got a neat way in R to handle scientific units along with > numeric > vectors? Not really. There is limited support for conversions as well. I have wondered about this after addressing a similar question on Stack Overflow: http://stackoverflow.com/questions/7214781/converting-units-in-r/7215430#7215430 > e.g. in mathematica, there is a Units package to allow you to > do the following: > > 85 Meter/Second * 10 Second > > answer: 850 Meter As a program that was originally design to symbolic algebra it is not surprising to find such methods in Mathematica. I have looked around for examples of implementations in other languages and have found them in LisP and in PERL http://www.cs.utexas.edu/users/novak/units.html http://search.cpan.org/~klortho/Physics-Unit-0.04/lib/Physics/Unit.pm > > (taken from http://library.wolfram.com/howtos/units/) -- David Winsemius, MD West Hartford, CT From ccquant at gmail.com Thu Dec 8 17:37:40 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 8 Dec 2011 09:37:40 -0700 Subject: [R] R on the cloud - Windows to Linux In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From armstrong.whit at gmail.com Thu Dec 8 17:44:59 2011 From: armstrong.whit at gmail.com (Whit Armstrong) Date: Thu, 8 Dec 2011 11:44:59 -0500 Subject: [R] R on the cloud - Windows to Linux In-Reply-To: References: Message-ID: > I don't know where to start because, it looks like rzmq is not available for > Windows and it looks like AWS.tools and deathstar depend on rzmq, so by Hence my reference to work. patches welcome. > Will using a > local Windows box continue to be an issue as I progress with R and EC2? I've > run into several hurdles already, including some that are not associated > with the cloud. My opinion only, but if you want to use big data and hpc, then use linux. If you move your data into s3, you can simply boot up a micro linux instance in the cloud and do your development there (I think usage of a micro instance is free w/ a new AWS account). If you have local linux servers available, then even better. -Whit From rmh at temple.edu Thu Dec 8 17:51:41 2011 From: rmh at temple.edu (Richard M. Heiberger) Date: Thu, 8 Dec 2011 11:51:41 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kindlychung at gmail.com Thu Dec 8 17:59:52 2011 From: kindlychung at gmail.com (Kaiyin Zhong) Date: Fri, 9 Dec 2011 00:59:52 +0800 Subject: [R] How to plot multiple graphs in one go? Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rmh at temple.edu Thu Dec 8 18:01:02 2011 From: rmh at temple.edu (Richard M. Heiberger) Date: Thu, 8 Dec 2011 12:01:02 -0500 Subject: [R] Representation of scientific units In-Reply-To: <0FA29A23-A587-463D-B545-3392117FA469@comcast.net> References: <0FA29A23-A587-463D-B545-3392117FA469@comcast.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From lutzda at wfu.edu Thu Dec 8 16:29:15 2011 From: lutzda at wfu.edu (David Lutz) Date: Thu, 8 Dec 2011 10:29:15 -0500 Subject: [R] lda output missing Message-ID: <002101ccb5be$263d5870$72b80950$@edu> Hello everyone, I am working on a linear discriminant analysis and am having issues finding the full output of my lda. Specifically, there is no reporting of the Proportion of Trace that is a normal output of the procedure. I'm using a csv file and everything is reading in correctly. I've looked and looked and can't figure out why my output is not complete. Is it something simple that I am overlooking? I am working in R 2.14.0 with an updated MASS package. Here is my syntax: lda(CC ~ sumstem + maxdbh + maxh + cdlai + sumlai + sumbas + totalbio + ratio, data = practice) and the output is: Prior probabilities of groups: normal warm 0.5 0.5 Group means: sumstem maxdbh maxh cdlai sumlai sumbas totalbio normal 901.3722 16.66994 15.70927 0.010393258 1.672247 5.471812 27.67875 warm 972.4916 22.27247 19.64740 0.002429775 3.181994 9.892683 47.68511 ratio normal 0.01162921 warm 0.85721910 Coefficients of linear discriminants: LD1 sumstem 0.001111176 maxdbh 0.034299258 maxh -0.287343783 cdlai -2.021350057 sumlai 1.407215702 sumbas -0.419422181 totalbio 0.110403369 ratio 0.001657649 David A. Lutz, Ph. D. Center for Energy, Environment, and Sustainability Wake Forest University The Amazon Aid Foundation From searl at vt.edu Thu Dec 8 17:48:09 2011 From: searl at vt.edu (Steve E.) Date: Thu, 8 Dec 2011 08:48:09 -0800 (PST) Subject: [R] help wrapping findInterval into a function In-Reply-To: References: <1323189832120-4165464.post@n4.nabble.com> <485A5566-BB90-4001-922E-928D1203465B@comcast.net> <1323212031194-4166826.post@n4.nabble.com> <9E5A0B37-D7BB-49A6-B5BE-6F1C1DCE6913@comcast.net> <1323295297948-4170688.post@n4.nabble.com> Message-ID: <1323362889285-4173391.post@n4.nabble.com> Michael (and others) - Right, 'within' did work, I had placed it in the wrong location previously, which your example code made clear. I wrapped several of these functions within a function to address all the desired flags in a single pass (probably horribly inefficient but it works). Thanks again for your most generous assistance. Steve -- View this message in context: http://r.789695.n4.nabble.com/help-wrapping-findInterval-into-a-function-tp4165464p4173391.html Sent from the R help mailing list archive at Nabble.com. From ccquant at gmail.com Thu Dec 8 18:06:09 2011 From: ccquant at gmail.com (Ben quant) Date: Thu, 8 Dec 2011 10:06:09 -0700 Subject: [R] R on the cloud - Windows to Linux In-Reply-To: References: Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Thu Dec 8 18:12:43 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 8 Dec 2011 12:12:43 -0500 Subject: [R] lda output missing In-Reply-To: <002101ccb5be$263d5870$72b80950$@edu> References: <002101ccb5be$263d5870$72b80950$@edu> Message-ID: That's odd. You don't provide a reproducible example, but using a built-in dataset (from the help for lda) I get the Proportion of Trace given by the print.lda method. library(MASS) Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp = rep(c("s","c","v"), rep(50,3))) train <- sample(1:150, 75) z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) print(z) Call: lda(Sp ~ ., data = Iris, prior = c(1, 1, 1)/3, subset = train) Prior probabilities of groups: c s v 0.3333333 0.3333333 0.3333333 Group means: Sepal.L. Sepal.W. Petal.L. Petal.W. c 5.947826 2.786957 4.326087 1.3652174 s 5.050000 3.380769 1.465385 0.2346154 v 6.811538 3.023077 5.700000 2.0653846 Coefficients of linear discriminants: LD1 LD2 Sepal.L. -1.6665885 1.104460 Sepal.W. -0.8681909 1.872188 Petal.L. 2.4670375 -1.499070 Petal.W. 4.2156275 2.948759 Proportion of trace: LD1 LD2 0.9916 0.0084 Here's my sessionInfo(). Are you certain everything is up-to-date? What OS are you running? Do you have other packages loaded that could be interfering? What happens when you run the example I used? > sessionInfo() R version 2.14.0 (2011-10-31) Platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] MASS_7.3-16 loaded via a namespace (and not attached): [1] tools_2.14.0 On Thu, Dec 8, 2011 at 10:29 AM, David Lutz wrote: > Hello everyone, > > I am working on a linear discriminant analysis and am having issues finding > the full output of my lda. Specifically, there is no reporting of the > Proportion of Trace that is a normal output of the procedure. I'm using a > csv file and everything is reading in correctly. I've looked and looked and > can't figure out why my output is not complete. Is it something simple that > I am overlooking? > > I am working in R 2.14.0 with an updated MASS package. Here is my syntax: > > lda(CC ~ sumstem + maxdbh + maxh + cdlai + sumlai + sumbas + > ? ?totalbio + ratio, data = practice) > > and the output is: > > Prior probabilities of groups: > normal ? warm > ? 0.5 ? ?0.5 > > Group means: > ? ? ? ?sumstem ? maxdbh ? ? maxh ? ? ? cdlai ? sumlai ? sumbas totalbio > normal 901.3722 16.66994 15.70927 0.010393258 1.672247 5.471812 27.67875 > warm ? 972.4916 22.27247 19.64740 0.002429775 3.181994 9.892683 47.68511 > ? ? ? ? ? ?ratio > normal 0.01162921 > warm ? 0.85721910 > > Coefficients of linear discriminants: > ? ? ? ? ? ? ? ? ?LD1 > sumstem ? 0.001111176 > maxdbh ? ?0.034299258 > maxh ? ? -0.287343783 > cdlai ? ?-2.021350057 > sumlai ? ?1.407215702 > sumbas ? -0.419422181 > totalbio ?0.110403369 > ratio ? ? 0.001657649 > > > -- Sarah Goslee http://www.functionaldiversity.org From gunter.berton at gene.com Thu Dec 8 18:14:22 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Thu, 8 Dec 2011 09:14:22 -0800 Subject: [R] How to plot multiple graphs in one go? In-Reply-To: References: Message-ID: Sigh.... R FAQ 7.22 -- Bert On Thu, Dec 8, 2011 at 8:59 AM, Kaiyin Zhong wrote: > I am trying to do this, but it won't work: > >> library(lattice) >> elemconc = data.frame(expand.grid(id=1:20, geno=c('exp', 'wt'), > region=c('cor', 'cr', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(360, > 10)) >> elemconc$geno = factor(elemconc$geno) >> elemconc$region = factor(elemconc$region) >> for (i in as.character(levels(elemconc$region))) { > + densityplot(data=elemconc, ~conc, subset=region==i) > + } > > -- > Kaiyin Zhong > ------------------------------------------------------------------------------------------------------------------ > Neuroscience Research Institute, Peking University, Beijing, P.R.China > 100038 > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From marquett at iap.fr Thu Dec 8 18:37:22 2011 From: marquett at iap.fr (Jean-Baptiste Marquette) Date: Thu, 8 Dec 2011 12:37:22 -0500 Subject: [R] Compilation error of R-2.14.0 on Mac OS 10.7.2 Message-ID: Dear R gurus, I attempt to install the latest version of R from source on my MacBook Pro, using latest versions of Xcode and gfortran for Lion and configure options: ./configure --with-libintl-prefix=/sw --enable-R-shlib (this last option necessary to further install the Rpy Python package) I got the following unreduced compilation error: gcc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib -L/usr/local/lib -o tools.so text.o init.o Rmd5.o md5.o signals.o -L../../../../lib -lR -dylib_file libRblas.dylib:../../../../lib/libRblas.dylib -lintl -Wl,-framework -Wl,CoreFoundation make[6]: `Makedeps' is up to date. mkdir ../../../../library/tools/libs Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so': dlopen(/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so, 6): Symbol not found: _libintl_dgettext Referenced from: /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so Expected in: /Users/marquett/Downloads/R-2.14.0/lib/libR.dylib in /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so Error: impossible de charger le code R depuis le package ?tools? Execution halted make[3]: *** [all] Error 1 make[2]: *** [R] Error 1 make[1]: *** [R] Error 1 make: *** [R] Error 1 However the binary file matches the unresolved symbol: grep _libintl_dgettext /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so Binary file /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so matches Any help welcome. Cheers Jean-Baptiste From dumbforcoupons at gmail.com Thu Dec 8 18:34:37 2011 From: dumbforcoupons at gmail.com (curious_programmer) Date: Thu, 8 Dec 2011 09:34:37 -0800 (PST) Subject: [R] How to generate bivariate exponential distribution? In-Reply-To: <20110615073300.GA21219@praha1.ff.cuni.cz> References: <1308066000283-3596944.post@n4.nabble.com> <20110615073300.GA21219@praha1.ff.cuni.cz> Message-ID: <1323365677608-4173560.post@n4.nabble.com> thanks for the code, Petr. - what's the PDF of the bivariate exponential behind your code? - what sampling method are you using to generate these random numbers? is it rejection sampling? thanx -- View this message in context: http://r.789695.n4.nabble.com/How-to-generate-bivariate-exponential-distribution-tp3596944p4173560.html Sent from the R help mailing list archive at Nabble.com. From gleynes at gmail.com Thu Dec 8 18:24:43 2011 From: gleynes at gmail.com (Gene Leynes) Date: Thu, 8 Dec 2011 11:24:43 -0600 Subject: [R] read.table performance In-Reply-To: <4EE07DFB.7010309@gmail.com> References: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> <4EE07DFB.7010309@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Thu Dec 8 18:52:16 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Thu, 8 Dec 2011 12:52:16 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: <4EE0F950.4020602@gmail.com> On 07/12/2011 11:58 PM, Gabor Grothendieck wrote: > On Wed, Dec 7, 2011 at 11:42 PM, Michael wrote: > > Do you have an example...? Thanks a lot! > > See this video: > http://www.woopid.com/video/1388/Format-as-Table > That shows how to manipulate tables in Excel, but it doesn't really end up with something that I would consider good enough for printing. Excel is pretty nice at some database operations (selecting subsets by checkboxes, etc.) and with some work it can do whatever you want, but I don't think it is easy to produce a table that I would use in a paper or presentation. (Nor is it really easy in R, but I think it is easier, given that I know R and LaTeX. No question that it takes time to learn those.) Duncan Murdoch From scott.raynaud at yahoo.com Thu Dec 8 18:52:55 2011 From: scott.raynaud at yahoo.com (Scott Raynaud) Date: Thu, 8 Dec 2011 09:52:55 -0800 (PST) Subject: [R] R/parallel Message-ID: <1323366775.84457.YahooMailNeo@web120602.mail.ne1.yahoo.com> ?I want to take advantage of my multicore CPU to speed up a loop in a simulation program.? I didn?t write the code, but the iterations appear independent to me, at least in the sense that the results of one loop do not depend on previous ones.? Right now I?m relegated to a Windows box that runs Windows 7.? These appear to be the options: ? Pnmath-appears to parallelize non-BLAS routine but requires a special build Fork-UNIX only Romp-looks like this hasn?t advanced past the developmental stage Multicore-use on Windows at your own risk R/parallel-seems like the best option if I don?t want to recompile. ? Has anyone ever used R/parallel?? What kind of results did you have?? One difficulty with my simulation is that the loop includes code to generate random numbers.? If this loop is split into different threads, then I suspect the randomness of the numbers is not assured.? What can I do about that? ? I can provide the loop code, but it?s fairly long, say 75-100 lines. ? If R/parallel is not feasible then a recompile with BLAS and pnmath appears to be the next best option. From marc_schwartz at me.com Thu Dec 8 19:04:56 2011 From: marc_schwartz at me.com (Marc Schwartz) Date: Thu, 08 Dec 2011 12:04:56 -0600 Subject: [R] Compilation error of R-2.14.0 on Mac OS 10.7.2 In-Reply-To: References: Message-ID: On Dec 8, 2011, at 11:37 AM, Jean-Baptiste Marquette wrote: > Dear R gurus, > > I attempt to install the latest version of R from source on my MacBook Pro, using latest versions of Xcode and gfortran for Lion and configure options: > > ./configure --with-libintl-prefix=/sw --enable-R-shlib (this last option necessary to further install the Rpy Python package) > > I got the following unreduced compilation error: > > gcc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib -L/usr/local/lib -o tools.so text.o init.o Rmd5.o md5.o signals.o -L../../../../lib -lR -dylib_file libRblas.dylib:../../../../lib/libRblas.dylib -lintl -Wl,-framework -Wl,CoreFoundation > make[6]: `Makedeps' is up to date. > mkdir ../../../../library/tools/libs > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared object '/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so': > dlopen(/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so, 6): Symbol not found: _libintl_dgettext > Referenced from: /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Expected in: /Users/marquett/Downloads/R-2.14.0/lib/libR.dylib > in /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Error: impossible de charger le code R depuis le package ?tools? > Execution halted > make[3]: *** [all] Error 1 > make[2]: *** [R] Error 1 > make[1]: *** [R] Error 1 > make: *** [R] Error 1 > > However the binary file matches the unresolved symbol: > > grep _libintl_dgettext /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Binary file /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so matches > > Any help welcome. > > Cheers > Jean-Baptiste First, this query is best posted to R-SIG-MAC, not R-Help. More info here: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Second, the pre-built R binary for OSX that Simon creates already uses --enable-R-shilb, so that there is no reason to build from source if that is your only issue. Third, on OSX, there is no /sw by default and it is not clear why you are using that configure option, which is the likely source of the error you are getting. If you really want to build from source, there is information in the R for OSX FAQ: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html The R Installation and Admin Manual: http://cran.r-project.org/doc/manuals/R-admin.html#Building-from-source-on-_0028Mac_0029-OS-X and Simon's page: http://R.research.att.com/building.html HTH, Marc Schwartz From jones at reed.edu Thu Dec 8 19:11:35 2011 From: jones at reed.edu (Albyn Jones) Date: Thu, 8 Dec 2011 10:11:35 -0800 Subject: [R] map at fips level using multiple variables In-Reply-To: <20111207231427.illmhymh6sc8ks8o@cubmail.cc.columbia.edu> References: <20111207181216.ov9bliufio84k0gk@cubmail.cc.columbia.edu> <20111207231427.illmhymh6sc8ks8o@cubmail.cc.columbia.edu> Message-ID: <20111208181135.GD7818@reed.edu> since each county gets a single color, you would need to combine two color schemes. I am skeptical that this will work well, but you could try using rgb(). For example - code one variable using the red component, the other using the blue component. albyn On Wed, Dec 07, 2011 at 11:14:27PM -0500, bby2103 at columbia.edu wrote: > Hi David, > > Sorry it sounds vague. > > Here is my current code, which gives the distribution of family size > at US county level. You will see on a US map family size > distribution represented by different colors. > > Now if i have another variable income, which has 3 categories(<50k, > 50k-80k,>80k). How do I show 5x3 categories on the map? I guess I > could always create a third variable to do this. Just wondering > maybe there is a function to do this readily? > > Thank you! > Bonnie Yuan > > y=data1$size > x11() > hist(y,nclass=15) # histogram of y > fivenum(y) > # specify the cut-off point of y > y.colorBuckets=as.numeric(cut(y, c(1,2, 3,6))) > # legend showing the cut-off points. > legend.txt=c("0-1","1-2","2-3","3-6",">6") > colorsmatched=y.colorBuckets[match(county.fips$fips,fips[,1])] > x11() > map("county", col = colors[colorsmatched], fill = TRUE, resolution = 0) > map("state", col = "white", fill = FALSE, add = TRUE, lty = 1, lwd = 0.2) > title("Family Size") > legend("bottom", legend.txt, horiz = TRUE, fill = colors, cex=0.7) > > > > Quoting David Winsemius : > > > > >On Dec 7, 2011, at 6:12 PM, bby2103 at columbia.edu wrote: > > > >>Hi, I just started playing with county FIPS feature in maps > >>package which allows geospatial visualization of variables on > >>US county level. Pretty cool. > > > >Got code? > > > >> > >>I did some search but couldn't find answer to this question--how > >>can I map more than 2 variables on US map? > > > >"2 variables" is a bit on the vague side for programming purposes. > > > >>For example, you can map by the breakdown of income or family > >>size. How do you further breakdown based on the values of both > >>variables and show them on the county FIPS level? > > > >"breakdown" suggests a factor construct. If so, then : > > > >?interaction > > > >But the "show" part of the question remains very vague. > > > > Can't you be a bit more specific? What DO you want? > > > >-- > >David Winsemius, MD > >West Hartford, CT > > ______________________________________________ > R-help at 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 code. > -- Albyn Jones Reed College jones at reed.edu From tal.galili at gmail.com Thu Dec 8 19:37:06 2011 From: tal.galili at gmail.com (Tal Galili) Date: Thu, 8 Dec 2011 20:37:06 +0200 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tal.galili at gmail.com Thu Dec 8 19:38:49 2011 From: tal.galili at gmail.com (Tal Galili) Date: Thu, 8 Dec 2011 20:38:49 +0200 Subject: [R] R/parallel In-Reply-To: <1323366775.84457.YahooMailNeo@web120602.mail.ne1.yahoo.com> References: <1323366775.84457.YahooMailNeo@web120602.mail.ne1.yahoo.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From bbolker at gmail.com Thu Dec 8 20:09:09 2011 From: bbolker at gmail.com (Ben Bolker) Date: Thu, 8 Dec 2011 19:09:09 +0000 Subject: [R] simple fit References: <1323359550.46989.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: R. Michael Weylandt gmail.com> writes: > Fit y-b without an intercept? (which you do by adding "+ 0" or "- 1" > to the model formula) Not sure if this is the optimal result, but it > will give you a pretty reasonable answer. This seems backward. The OP has the slope and wants the intercept. > On Thu, Dec 8, 2011 at 10:52 AM, Alaios yahoo.com> wrote: > > ?I have a formula of the form > > y=ax+b > > I know everything except b. > > How I can ask R to do fitting to find only the value of b? > > I already know the lm() but it always return both an intercept point > > (b) and the a. Or: lm (y~1,offset=a*x,data= ...) or lm(y-a*x~1,data=...) [not sure this will evaluate the full expresson on the LHS but it might] From rolf.turner at xtra.co.nz Thu Dec 8 20:22:12 2011 From: rolf.turner at xtra.co.nz (Rolf Turner) Date: Fri, 9 Dec 2011 08:22:12 +1300 Subject: [R] simple fit In-Reply-To: References: <1323359550.46989.YahooMailNeo@web120103.mail.ne1.yahoo.com> Message-ID: <4EE10E64.80709@xtra.co.nz> If one knows y, x, and a, and wishes to estimate b in y = a*x + b (+ random error presumably) then surely the simplest procedure is b.hat <- mean(y-a*x) Is it not so? cheers, Rolf On 09/12/11 08:09, Ben Bolker wrote: > R. Michael Weylandt gmail.com> writes: > >> Fit y-b without an intercept? (which you do by adding "+ 0" or "- 1" >> to the model formula) Not sure if this is the optimal result, but it >> will give you a pretty reasonable answer. > This seems backward. The OP has the slope and wants the intercept. > >> On Thu, Dec 8, 2011 at 10:52 AM, Alaios yahoo.com> wrote: >>> I have a formula of the form >>> y=ax+b >>> I know everything except b. >>> How I can ask R to do fitting to find only the value of b? >>> I already know the lm() but it always return both an intercept point >>> (b) and the a. > Or: > > lm (y~1,offset=a*x,data= ...) > > or > > lm(y-a*x~1,data=...) [not sure this will evaluate the full > expresson on the LHS but it might] > > ______________________________________________ > R-help at 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 code. From pavan.namd at gmail.com Thu Dec 8 21:22:13 2011 From: pavan.namd at gmail.com (Pavan G) Date: Thu, 8 Dec 2011 15:22:13 -0500 Subject: [R] Find x value of density plots In-Reply-To: <4EDE6387.3020509@gmail.com> References: <4EDE6387.3020509@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From proebuck at mdanderson.org Thu Dec 8 21:25:08 2011 From: proebuck at mdanderson.org (Roebuck,Paul L) Date: Thu, 8 Dec 2011 14:25:08 -0600 Subject: [R] Compilation error of R-2.14.0 on Mac OS 10.7.2 In-Reply-To: Message-ID: Although I didn't try it, generally adding Fink to the mix is WRONG. Don't try to mix Fink and anything else. On 12/8/11 11:37 AM, "Jean-Baptiste Marquette" wrote: > Dear R gurus, > > I attempt to install the latest version of R from source on my MacBook Pro, > using latest versions of Xcode and gfortran for Lion and configure options: > > ./configure --with-libintl-prefix=/sw --enable-R-shlib (this last option > necessary to further install the Rpy Python package) > > I got the following unreduced compilation error: > > gcc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined > dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib > -L/usr/local/lib -o tools.so text.o init.o Rmd5.o md5.o signals.o > -L../../../../lib -lR -dylib_file > libRblas.dylib:../../../../lib/libRblas.dylib -lintl -Wl,-framework > -Wl,CoreFoundation > make[6]: `Makedeps' is up to date. > mkdir ../../../../library/tools/libs > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared object > '/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so': > dlopen(/Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so, 6): > Symbol not found: _libintl_dgettext > Referenced from: > /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Expected in: /Users/marquett/Downloads/R-2.14.0/lib/libR.dylib > in /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Error: impossible de charger le code R depuis le package ?tools? > Execution halted > make[3]: *** [all] Error 1 > make[2]: *** [R] Error 1 > make[1]: *** [R] Error 1 > make: *** [R] Error 1 > > However the binary file matches the unresolved symbol: > > grep _libintl_dgettext > /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > Binary file /Users/marquett/Downloads/R-2.14.0/library/tools/libs/tools.so > matches > > Any help welcome. > > Cheers > Jean-Baptiste > ______________________________________________ > R-help at 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 code. From pavan.namd at gmail.com Thu Dec 8 21:28:11 2011 From: pavan.namd at gmail.com (Pavan G) Date: Thu, 8 Dec 2011 15:28:11 -0500 Subject: [R] read.table question Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From comtech.usa at gmail.com Thu Dec 8 21:28:41 2011 From: comtech.usa at gmail.com (Michael) Date: Thu, 8 Dec 2011 14:28:41 -0600 Subject: [R] anova analysis on factors... Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From sarah.goslee at gmail.com Thu Dec 8 21:34:49 2011 From: sarah.goslee at gmail.com (Sarah Goslee) Date: Thu, 8 Dec 2011 15:34:49 -0500 Subject: [R] anova analysis on factors... In-Reply-To: References: Message-ID: And a further problem with both approaches: is 11pm (23) really that different from 1am? On Thu, Dec 8, 2011 at 3:28 PM, Michael wrote: > Hi all, > > If we wanted to study the effect on the mean of the hourly data based on > the hours within a day... > > and we wanted to do Anova analysis... > > We have two choices: > > Please see below: > > Why are these two approaches giving very different p-values? And which one > shall I use? > > Thanks a lot! > > 1. treating the hours as double/floating numbers: > > > anova(lm(hourlydata~as.double(hours_factors))) > > Df Sum Sq Mean Sq F value Pr(>F) > > as.double(hours_factors) 1 0.0002 0.00019876 1.3425 0.2466 > > Residuals 14868 2.2013 0.00014806 > > 2. treating the hours as factors: > > > > anova(lm(hourlydata~hours_factors)) > > Df Sum Sq Mean Sq F value Pr(>F) > > hours_factors 9 0.00077 8.5979e-05 0.5806 0.8142 > > Residuals 14860 2.20072 1.4810e-04 > > ? ? ? ?[[alternative HTML version deleted]] > -- Sarah Goslee http://www.functionaldiversity.org From murdoch.duncan at gmail.com Thu Dec 8 21:38:34 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Thu, 08 Dec 2011 15:38:34 -0500 Subject: [R] read.table question In-Reply-To: References: Message-ID: <4EE1204A.9000209@gmail.com> On 08/12/2011 3:28 PM, Pavan G wrote: > Hello All, > This works, > results<- read.table("plink.txt",T) > > while this doesn't. > results<- read.table("plink.txt") > Make sure your data frame contains columns CHR, BP, and P > > What does adding the "T" in read.table do? Which argument does this > correspond to? I tried searching for it but didn't find the answer in: > > > read.table(file, header = FALSE, sep = "", quote = "\"'", > dec = ".", row.names, col.names, > as.is = !stringsAsFactors, > na.strings = "NA", colClasses = NA, nrows = -1, > skip = 0, check.names = TRUE, fill = !blank.lines.skip, > strip.white = FALSE, blank.lines.skip = TRUE, > comment.char = "#", > allowEscapes = FALSE, flush = FALSE, > stringsAsFactors = default.stringsAsFactors(), > fileEncoding = "", encoding = "unknown") > > > Could someone please explain? You didn't name your arguments, so positional matching is used. Your call is equivalent to read.table(file = "plink.txt", header = T) In most users' sessions, that's the same as read.table(file = "plink.txt", header = TRUE) and I'd guess that's true about yours. Duncan Murdoch From dcarlson at tamu.edu Thu Dec 8 22:16:12 2011 From: dcarlson at tamu.edu (David L Carlson) Date: Thu, 8 Dec 2011 15:16:12 -0600 Subject: [R] lda output missing In-Reply-To: References: <002101ccb5be$263d5870$72b80950$@edu> Message-ID: <002501ccb5ee$9ca38db0$d5eaa910$@edu> The Proportion of trace will only show up if there are two or more linear discriminant functions. With two groups you have only one function, so the Proportion of trace is 1.0 for that function. group1 <- data.frame(Group="G1", Var1=rnorm(50), Var2=rnorm(50)) group2 <- data.frame(Group="G2", Var1=rnorm(50), Var2=rnorm(50)) Groups <- rbind(group1, group2) lda(Group~Var1+Var2, Groups) # No Proportion of trace group3 <- data.frame(Group="G3", Var1=rnorm(50), Var2=rnorm(50)) Groups <- rbind(group1, group2, group3) lda(Group~Var1+Var2, Groups) # Now it shows up For predicted group membership, look at predict.lda For tests of significance, look at Anova in package car For canonical discriminant analysis, look at package candisc ---------------------------------------------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Sarah Goslee Sent: Thursday, December 08, 2011 11:13 AM To: David Lutz Cc: r-help at r-project.org Subject: Re: [R] lda output missing That's odd. You don't provide a reproducible example, but using a built-in dataset (from the help for lda) I get the Proportion of Trace given by the print.lda method. library(MASS) Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp = rep(c("s","c","v"), rep(50,3))) train <- sample(1:150, 75) z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) print(z) Call: lda(Sp ~ ., data = Iris, prior = c(1, 1, 1)/3, subset = train) Prior probabilities of groups: c s v 0.3333333 0.3333333 0.3333333 Group means: Sepal.L. Sepal.W. Petal.L. Petal.W. c 5.947826 2.786957 4.326087 1.3652174 s 5.050000 3.380769 1.465385 0.2346154 v 6.811538 3.023077 5.700000 2.0653846 Coefficients of linear discriminants: LD1 LD2 Sepal.L. -1.6665885 1.104460 Sepal.W. -0.8681909 1.872188 Petal.L. 2.4670375 -1.499070 Petal.W. 4.2156275 2.948759 Proportion of trace: LD1 LD2 0.9916 0.0084 Here's my sessionInfo(). Are you certain everything is up-to-date? What OS are you running? Do you have other packages loaded that could be interfering? What happens when you run the example I used? > sessionInfo() R version 2.14.0 (2011-10-31) Platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] MASS_7.3-16 loaded via a namespace (and not attached): [1] tools_2.14.0 On Thu, Dec 8, 2011 at 10:29 AM, David Lutz wrote: > Hello everyone, > > I am working on a linear discriminant analysis and am having issues finding > the full output of my lda. Specifically, there is no reporting of the > Proportion of Trace that is a normal output of the procedure. I'm using a > csv file and everything is reading in correctly. I've looked and looked and > can't figure out why my output is not complete. Is it something simple that > I am overlooking? > > I am working in R 2.14.0 with an updated MASS package. Here is my syntax: > > lda(CC ~ sumstem + maxdbh + maxh + cdlai + sumlai + sumbas + > ? ?totalbio + ratio, data = practice) > > and the output is: > > Prior probabilities of groups: > normal ? warm > ? 0.5 ? ?0.5 > > Group means: > ? ? ? ?sumstem ? maxdbh ? ? maxh ? ? ? cdlai ? sumlai ? sumbas totalbio > normal 901.3722 16.66994 15.70927 0.010393258 1.672247 5.471812 27.67875 > warm ? 972.4916 22.27247 19.64740 0.002429775 3.181994 9.892683 47.68511 > ? ? ? ? ? ?ratio > normal 0.01162921 > warm ? 0.85721910 > > Coefficients of linear discriminants: > ? ? ? ? ? ? ? ? ?LD1 > sumstem ? 0.001111176 > maxdbh ? ?0.034299258 > maxh ? ? -0.287343783 > cdlai ? ?-2.021350057 > sumlai ? ?1.407215702 > sumbas ? -0.419422181 > totalbio ?0.110403369 > ratio ? ? 0.001657649 > > > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help at 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 code. From dwinsemius at comcast.net Thu Dec 8 22:17:04 2011 From: dwinsemius at comcast.net (David Winsemius) Date: Thu, 8 Dec 2011 16:17:04 -0500 Subject: [R] anova analysis on factors... In-Reply-To: References: Message-ID: <13D3A3DD-2BE1-498F-BE8A-C7C783556321@comcast.net> On Dec 8, 2011, at 3:28 PM, Michael wrote: > Hi all, > > If we wanted to study the effect on the mean of the hourly data > based on > the hours within a day... > > and we wanted to do Anova analysis... > > We have two choices: Who is "we" and how were these constraints imposed? > > Please see below: > > Why are these two approaches giving very different p-values? They are markedly different statistical models. > And which one > shall I use? > Without knowing your situation better and the eventual purposes of this analysis, it would be difficult to give sensible advice. I suspect the answer is "neither". -- David. > Thanks a lot! > > 1. treating the hours as double/floating numbers: > > > anova(lm(hourlydata~as.double(hours_factors))) > > Df Sum Sq Mean Sq F value Pr(>F) > > as.double(hours_factors) 1 0.0002 0.00019876 1.3425 0.2466 > > Residuals 14868 2.2013 0.00014806 > > 2. treating the hours as factors: > > > > anova(lm(hourlydata~hours_factors)) > > Df Sum Sq Mean Sq F value Pr(>F) > > hours_factors 9 0.00077 8.5979e-05 0.5806 0.8142 > > Residuals 14860 2.20072 1.4810e-04 > > [[alternative HTML version deleted]] David Winsemius, MD West Hartford, CT From shv736 at yahoo.com Thu Dec 8 22:21:08 2011 From: shv736 at yahoo.com (Vassily Shvets) Date: Thu, 8 Dec 2011 13:21:08 -0800 (PST) Subject: [R] R- CollocInfer data Message-ID: <1323379268.99992.YahooMailClassic@web130204.mail.mud.yahoo.com> Hello, I'm trying to go through the analyses in the CollocInfer introductory pdf file, particularly the NSdata. I seem to have loaded everything correctly but can't find any of the data sets for this package. Has anyone else had this experience? regards, S From HDoran at air.org Thu Dec 8 22:30:38 2011 From: HDoran at air.org (Doran, Harold) Date: Thu, 8 Dec 2011 16:30:38 -0500 Subject: [R] Behavior of apply() Message-ID: <686DF18D10EF1C428C2760321FB5B69E03A342D4D3@DC1VEX07MB001.air.org> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From marc_schwartz at me.com Thu Dec 8 22:40:10 2011 From: marc_schwartz at me.com (Marc Schwartz) Date: Thu, 08 Dec 2011 15:40:10 -0600 Subject: [R] Behavior of apply() In-Reply-To: <686DF18D10EF1C428C2760321FB5B69E03A342D4D3@DC1VEX07MB001.air.org> References: <686DF18D10EF1C428C2760321FB5B69E03A342D4D3@DC1VEX07MB001.air.org> Message-ID: <11F7FB8B-8823-4E4E-9358-11C416534B73@me.com> On Dec 8, 2011, at 3:30 PM, Doran, Harold wrote: > Suppose I have the following matrix > >> class(cov_50) > [1] "matrix" >> cov_50 > [,1] [,2] > [1,] 0.3201992 2.308084 > [2,] 6.7312928 5.719641 > > I then use the following function via apply and get the desired output, a list > > signif <- function(x) which(abs(x) > 1.96) > apply(cov_50, 1, signif) > >> apply(cov_50, 1, signif) > [[1]] > [1] 2 > > [[2]] > [1] 1 2 > > However, I can't see why the following occurs > >> class(cov_25) > [1] "matrix" >> cov_25 > [,1] [,2] > [1,] 12.116106 14.81248 > [2,] 5.492176 4.73138 > >> apply(cov_25, 1, signif) > [,1] [,2] > [1,] 1 1 > [2,] 2 2 > > So, using the same function (signif) on a different object of the same class yields a matrix and *not* a list as desired. > > I can't see any reason for the different output. Harold, Per the Value section of ?apply: If the calls to FUN return vectors of different lengths, apply returns a list of length prod(dim(X)[MARGIN]) with dim set to MARGIN if this has length greater than one. In your first example, the first row only has one value that is returned by signif() and then second row has two. So a list is returned. In your second example, both rows have two values that are returned by signif(), thus a matrix can be returned. The key is not that the two objects are both matrices, but that there are differing lengths in the returned values from the rows in each. HTH, Marc Schwartz From michael.weylandt at gmail.com Thu Dec 8 22:43:03 2011 From: michael.weylandt at gmail.com (R. Michael Weylandt) Date: Thu, 8 Dec 2011 16:43:03 -0500 Subject: [R] Behavior of apply() In-Reply-To: <686DF18D10EF1C428C2760321FB5B69E03A342D4D3@DC1VEX07MB001.air.org> References: <686DF18D10EF1C428C2760321FB5B69E03A342D4D3@DC1VEX07MB001.air.org> Message-ID: It's because your first example produces answers of varying length so there's no natural way to coerce it to a matrix. Your second has a consistent length so the result can be made into a matrix. Michael On Thu, Dec 8, 2011 at 4:30 PM, Doran, Harold wrote: > Suppose I have the following matrix > >> class(cov_50) > [1] "matrix" >> cov_50 > ? ? ? ? ?[,1] ? ? [,2] > [1,] 0.3201992 2.308084 > [2,] 6.7312928 5.719641 > > I then use the following function via apply and get the desired output, a list > > signif <- function(x) which(abs(x) > 1.96) > apply(cov_50, 1, signif) > >> apply(cov_50, 1, signif) > [[1]] > [1] 2 > > [[2]] > [1] 1 2 > > However, I can't see why the following occurs > >> class(cov_25) > [1] "matrix" >> cov_25 > ? ? ? ? ?[,1] ? ? [,2] > [1,] 12.116106 14.81248 > [2,] ?5.492176 ?4.73138 > >> ?apply(cov_25, 1, signif) > ? ? [,1] [,2] > [1,] ? ?1 ? ?1 > [2,] ? ?2 ? ?2 > > So, using the same function (signif) on a different object of the same class yields a matrix and *not* a list as desired. > > I can't see any reason for the different output. > >> sessionInfo() > R version 2.12.2 (2011-02-25) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 ?LC_CTYPE=English_United States.1252 > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base > > other attached packages: > [1] quantreg_4.57 SparseM_0.86 > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From angelo.arcadi at virgilio.it Thu Dec 8 22:58:38 2011 From: angelo.arcadi at virgilio.it (angelo.arcadi at virgilio.it) Date: Thu, 8 Dec 2011 22:58:38 +0100 (CET) Subject: [R] prop.test() and the simultaneous confidence interval for multiple proportions in R Message-ID: <1341faf707d.angelo.arcadi@virgilio.it> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tal.galili at gmail.com Thu Dec 8 23:15:09 2011 From: tal.galili at gmail.com (Tal Galili) Date: Fri, 9 Dec 2011 00:15:09 +0200 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From janko.thyson.rstuff at googlemail.com Thu Dec 8 23:16:17 2011 From: janko.thyson.rstuff at googlemail.com (Janko Thyson) Date: Thu, 08 Dec 2011 23:16:17 +0100 Subject: [R] Update MS Windows PATH variable based on a R script In-Reply-To: <4E0B75BB.1030103@gmail.com> References: <4E0B6DC6.1030709@googlemail.com> <4E0B75BB.1030103@gmail.com> Message-ID: <4EE13731.6010403@googlemail.com> This is a very very very late follow up, but I remember asking this question and just stumbled across an answer by Yihui. Check his file 'add-R-path-win.R' script which you can find at https://github.com/yihui/lyx/blob/master/README.md Very cool, thanks Yihui. Regards, Janko On 29.06.2011 20:58, Duncan Murdoch wrote: > On 29/06/2011 2:24 PM, Janko Thyson wrote: >> Dear list, >> >> this is not directly an R question, but it is somewhat related to R >> aspects, so I hope it's okay to post it here: >> >> I'd like to update my windows PATH based on a script routine in order to >> make sure that crucial components are contained. Much like what happens >> at the installation of Rtools (if desired). Now, can you do that from >> within R or do I need some sort of windows batch file or something like >> AutoIt script (http://www.autoitscript.com/site/autoit/)? If so, what >> would I need to put in there? > > You need to set the registry entry if you want a persistent change to > the PATH. Sys.setenv just modifies R's copy of the PATH. Child > processes will see the modifications, but they don't last beyond the R > session. > > You'll have to check MS docs to find which registry entry to mess > with. Alternatively, if you feel lucky, just use Control Panel to set > some strange path, then see where your change showed up using regedit. > > R doesn't have a built-in function to write to the registry, but there > are various utilities available outside of R to do it. > > Duncan Murdoch > >> >> Here's what I tried in R: >> >> unlist(strsplit(Sys.getenv("PATH"), ";")) >> PATH.0<- Sys.getenv("PATH") >> PATH.1<- paste(PATH.0, "C:\\blabla\bin") >> Sys.setenv("PATH"=PATH.1) >> unlist(strsplit(Sys.getenv("PATH"), ";")) >> >> The changes seem to be reflected, but when I check my PATH the new entry >> isn't there. I guess there is no actual "feedback" to Windows system >> environment variable and that's exactly what I would like to accomplish >> >> Thanks a lot for any advice, >> Janko >> >> ______________________________________________ >> R-help at 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 code. > > From vivs at ucla.edu Thu Dec 8 23:42:13 2011 From: vivs at ucla.edu (Vivian Shih) Date: Thu, 08 Dec 2011 14:42:13 -0800 Subject: [R] Relationship between covariance and inverse covariance matrices Message-ID: <20111208144213.59573bx5ld6wk1nw@mail.ucla.edu> Hi, I've been trying to figure out a special set of covariance matrices that causes some symmetric zero elements in the inverse covariance matrix but am having trouble figuring out if that is possible. Say, for example, matrix a is a 4x4 covariance matrix with equal variance and zero covariance elements, i.e. [,1] [,2] [,3] [,4] [1,] 4 0 0 0 [2,] 0 4 0 0 [3,] 0 0 4 0 [4,] 0 0 0 4 Now if we let a[1,2]=a[2,1]=3, then the inverse covariance matrix will have nonzero elements on the diagonals as well as for elements [1,2] and [2,1]. If we further let a[3,4]=a[4,3]=0.5 then the indices of the nonzero elements of the covariance matrix also matches those indices of the inverse. The problem is, if any of the nonzero off-diagonal indices match, then the inverse covariance matrix will have non-matching nonzero elements. For example, if a[1,2]=a[2,1]=3 as before but now we'll let a[2,3]=a[3,2]=0.5, then a would be: [,1] [,2] [,3] [,4] [1,] 4 3.0 0.0 0 [2,] 3 4.0 0.5 0 [3,] 0 0.5 4.0 0 [4,] 0 0.0 0.0 4 The inverse covariance matrix is now: [,1] [,2] [,3] [,4] [1,] 0.58333333 -0.44444444 0.05555556 0.00 [2,] -0.44444444 0.59259259 -0.07407407 0.00 [3,] 0.05555556 -0.07407407 0.25925926 0.00 [4,] 0.00000000 0.00000000 0.00000000 0.25 If we let a[1,2] and a[2,3] be nonzero, then the inverse will create a nonzero [1,3]. Does that happen all the time? I've tried to write out the algebraic system of linear equations for a and a-inverse but couldn't come up with anything. Let me know if I'm not clear on anything. Basically I'd just like to see what type of covariance matrices will produce an inverse covariance matrix with some zero elements. Thanks, Vivian From gunter.berton at gene.com Thu Dec 8 23:49:36 2011 From: gunter.berton at gene.com (Bert Gunter) Date: Thu, 8 Dec 2011 14:49:36 -0800 Subject: [R] Relationship between covariance and inverse covariance matrices In-Reply-To: <20111208144213.59573bx5ld6wk1nw@mail.ucla.edu> References: <20111208144213.59573bx5ld6wk1nw@mail.ucla.edu> Message-ID: What does this have to do with R? Is this homework? I suggest you post to some sort of math list. Perhaps others will have more specific suggestions where. -- Bert On Thu, Dec 8, 2011 at 2:42 PM, Vivian Shih wrote: > Hi, > > ? I've been trying to figure out a special set of covariance matrices that > causes some symmetric zero elements in the inverse covariance matrix but am > having trouble figuring out if that is possible. > > ? Say, for example, matrix a is a 4x4 covariance matrix with equal variance > and zero covariance elements, i.e. > > ? ? [,1] [,2] [,3] [,4] > [1,] ? ?4 ? ?0 ? ?0 ? ?0 > [2,] ? ?0 ? ?4 ? ?0 ? ?0 > [3,] ? ?0 ? ?0 ? ?4 ? ?0 > [4,] ? ?0 ? ?0 ? ?0 ? ?4 > > ? ?Now if we let a[1,2]=a[2,1]=3, then the inverse covariance matrix will > have nonzero elements on the diagonals as well as for elements [1,2] and > [2,1]. If we further let a[3,4]=a[4,3]=0.5 then the indices of the nonzero > elements of the covariance matrix also matches those indices of the inverse. > > ? ?The problem is, if any of the nonzero off-diagonal indices match, then > the inverse covariance matrix will have non-matching nonzero elements. For > example, if a[1,2]=a[2,1]=3 as before but now we'll let a[2,3]=a[3,2]=0.5, > then a would be: > > ? ? [,1] [,2] [,3] [,4] > [1,] ? ?4 ?3.0 ?0.0 ? ?0 > [2,] ? ?3 ?4.0 ?0.5 ? ?0 > [3,] ? ?0 ?0.5 ?4.0 ? ?0 > [4,] ? ?0 ?0.0 ?0.0 ? ?4 > > ? ?The inverse covariance matrix is now: > ? ? ? ? ? ?[,1] ? ? ? ?[,2] ? ? ? ?[,3] [,4] > [1,] ?0.58333333 -0.44444444 ?0.05555556 0.00 > [2,] -0.44444444 ?0.59259259 -0.07407407 0.00 > [3,] ?0.05555556 -0.07407407 ?0.25925926 0.00 > [4,] ?0.00000000 ?0.00000000 ?0.00000000 0.25 > > ? ?If we let a[1,2] and a[2,3] be nonzero, then the inverse will create a > nonzero [1,3]. Does that happen all the time? I've tried to write out the > algebraic system of linear equations for a and a-inverse but couldn't come > up with anything. > > ? ?Let me know if I'm not clear on anything. Basically I'd just like to see > what type of covariance matrices will produce an inverse covariance matrix > with some zero elements. > > > > > > Thanks, > Vivian > > ______________________________________________ > R-help at 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 code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm From Soren.Hojsgaard at agrsci.dk Fri Dec 9 00:20:38 2011 From: Soren.Hojsgaard at agrsci.dk (=?iso-8859-1?Q?S=F8ren_H=F8jsgaard?=) Date: Fri, 9 Dec 2011 00:20:38 +0100 Subject: [R] Relationship between covariance and inverse covariance matrices In-Reply-To: <20111208144213.59573bx5ld6wk1nw@mail.ucla.edu> References: <20111208144213.59573bx5ld6wk1nw@mail.ucla.edu> Message-ID: <9F0721FDD4F12D4B95AD894274F388EC023F9D620CCE@DJFEXMBX01.djf.agrsci.dk> Your question is not all that R-related, but inverse covariance matrices with zero entries corresponds to conditional independence restrictions in the multivaritate normal distribution. Such inverse covariance matrices are key ingredients in graphical Gaussian models (also known as covariance selection models). You may want to study the litterature on such models. Regards S?ren ________________________________________ Fra: r-help-bounces at r-project.org [r-help-bounces at r-project.org] På vegne af Vivian Shih [vivs at ucla.edu] Sendt: 8. december 2011 23:42 Til: r-help at r-project.org Emne: [R] Relationship between covariance and inverse covariance matrices Hi, I've been trying to figure out a special set of covariance matrices that causes some symmetric zero elements in the inverse covariance matrix but am having trouble figuring out if that is possible. Say, for example, matrix a is a 4x4 covariance matrix with equal variance and zero covariance elements, i.e. [,1] [,2] [,3] [,4] [1,] 4 0 0 0 [2,] 0 4 0 0 [3,] 0 0 4 0 [4,] 0 0 0 4 Now if we let a[1,2]=a[2,1]=3, then the inverse covariance matrix will have nonzero elements on the diagonals as well as for elements [1,2] and [2,1]. If we further let a[3,4]=a[4,3]=0.5 then the indices of the nonzero elements of the covariance matrix also matches those indices of the inverse. The problem is, if any of the nonzero off-diagonal indices match, then the inverse covariance matrix will have non-matching nonzero elements. For example, if a[1,2]=a[2,1]=3 as before but now we'll let a[2,3]=a[3,2]=0.5, then a would be: [,1] [,2] [,3] [,4] [1,] 4 3.0 0.0 0 [2,] 3 4.0 0.5 0 [3,] 0 0.5 4.0 0 [4,] 0 0.0 0.0 4 The inverse covariance matrix is now: [,1] [,2] [,3] [,4] [1,] 0.58333333 -0.44444444 0.05555556 0.00 [2,] -0.44444444 0.59259259 -0.07407407 0.00 [3,] 0.05555556 -0.07407407 0.25925926 0.00 [4,] 0.00000000 0.00000000 0.00000000 0.25 If we let a[1,2] and a[2,3] be nonzero, then the inverse will create a nonzero [1,3]. Does that happen all the time? I've tried to write out the algebraic system of linear equations for a and a-inverse but couldn't come up with anything. Let me know if I'm not clear on anything. Basically I'd just like to see what type of covariance matrices will produce an inverse covariance matrix with some zero elements. Thanks, Vivian ______________________________________________ R-help at 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 code. From tlumley at uw.edu Fri Dec 9 01:25:46 2011 From: tlumley at uw.edu (Thomas Lumley) Date: Fri, 9 Dec 2011 11:25:46 +1100 Subject: [R] survreg() provides same results with different distirbutions for left censored data In-Reply-To: <1323276942133-4169671.post@n4.nabble.com> References: <1323276942133-4169671.post@n4.nabble.com> Message-ID: On Thu, Dec 8, 2011 at 3:55 AM, ifejobi wrote: > Hello, > > I'm working with some left censored survival data using accelerated failure > time models. ?I am interested in fitting different distributions to the data > but seem to be getting the same results from the model fit using survreg > regardless of the assumed distribution. > > These two codes seem to provide the same results: > > aft.gaussian <- summary(survreg(Surv(y,y>0),type="left")~ > group),dist="gaussian") > > aft.weibull <- summary(survreg(Surv(y,y>0),type="left")~ > group),dist="weibull") > That's because you're fitting the same model: the dist= argument needs to be inside the parentheses for survreg(). -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland From qaisfayyad at gmail.com Fri Dec 9 01:33:13 2011 From: qaisfayyad at gmail.com (cahaya iman) Date: Fri, 9 Dec 2011 11:33:13 +1100 Subject: [R] Goodness of Fit for Copula Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From rbaer at atsu.edu Fri Dec 9 01:41:51 2011 From: rbaer at atsu.edu (Robert Baer) Date: Thu, 8 Dec 2011 18:41:51 -0600 Subject: [R] read.table question In-Reply-To: References: Message-ID: Hello All, This works, results <- read.table("plink.txt",T) while this doesn't. results <- read.table("plink.txt") -------------------- The T is the value for the second parameter which you show from the help file printout you looked at to be header. Thus, you are writing in short cut: results <- read.table("plink.txt", header=T) # parameters are assigned by position when names are not explicit. Further, you should know that T is a variable with the value TRUE (boolean). Most people recommend you write it out to avoid unexpected reassignments of the variable T to something other than TRUE. Thus, you should write: results <- read.table("plink.txt", header=TRUE) # this is explicit of what works for plink.txt Finally, by header = TRUE, you are saying that the first row of your file contains the column headings for your data which apparently it does if it it works. Hopes this helps you understand the help file which at least you took the time to read. Good on you! HTH, Rob Make sure your data frame contains columns CHR, BP, and P What does adding the "T" in read.table do? Which argument does this correspond to? I tried searching for it but didn't find the answer in: read.table(file, header = FALSE, sep = "", quote = "\"'", dec = ".", row.names, col.names, as.is = !stringsAsFactors, na.strings = "NA", colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = "#", allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors(), fileEncoding = "", encoding = "unknown") Could someone please explain? Thanks P [[alternative HTML version deleted]] ______________________________________________ R-help at 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 code. ------------------------------------------ Robert W. Baer, Ph.D. Professor of Physiology Kirksville College of Osteopathic Medicine A. T. Still University of Health Sciences 800 W. Jefferson St. Kirksville, MO 63501 660-626-2322 FAX 660-626-2965 From nurm1605 at gmail.com Fri Dec 9 02:09:12 2011 From: nurm1605 at gmail.com (nur mohd) Date: Fri, 9 Dec 2011 09:09:12 +0800 Subject: [R] stop messages Message-ID: Dear sir how to stop the messages from r-help to appear in my email.tq From bps0002 at auburn.edu Fri Dec 9 03:34:07 2011 From: bps0002 at auburn.edu (B77S) Date: Thu, 8 Dec 2011 18:34:07 -0800 (PST) Subject: [R] profile likelihood In-Reply-To: <1323374405563-4174090.post@n4.nabble.com> References: <1323374405563-4174090.post@n4.nabble.com> Message-ID: <1323398047239-4175254.post@n4.nabble.com> Try posting this question at least 1 more time. plocq wrote > > Hi, > > I try to use the function profile() of the SpatialExtremes' package to > obtain the profile likelihood of parameters for an extreme values fit > based on Poisson process : > > fit<-fpot(data, threshold, model="pp", npp=365). > > But when I call "profile(fit)", I obtain the following error (even if I > precise others arguments of the function) : > > [1] "profiling loc" > Erreur dans nlpot(p[1], p[2], ...) : > argument(s) inutilis?(s) (loc = 9.58435562072) > > > I don't understand what is unused and why. From where does this error come > from? If someone could help me it would be nice...! > -- View this message in context: http://r.789695.n4.nabble.com/profile-likelihood-tp4174090p4175254.html Sent from the R help mailing list archive at Nabble.com. From xie at yihui.name Fri Dec 9 04:14:38 2011 From: xie at yihui.name (Yihui Xie) Date: Thu, 8 Dec 2011 21:14:38 -0600 Subject: [R] Update MS Windows PATH variable based on a R script In-Reply-To: <4EE13731.6010403@googlemail.com> References: <4E0B6DC6.1030709@googlemail.com> <4E0B75BB.1030103@gmail.com> <4EE13731.6010403@googlemail.com> Message-ID: Probably cool but "evil", I should say, but I do not have a better choice at the moment. This script does not take the R version into account (e.g. after you update R, your new version may not be able to get into PATH via this script), so you may consider improving it a little bit. Please contact me offline if you are interested. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, Dec 8, 2011 at 4:16 PM, Janko Thyson wrote: > This is a very very very late follow up, but I remember asking this question > and just stumbled across an answer by Yihui. Check his file > 'add-R-path-win.R' script which you can find at > https://github.com/yihui/lyx/blob/master/README.md > > Very cool, thanks Yihui. > > Regards, > Janko > > > On 29.06.2011 20:58, Duncan Murdoch wrote: >> >> On 29/06/2011 2:24 PM, Janko Thyson wrote: >>> >>> Dear list, >>> >>> this is not directly an R question, but it is somewhat related to R >>> aspects, so I hope it's okay to post it here: >>> >>> I'd like to update my windows PATH based on a script routine in order to >>> make sure that crucial components are contained. Much like what happens >>> at the installation of Rtools (if desired). Now, can you do that from >>> within R or do I need some sort of windows batch file or something like >>> AutoIt script (http://www.autoitscript.com/site/autoit/)? If so, what >>> would I need to put in there? >> >> >> You need to set the registry entry if you want a persistent change to the >> PATH. ?Sys.setenv just modifies R's copy of the PATH. ?Child processes will >> see the modifications, but they don't last beyond the R session. >> >> You'll have to check MS docs to find which registry entry to mess with. >> ?Alternatively, if you feel lucky, just use Control Panel to set some >> strange path, then see where your change showed up using regedit. >> >> R doesn't have a built-in function to write to the registry, but there are >> various utilities available outside of R to do it. >> >> Duncan Murdoch >> >>> >>> Here's what I tried in R: >>> >>> unlist(strsplit(Sys.getenv("PATH"), ";")) >>> PATH.0<- Sys.getenv("PATH") >>> PATH.1<- paste(PATH.0, "C:\\blabla\bin") >>> Sys.setenv("PATH"=PATH.1) >>> unlist(strsplit(Sys.getenv("PATH"), ";")) >>> >>> The changes seem to be reflected, but when I check my PATH the new entry >>> isn't there. I guess there is no actual "feedback" to Windows system >>> environment variable and that's exactly what I would like to accomplish >>> >>> Thanks a lot for any advice, >>> Janko >>> >>> ______________________________________________ >>> R-help at 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 code. >> >> >> > > ______________________________________________ > R-help at 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 code. From dreamerwzni at gmail.com Thu Dec 8 19:30:16 2011 From: dreamerwzni at gmail.com (Weizeng Ni) Date: Thu, 8 Dec 2011 13:30:16 -0500 Subject: [R] cannot access the functions in the package Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From henserghai at googlemail.com Thu Dec 8 19:34:38 2011 From: henserghai at googlemail.com (Henser) Date: Thu, 8 Dec 2011 10:34:38 -0800 (PST) Subject: [R] How to load the data set from an URL Link? Message-ID: <1323369278820-4173731.post@n4.nabble.com> My problem is very easy, but it took me hours without a solution. So, I have to take any data set from UCI repository website for example this one which is about consensus income: http://archive.ics.uci.edu/ml/datasets/Census+Income And here is the data folder: http://archive.ics.uci.edu/ml/machine-learning-databases/adult/ My task is to caculate to do this: a) Calculate measures of centrality (mean, median,...), dispersion (IQR, standard deviation...) and shape (skewness and kurtosis). b) Make histograms, normal probability plots, bar plots, box-plots and stem and leaf plots. c) Study the relation between, at least, two quantitative variables with a linear regression model. The first big problem is: how to load the data base into R? Can someone give me the code? It took me hours without finding the solutions. The second question is where can I get the code for calculating the mean? The reason I found different types of codes but I dont know which one is correct so I am rather confused. (I have never used R before,I just installed it on Windows). Can someone give me the code for mean and a code for a bar plot so that in this I can try to solve all the questions. I only need initial help. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/How-to-load-the-data-set-from-an-URL-Link-tp4173731p4173731.html Sent from the R help mailing list archive at Nabble.com. From gleynes at gmail.com Thu Dec 8 19:45:26 2011 From: gleynes at gmail.com (Gene Leynes) Date: Thu, 8 Dec 2011 12:45:26 -0600 Subject: [R] read.table performance In-Reply-To: References: <61F99C62-6822-40A4-882D-97616FB0E890@gmail.com> <4EE07DFB.7010309@gmail.com> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From dnz.marcio at gmail.com Thu Dec 8 20:27:13 2011 From: dnz.marcio at gmail.com (dnz.marcio) Date: Thu, 8 Dec 2011 11:27:13 -0800 (PST) Subject: [R] optimize() Message-ID: <1323372433560-4173920.post@n4.nabble.com> Hi! I have a difficulty in the use of function optimize(). Could you help me? I want to maximize this function: ##### Logaritmo da distribui??o condicional de alpha[i] lp_alphai <- function(alphai, i, beta, tau, N){ t1 <- (N[i+1] - N[i])*log(alphai) t2 <- - (N[i+1] - N[i])*alphai*log(beta[i]) t3 <- (alphai - 1)*sum(log(times[(N[i] + 1):N[i+1]])) t4 <- - exp(alphai*(log(tau[i+1]) - log(beta[i]))) t5 <- 0 if(i > 1) t5 <- exp(alphai*(log(tau[i]) - log(beta[i]))) v <- t1 + t2 + t3 + t4 + t5 return(v) } Then, I've done: optimize(lp_alphai, lower = 0, upper = 10, maximum = TRUE, tol = 0.00000000001, i = 1, beta = 125, tau = c(0,1900), N = c(0,236))$maximum However, I face this problem: Error in i + 1 : 'i' missing I've been in this problem all this day, but, I can't find a solution. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/optimize-tp4173920p4173920.html Sent from the R help mailing list archive at Nabble.com. From less.is.mo_ at hotmail.com Thu Dec 8 20:29:45 2011 From: less.is.mo_ at hotmail.com (plocq) Date: Thu, 8 Dec 2011 11:29:45 -0800 (PST) Subject: [R] profile likelihood Message-ID: <1323372585438-4173930.post@n4.nabble.com> Hi, I try to use the function profile() of the SpatialExtremes' package to obtain the profile likelihood of parameters for an extreme values fit based on Poisson process : fit<-fpot(data, threshold, model="pp", npp=365). But when I call "profile(fit)", I obtain the following error (even if I precise others arguments of the function) : [1] "profiling loc" Erreur dans nlpot(p[1], p[2], ...) : argument(s) inutilis?(s) (loc = 9.58435562072) I don't understand what is unused and why. From where does this error come from? If someone could help me it would be nice...! -- View this message in context: http://r.789695.n4.nabble.com/profile-likelihood-tp4173930p4173930.html Sent from the R help mailing list archive at Nabble.com. From robbiesqp at gmail.com Thu Dec 8 20:34:49 2011 From: robbiesqp at gmail.com (343GS) Date: Thu, 8 Dec 2011 11:34:49 -0800 (PST) Subject: [R] Help with study guide for R exam Message-ID: <1323372889798-4173951.post@n4.nabble.com> Hi there. I have a final exam coming up in a class that is heavily based in the R programming language. The teacher has provided to us a few questions to study in preparation for the exam. I was looking to see if anyone could help answer any or all of these questions. Your help is extremely appreciated! Thank you! - Spark 1. Write the first 6 lines of a hypothetical external data file named infile that will be completely read by the following R command: mydata <- read.table(?infile?, skip=3, header=FALSE, sep=?,?, colClasses=c(?character?, rep(?numeric?, 3) ) ) 2. Describe and fix the error in the following R command. if(mydata[,2]=2) {mydata[,2]=mydata[,2]*2} 3. Write 1 or more R statements that will calculate the mean, sum, and standard deviation of the numeric columns of mydata described in question #1. 4. What type of data structure is produced by the R command in question #1? 5. What type of data structure is returned by the which statement in the following R command? myresult <- mydata[which(mydata[,1]> 6. Be able to fully describe the characteristcs and advantages of the following data structures: vector, dataframe, matrix, list 7. Be able to describe the following data types: character, numeric, logical, date, factor 8. Describe several advantages and disadvantages to the R open-source development process (ie. of the R system development) 9. What is an R package? 10. What makes R different from a language like Fortran or C? -- View this message in context: http://r.789695.n4.nabble.com/Help-with-study-guide-for-R-exam-tp4173951p4173951.html Sent from the R help mailing list archive at Nabble.com. From glipori at gmail.com Thu Dec 8 20:35:40 2011 From: glipori at gmail.com (g_l) Date: Thu, 8 Dec 2011 11:35:40 -0800 (PST) Subject: [R] bwplot title size Message-ID: <1323372940653-4173955.post@n4.nabble.com> Using the statement below to draw a plot. The title size doesn't seem to change regardless of what value I put in for cex.main. How do I reduce the size of the title? #print distributions by Month bwplot(RoomsInUse ~ Hour | Month, scales=list(x=list(rot=90)), horizontal=FALSE,las=2,main=title,sub=tag,xlab="Hour of Day", ylab="Rooms Running",cex.sub = 0.5, cex.main = 0.5, cex.axis=0.5,data=df.final,as.table=TRUE, layout=c(2,3)) -- View this message in context: http://r.789695.n4.nabble.com/bwplot-title-size-tp4173955p4173955.html Sent from the R help mailing list archive at Nabble.com. From tony333_6 at hotmail.com Thu Dec 8 20:36:12 2011 From: tony333_6 at hotmail.com (tony333) Date: Thu, 8 Dec 2011 11:36:12 -0800 (PST) Subject: [R] what is the difference between using function predict() and coef() in prediction Message-ID: <1323372972239-4173961.post@n4.nabble.com> i do not know what is the difference between predict() and coef() i use the two function give me different result zz = predict(xy.lm,list(T8=T8)) ss = coef(xy.lm)[1]+(coef(xy.lm)[2])*T8 where is t8 is the data used in prediction did not use in the fitting in training sample where every sample is 15 value -- View this message in context: http://r.789695.n4.nabble.com/what-is-the-difference-between-using-function-predict-and-coef-in-prediction-tp4173961p4173961.html Sent from the R help mailing list archive at Nabble.com. From less.is.mo_ at hotmail.com Thu Dec 8 20:59:09 2011 From: less.is.mo_ at hotmail.com (plocq) Date: Thu, 8 Dec 2011 11:59:09 -0800 (PST) Subject: [R] profile likelihood Message-ID: <1323374349152-4174074.post@n4.nabble.com> Hi, I try to use the function profile() of the SpatialExtremes' package to obtain the profile likelihood of parameters for an extreme values fit based on Poisson process : fit<-fpot(data, threshold, model="pp", npp=365). But when I call "profile(fit)", I obtain the following error (even if I precise others arguments of the function) : [1] "profiling loc" Erreur dans nlpot(p[1], p[2], ...) : argument(s) inutilis?(s) (loc = 9.58435562072) I don't understand what is unused and why. From where does this error come from? If someone could help me it would be nice...! -- View this message in context: http://r.789695.n4.nabble.com/profile-likelihood-tp4174074p4174074.html Sent from the R help mailing list archive at Nabble.com. From less.is.mo_ at hotmail.com Thu Dec 8 21:00:05 2011 From: less.is.mo_ at hotmail.com (plocq) Date: Thu, 8 Dec 2011 12:00:05 -0800 (PST) Subject: [R] profile likelihood Message-ID: <1323374405563-4174090.post@n4.nabble.com> Hi, I try to use the function profile() of the SpatialExtremes' package to obtain the profile likelihood of parameters for an extreme values fit based on Poisson process : fit<-fpot(data, threshold, model="pp", npp=365). But when I call "profile(fit)", I obtain the following error (even if I precise others arguments of the function) : [1] "profiling loc" Erreur dans nlpot(p[1], p[2], ...) : argument(s) inutilis?(s) (loc = 9.58435562072) I don't understand what is unused and why. From where does this error come from? If someone could help me it would be nice...! -- View this message in context: http://r.789695.n4.nabble.com/profile-likelihood-tp4174090p4174090.html Sent from the R help mailing list archive at Nabble.com. From blumsteinm at gmail.com Thu Dec 8 21:24:27 2011 From: blumsteinm at gmail.com (mjb) Date: Thu, 8 Dec 2011 12:24:27 -0800 (PST) Subject: [R] dcc in 'bootRes' package In-Reply-To: References: Message-ID: <1323375867459-4174194.post@n4.nabble.com> I just ran into the same problem. When you read in the DC data, set the year column as the row names instead of the first column. For whatever reason this worked for me. I hope if works for you. DC<-read.table("Dalton.txt", header=T, row.names = 1) climate<-read.table("climate.txt", header=T) dcc.DC<-dcc(DC, climate, method ="response", start = -4, end =9) -- View this message in context: http://r.789695.n4.nabble.com/dcc-in-bootRes-package-tp3899990p4174194.html Sent from the R help mailing list archive at Nabble.com. From comtech.usa at gmail.com Thu Dec 8 22:02:13 2011 From: comtech.usa at gmail.com (Michael) Date: Thu, 8 Dec 2011 15:02:13 -0600 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available URL: From murdoch.duncan at gmail.com Fri Dec 9 00:51:43 2011 From: murdoch.duncan at gmail.com (Duncan Murdoch) Date: Thu, 8 Dec 2011 18:51:43 -0500 Subject: [R] nice report generator? In-Reply-To: References: <4EDFB3E7.1070302@googlemail.com> <4EDFEFAF.1090208@gmail.com> <20111208035525.17370@gmx.net> Message-ID: <4EE14D8F.6010607@gmail.com> On 11-12-08 1:37 PM, Tal Galili wrote: > Helloe dear Duncan, Gabor, Michael and others, > > Do you think it could be (reasonably) possible to create a bridge between a > "cast_df" object from the {reshape} package into a table in Duncan's new > {tables} package? I'm not that familiar with the reshape package (and neither it nor reshape2 appears to have a vignette to give me an overview), so I don't have any idea if that makes sense. The table package is made to work on dataframes, and only dataframes. It converts them into matrices with lots of attributes, so that the print methods can put nice labels on. But it's strictly rectangular to rectangular in the kinds of conversions it does, and from the little I know about reshape, it works on more general arrays, converting them to and from dataframes. > > That would allow one to do pivot-table like operations on an object using > {reshape}, and then display it (as it would have been in excel - or better) > using the {tables} package. You'll have to give an example of what you want to do. Duncan Murdoch > > > > > > > ----------------Contact > Details:------------------------------------------------------- > Contact me: Tal.Galili at gmail.com | 972-52-7275845 > Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | > www.r-statistics.com (English) > ---------------------------------------------------------------------------------------------- > > > > > On Thu, Dec 8, 2011 at 5:24 PM, Michael wrote: > >> Hi folks, >> >> In addition to Excel style tables, it would be great to have Excel 2010 >> Pivot Table in R... >> >> Any thoughts? >> >> Thanks a lot! >> >> On Thu, Dec 8, 2011 at 4:49 AM, Tal Galili wrote: >> >>> I think it would be *great *if an extension of Duncan's new "tables" >>> package could include themes and switches as are seen in the video Gabor >>> just linked to. >>> >>> >>> Tal >>> >>> >>> On Thu, Dec 8, 2011 at 6:58 AM, Gabor Grothendieck< >>> ggrothendieck at gmail.com> wrote: >>> >>>> On Wed, Dec 7, 2011 at 11:42 PM, Michael wrote: >>>>> Do you have an example...? Thanks a lot! >>>> >>>> See this video: >>>> http://www.woopid.com/video/1388/Format-as-Table >>>> >>>> -- >>>> Statistics& Software Consulting >>>> GKX Group, GKX Associates Inc. >>>> tel: 1-877-GKX-GROUP >>>> email: ggrothendieck at gmail.com >>>> >>>> ______________________________________________ >>>> R-help at 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 code. >>>> >>> >>> >> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 code. From dr.jzhou at gmail.com Fri Dec 9 03:36:45 2011 From: dr.jzhou at gmail.com (karena) Date: Thu, 8 Dec 2011 18:36:45 -0800 (PST) Subject: [R] R packages for pathway analysis? Message-ID: <1323398205823-4175258.post@n4.nabble.com> What R packages do you guys use for 'pathway analysis'? By 'pathway analysis', I mean to check the enrichment of certain genes in KEGG | GO pathways. Thank you, Karena -- View this message in context: http://r.789695.n4.nabble.com/R-packages-for-pathway-analysis-tp4175258p4175258.html Sent from the R help mailing list archive at Nabble.com. From remkoduursma at gmail.com Fri Dec 9 03:53:32 2011 From: remkoduursma at gmail.com (Remko Duursma) Date: Thu, 8 Dec 2011 18:53:32 -0800 (PST) Subject: [R] Align expression and text in mtext() Message-ID: <1323399212078-4175286.post@n4.nabble.com> Dear R-helpers, I have trouble aligning an expression with a subscript, and text, in margin text: par(mar=c(6,6,1,1)) b <- barplot(1:3) mtext(c("A","B","C"), at=b, side=1, line=1, cex=1.3) mtext(expression(italic(C)[a]~(more~text)), at=0, line=1, side=1,cex=1.3) As explained in the help files and elsewhere, I understand that the expression is aligned by the bounding box, not the lower end of the 'text' in the expression. Playing with adj or padj in mtext() does not really solve this? Any suggestions or workarounds? PS, I tried using a phantom() expression for the text bits; but this messes up the horizontal alignment). thanks, Remko -- View this message in context: http://r.789695.n4.nabble.com/Align-expression-and-text-in-mtext-tp4175286p4175286.html Sent from the R help mailing list archive at Nabble.com. From scott.raynaud at yahoo.com Fri Dec 9 01:50:02 2011 From: scott.raynaud at yahoo.com (Scott Raynaud) Date: Thu, 8 Dec 2011 16:50:02 -0800 (PST) Subject: [R] R/parallel In-Reply-To: References: <1323366775.84457.YahooMailNeo@web120602.mail.ne1.yahoo.com> Message-ID: <1323391802.28344.YahooMailNeo@web120603.mail.ne1.yahoo.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From kbrownk at gmail.com Fri Dec 9 06:54:54 2011 From: kbrownk at gmail.com (Kerry) Date: Thu, 8 Dec 2011 21:54:54 -0800 (PST) Subject: [R] Help understanding cutree used for Dunn Index Message-ID: <650af817-4436-4371-b765-c067ac3c574c@n10g2000vbg.googlegroups.com> Basic question: Is it correct to assume that when using cutree to set the # clusters (say k=4), cutree determines the clusters by the largest distances among all potential clusters? I've read the R help for cutree and am using it to define the number of groups to obtain Dunn Index scores (using clValid library) for cluster analysis (using Euclidean Distance and Ward's