You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #117, it is sometimes helpful to augment the underlying data for plotting purposes.
Could a left_join() method be added that would allow that augmentation such as the following?
left_join.xpose_data<-function(x, y, by=names(y)[1], copy=FALSE, suffix=c(".x", ".y")) {
ret<-xfor (data_idxin seq_along(ret$data$data)) {
if (all(by%in% names(ret$data$data[[data_idx]]))) {
ret$data$data[[data_idx]] <-
left_join(x=ret$data$data[[data_idx]], y=y, by=by, copy=copy, suffix=suffix)
} else {
warning("Column(s) ", paste(by, collapse=", "), " does not exist in data for problem ", data_idx)
}
}
class(ret) <- class(x) # I think that this is needed because the xpose_data class doesn't have a $<- methodret
}
The only limitation I see with this code is that it doesn't assign variable types (and, it's an important limitation).
The text was updated successfully, but these errors were encountered:
@billdenney that is a good point it could be useful to enrich the data by merging it with data.frames. I will see what I can do. FYI I am also planing to bring many of the mutate_if, mutate_at, summarize_if, etc. in future updates.
By the way thanks for your comment about the $<- method I have used a work around xpdb <- as.xpdb(xpdb) (which is exported if you ever need to use it) but maybe your suggestion could be more elegant solution I will need to look into it.
Similar to #117, it is sometimes helpful to augment the underlying data for plotting purposes.
Could a
left_join()
method be added that would allow that augmentation such as the following?The only limitation I see with this code is that it doesn't assign variable types (and, it's an important limitation).
The text was updated successfully, but these errors were encountered: