[R] compatibility between R 2.7.0 and 2.8.1

2009-06-01 Thread Rheannon
Hello, I have some R code that I wrote with version 2.8.1 and have since needed to revert back to version 2.7.0 in order to run my R code with RPy for Python. R version 2.7.1 is the latest version RPy supports. My issue is my code is no longer running properly and I was hoping someone might be ab

[R] sum each row and output results

2008-07-23 Thread Rheannon
Hello, I have the following data frame (DF): V5V5.1V5.2 V5.3 V5.4 V5.5 2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 3 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 4 -5890.18905 -6019.84665 -6211.06

Re: [R] how to speed up this for loop?

2008-07-22 Thread Rheannon
Here is the full code: R <- 5328 #Temp is a temperature file with daily temp. values for each day of the year, for 5328 locations Temp <- rnorm(100) dim(Temp) <- c(365,5328) # transpose temp dataframe in order to perform rollmean (running mean) on proper data section Temp_T <- t(Temp) library(zoo

[R] how to speed up this for loop?

2008-07-22 Thread Rheannon
Could anyone tell me a better way to achieve the output of this for loop? It seems to run quite slow. I'm sure there must be a more consise way to sum from FN to LN, excluding positive values, for each row. #sum between FN and LN, excluding positive values for(i in 1:R){ for(j in FN[i]:LN[i]){ if

[R] Row Sum, exclude positive values

2008-07-15 Thread Rheannon
Hello, I'd like to sum the values of a row from the first negative number (FN) to the last negative number (LN), but not add any positive values to the sum. Then apply this to each row of the data frame. For example if I have a dataframe with Row 1 values DF = (4, 3, 2, 1, 0, -1, -2, -3, -2, 2,

[R] long data frame selection error

2008-07-14 Thread Rheannon
Hello, I am trying to select the following headers from a data frame but when I try and run the command it executes halfway through and give me an error at V188 and V359. Temp <- data.frame(V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V2

[R] While loop

2008-07-11 Thread Rheannon
r in a variable Start <- i I am getting a scripting out of bounds error and I suspect maybe the loop isnt stoping at the end of the matrix? Any help is greatly appreciated! Cheers, Rheannon -- View this message in context: http://www.nabble.com/While-loop-tp18408462p18408462.html Sent from

[R] rollmean()

2008-07-09 Thread Rheannon
a 31 day running mean along the 365 days. I am new to R so any help would be greatly appreciated! Thanks alot, Rheannon -- View this message in context: http://www.nabble.com/rollmean%28%29-tp18366044p18366044.html Sent from the R help mailing list archive at Nabble.com