search for: tempobj

Displaying 2 results from an estimated 2 matches for "tempobj".

2012 Aug 03
2
Recursive function calls
..."recursive", but after wading though all the rpart references I didn't find something that seemed to help with this problem. Thank you very much. trim <- function(x) { if(length(x)>1) sapply(x[1], trim) gsub("^[[:space:]]+|[[:space:]]+$", "", x) } tempobj = ' many spaces ' tempvec = c(tempobj, tempobj) templist = list(tempvec, tempvec) tempdf = data.frame(x = tempvec, y = tempvec) trim(tempobj) trim(tempvec) trim(templist) trim(tempdf) Thank you, Gene Leynes _____________________________________________ *Data Scientist* *Mobile:...
2009 Jul 30
3
Looping through R objects with $ operator and tags
Hi all, Suppose I want to set the values in a column to the log of the values of another column like so: object$LogDist <- log10(object$Distance) How do I loop through the objects if I have object1, object2, etc to perform this function? object1$LogDist <- log10(object1$Distance) object2$LogDist <- log10(object2$Distance) object3$LogDist <- log10(object3$Distance) I was trying to