search for: obj_2

Displaying 1 result from an estimated 1 matches for "obj_2".

Did you mean: obj2
2012 Nov 27
1
Accumulate objects in list after try()
Hi, I have written a function "harvest" and I would like to run the function for each value in a vector c(1:1000). The function returns 4 list objects (obj_1, obj_3, obj_3, obj_4) using the following code at the end of the function: return(list(obj_1 = obj_1, obj_2 = obj_2, obj_3 = obj_3, obj_4 = obj_4)). Since I am connecting with the web in the function and the connection sometimes fails causing errors to occur, I invoke the function as follows: for(i in 1:1000){ result <- try(harvest(i)); if(class(result) == "try-error") next; } Every...