On Sep 3, 2013, at 7:19 AM, Matt Strauser wrote:
> I have several data frames containing similar data. I'd like to pass these
> data frames to a function for processing. The function would create newly
> named "global" data frames containing the processed data. I cannot figure
> out how to assign
This is FAQ 7.21.
The most important part of that FAQ is at the end where it says it is best
not to do this and better to use lists. Having a function create
(overwrite) objects in the global environment is dangerous and can lead to
hard to find bugs. It would be better to have your function ret
Hi,
May be this helps you in getting started.
set.seed(29)
df1<- as.data.frame(matrix(sample(1:20,5*10,replace=TRUE),5,10))
cond<- c("V1eq2","V8eq2","V6eq4orV8eq7")
fun1<- function(df,prefix,cond){
lst1<- list(df[df$V1==2,],df[df$V8==2,],df[df$V6==4|df$V8==7,])
for(i in seq_along(cond)){
as
3 matches
Mail list logo