Reputation: 23
I want to rbind
and object called old_dat
to main data object called dat
only if it exists, otherwise dat
remains unchanged.
old_dat
is created using a separate function.
I have tried the following two methods:
dat<- ifelse(exists("old_dat", envir = .GlobalEnv),
rbind(dat,old_dat),dat)
and
exists("old_dat") && dat<- rbind(dat,old_dat)
Upvotes: 2
Views: 3828