similar to: Vectorization/Speed Problem

Displaying 20 results from an estimated 1000 matches similar to: "Vectorization/Speed Problem"

2006 Sep 11
2
faster way?
Hi, Is there a faster way to do this? It takes forever, even on a moderately sized dataset. n <- dim(dsn)[1] dsn2 <- dsn[order(-dsn$xhat),] dsn2[1, "cumx"] <- dsn2[1, "xhat"] for (i in 2:n) { dsn2[i, "cumx"] <- dsn2[i - 1, "cumx"] + dsn2[i, "xhat"] } [[alternative HTML version deleted]]
2006 Jun 22
2
programming advice
Dear R users I want to compute Kendall's Tau between two vectors x and y. But x and y may have zeros in the same position(s) and I wrote the following function to be sure to drop out those "double zeros" "cor.kendall" <- function(x,y) { nox <- c() noy <- c() # for (i in 1:length(x)) if (x[i]!= 0 | y[i] != 0) nox[length(nox)+1]<- x[i] for (i in
2012 Aug 31
1
virDomainMemoryPeek: bad behavior under workload
Greetings, I am working on a platform for analysis automation. I need to run several Virtual Environments concurrently and record information about their behavior. I wrote some months ago about the capability of reading the Memory during the Environment's execution (in paused state). What do I need is the complete linear memory image, byte per byte, nothing special; I will give this output
2005 Mar 02
1
Leaps & regsubsets
Hello I am trying to use all subsets regression on a test dataset consisting of 11 trails and 46 potential predictor variables. I would like to use Mallow's Cp as a selection criterion. The leaps function would provide the required output but does not work with this many variables (see below). The alternative function regsubsets should be used, but I am not able to define the function in
2009 Feb 16
1
incl.non.slopes=FALSE does not work at predict.lm
Dear all, I am trying to estimate the prediction from a fixed effects model and their confidence intervals as well. Though I do not want to include in the prediction and at the confidence intervals the intercept. For that reason I used the argument incl.non.slopes=FALSE. But either if it is TRUE or FALSE it does not have any difference and also the system does not provide any warning. I really
2007 Apr 18
1
Changing axis lable text size in plots?
Dear list I'm plotting ( boxplot() and plot() ) some data for a publication. The editor would like the text labels on the plots in a larger font. I'm doing something like this: <snip> jpeg( filename = "D:/Martin/Work/CleanPath/RAF1%03d.jpg", width = 1000, height = 600, pointsize = 12, quality = 100, bg = "white", res = 96, restoreConsole = TRUE )
2009 Oct 25
3
Importing data from text file with mixed format
Hi, I'm having difficulty importing my textfile that looks something like this: #begin text file Timepoint 1 ObjectNumber Volume SurfaceArea 1 5.3 9.7 2 4.9 8.3 3 5.0 9.1 4 3.5 7.8 Timepoint 2 ObjectNumber Volume SurfaceArea 1 5.1
2005 Jun 15
2
Plotting second axes outside xyplot
Hi all, I'm trying to find a way to get xyplot to produce a second set of axes outside the right hand side of the graph. This is my progress so far: EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) prepanel.loess(x, y, span = 1), xlab = "Compression Ratio", ylab = "NOx (micrograms/J)",
2008 Apr 28
2
F values from a Repeated Measures aov
Hi Folks, I have repeated measures for data on association time (under 2 acoustic condtions) in male and female frogs as they grow to adulthood (6 timepoints). Thus, two within-subject variables (Acoustic Condition: 2 levels, Timepoint: 6 levels) and one between-subject variable (Sex:male or female). I am pretty sure my distributions depart from normality but I would first like to simply run a
2011 May 31
1
Issue with opening NoX thanks to OpenGL. (on a VPS)
So we got an Ubuntu 10.10 VPS, and go there with SSH putty, working with Xming as X server. This is what we did so far, to host a dedicated nox server. Code: apt-get update sudo apt-get install wine sudo apt-get install xorg wget *noxinstall url* unzip noxinstall.zip wine NoxInstall.exe (an installer and we put it in /root/Nox/) Wine wouldn't recognice a CD, so a crack gets installed
2010 Feb 25
2
error using pvcm() on unbalanced panel data
Dear all I am trying to fit Variable Coefficients Models on Unbalanced Panel Data. I managed to fit such models on balanced panel data (the example from the "plm" vignette), but I failed to do so on my real, unbalanced panel data. I can reproduce the error on a modified example from the vignette: > require(plm) > data("Hedonic") > Hed <- pvcm(mv ~ crim + zn + indus
2010 Jul 12
2
Xyplot or Tin-R problem?
I ran the following script from xyplot Examples using Tin-R on Windows and saw no plot produced. EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data=ethanol, prepanel = function(x,y) prepanel.loess(x, y, span=1), xlab="Compression Ratio", ylab="NOx (micrograms/J)", panel = function(x,y) { panel.grid()(h = -1, v=2)
2010 Sep 16
1
ANOVA - more sophisticated contrasts
dear list, i am using a multifactorial design with two treatments (factor A: drugs, three levels; factor B: theraphy, two levels) and a time factor (three levels, different timepoint). hypothetically, i measured the same subjects for all treatements and timepoints, so its a repeated measurement design. now i ran an anova in R and also some Tukey post-hoc tests using glht. but what i am actually
2009 Sep 02
2
Average over data sets
Hello, I have a number of files output1.dat, output2.dat, ... , output20.dat, each of which monitors several variables over a fixed number of timepoints. From this I want to create a data frame which contains the mean value between all files, for each timepoint and each variable. The code below works, but it seems like I should be able to do the second part without a for loop. I played
2012 Nov 16
1
Split data frame and create a new column
I need to split a data frame into 3 columns. The column I want to split contains indices of lag (prefix L1 or L2 and suffix 01, 03, 04), station name (shown in the sample data as capitalized G, P and S) and pollutant name. Names with no ?L? prefix or 01/04 suffix are lag 0. Lag 01 is average of lag 0 and 1, and 04 is average of 0 to 4 days. How can one do that in R? I will ignore the other
2001 May 14
0
followup: lookup function for density(...) objects
Thanks to Ross Ihaka and Bob Wheeler for responding to my earlier question. I looked into the Johnson system functions in SuppDists package. For now, I want to stick with the density(...) estimator, and so still need the variate lookup function. As per Ross' suggestion, I just did a numerical integration on the density object and used approxfun/splinefun to "lookup" the variate
2003 Mar 24
2
Problem with the step() function
Dear all, I'm having some problems with using the step() function inside another function. I think it is an environment problem but I do not know how to overcome it. Any suggestions are appreciated. I've prepared a simple example to illustrate my problem: > library(MASS) > data(Boston) > my.fun <- function(dataset) { + l <- lm(medv ~ .,data=dataset) + final.l <-
2010 Sep 19
1
boyplots nearly identical but still highly significant effect?
dear list, i am running a within-design ANOVA with 4 factors (4,4,2 and 2 levels each). the last one is a time factor comprising two different treatment timepoints. i fit a mixed-effects model using lme and apply the anova function to the outcome. according to this analysis, there are highly significant main effect on the first and the time factor. i then checked the boxplots for the two 4-level
2014 Jul 14
2
cummax / cummin for complex numbers
Dear all, in R 3.1.0, this is happening: > cummin(c(1+1i,2-3i,4+5i)) Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 'cummax' not defined for complex numbers > cummax(c(1+1i,2-3i,4+5i)) Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 'cummin' not defined for complex numbers It may be fixed in R-devel, but I thought I'd mention it to make sure
2008 Oct 07
1
Mac crash- Probably memory problem
Dear all, I am running a code using bootstraps for estimating standard errors but the mac crashes. When I use small number of bootstraps (100) it works fine but if I increase that number it crashes. Thanks in advance dimitris The code, the error and my mac characteristics are the following: ##############code##################### qr.1<- rq(y~factor(year)+factor(state)+x1+I(x^2)+I(x^3),