Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use_data() improvements #948

Merged
merged 11 commits into from
Jan 21, 2016
Merged

use_data() improvements #948

merged 11 commits into from
Jan 21, 2016

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Oct 9, 2015

  • Helper functions
  • Unified code for data and sysdata
  • Warn if duplicated objects
  • Stop if no objects to save

@@ -399,40 +399,75 @@ use_data <- function(..., pkg = ".", internal = FALSE, overwrite = FALSE,
pkg <- as.package(pkg)

to_save <- dots(...)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hadley: Do you mind if I import lazyeval and implement a corresponding use_data_ function, as in 9d38ccc? The above seems to be the only remaining instance of dots().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem worth it to me - use_data() is purely for interactive use.

is_name <- vapply(to_save, is.symbol, logical(1))
if (any(!is_name)) {
stop("Can only save existing named objects", call. = FALSE)
}
}

get_objs_from_to_save <- function(to_save) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about integrating this with check_to_save()?

@krlmlr
Copy link
Member Author

krlmlr commented Jan 21, 2016

Inlined functions, merged master, added NEWS. I'd rather not rebase, because I have other internal branches based on this.

hadley added a commit that referenced this pull request Jan 21, 2016
@hadley hadley merged commit b86d258 into r-lib:master Jan 21, 2016
@hadley
Copy link
Member

hadley commented Jan 21, 2016

Thanks!

@krlmlr krlmlr deleted the use-data branch October 6, 2016 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants