Skip to content

Commit

Permalink
Merge pull request #657 from Crunch-io/default-new-ds-project-188559300
Browse files Browse the repository at this point in the history
[188559300]: add fork examples
  • Loading branch information
gergness authored Jan 14, 2025
2 parents 78be58c + 1c2aec4 commit c1c8f46
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/fork-and-merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ forks <- function(dataset) {
#' folder as the existing dataset.
#' @return The new fork, a `CrunchDataset`.
#' @seealso [mergeFork()]
#' @examples
#' \dontrun{
#' # Defaults to being placed in the same project folder as the original dataset
#' ds_fork <- forkDataset(ds)
#'
#' # But you can specify a project by path, `ProjectFolder` object or URL
#' ds_fork2 <- forkDataset(ds, project = "/Client1/forks/")
#' ds_fork3 <- forkDataset(ds, project = projects()[["My forks"]])
#' ds_fork4 <- forkDataset(ds, project = "https://app.crunch.io/api/projects/abc")
#' }
#' @export
forkDataset <- function(dataset, name = defaultForkName(dataset), draft = FALSE, ..., project = folder(dataset)) {

Check warning on line 43 in R/fork-and-merge.R

View workflow job for this annotation

GitHub Actions / test-coverage

file=R/fork-and-merge.R,line=43,col=101,[line_length_linter] Lines should not be more than 100 characters. This line is 114 characters.
## TODO: add owner field, default to self(me())
Expand Down
11 changes: 11 additions & 0 deletions man/forkDataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c1c8f46

Please sign in to comment.