search for: agg3

Displaying 3 results from an estimated 3 matches for "agg3".

Did you mean: agg
2011 Jan 26
1
aggregate(as.formula("some formula"), data, function) error when called from in a function
...nd then the error. The first function "agg2" fails > agg2(FALSE) do agg 2 Error in m[[2L]][[2L]] : object of type 'symbol' is not subsettable but, if I run it have it return what it is going to pass to aggregate and pass it myself, it works. I can use this for a workaround (agg3) where one function does this itself. I'm confused by the behavior. Is there some way to not have to use a separate function to make the call ? ====================== # start R code # idea: in a function, count the number of instances # of some factor (y) associated with another # factor (x)...
2012 Jun 05
4
need descriptive help
Hi all, I'm new to using R, and apologize for simplicity of this question. I'm using a data set with over 60,000 observations, Two variables are patient ID, and cost incurred by the patient. I'd like to generate frequency/table by patient and cost IF the total cost is over 2000. Right now I'm using: by(x$cost, x$patient, sum) but this generates a huge list for each patient.
2025 Jan 24
3
Interpreting the output of str on a data frame created using aggregate function
I ran the following code: marginalcats <- aggregate(meanbyCensusIDAndDay3$cats, list(meanbyCensusIDAndDay3$CensusID),table) followed by str(marginalcats) I received the following output: 'data.frame': 844 obs. of 2 variables: $ Group.1: num 6e+09 6e+09 6e+09 6e+09 6e+09 ... $ x : int [1:844, 1:7] 14 14 14 14 14 14 14 14 14 14 ... ..- attr(*,