search for: wabarr

Displaying 5 results from an estimated 5 matches for "wabarr".

Did you mean: abar
2008 Sep 04
2
using complete.cases() with nested factors
Hello, This maybe a newbie question. I have a dataframe that looks like the sample at the bottom of the email. I have monthly precipitation data from several sites over several years. For each site, I need to extract years that have a complete series of 12 monthly precipitation values, while excluding that year for sites with incomplete data. I can't figure out how to do this gracefully
2010 Oct 06
3
Assigning value to a vector from within a function
Hi all, I am having trouble assigning a value within a vector using a variable defined within a function. I suspect this has something to do with namespaces but I cannot figure it out. Please reply directly to me if you can help. ###begin code #simple vector test<-c(4,5,6) #simple function to get a value from a vector #works just like I would expect, has no problem indexing using the local
2008 Sep 09
2
isolate elements in vector that match one of many possible values
Hi all, I want to get the index numbers of all elements of a vector which match any of a long series of possible values. Say x <- c(1,2,3,4) and I want to know which values are equal to 1, 2 or 4. I could do which(x == 1 | x==2 | x==4) [1] 1 2 4 This gets really ugly though, when the list of values of interest is really long. Is there a nicer way to do this? Something akin to the MySQL
2013 Feb 12
1
recovering from errors with lapply()
Hi all, I am searching for a way to recover results from lapply() when one or more values returns an error. I have a written a function that uses tryCatch() to recover from errors. Here is a very simple example of such a function. divideBy2<-function(X){ result<-tryCatch(X/2, error = function(e) "An Error Occurred") return(result) } This function appears to work as I expect
2009 Nov 20
3
help me avoid nested for() loops!
Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of interest in a jpeg image. I need to find the distance from each point to all other points of interest. The only way I can see to do this