Skip to content

Conversation

hfrick
Copy link
Member

@hfrick hfrick commented Jun 1, 2021

Closes #507

This PR exports convert_form_to_xy_fit() and convert_form_to_xy_new() so they can be used in parsnip-adjacant packages like censored.

Should this also export convert_xy_to_form_fit() and convert_xy_to_form_new()? The former has a # TODO slots for other roles comment which makes me think maybe not yet?

Should this go into the NEWS file?

@hfrick hfrick requested a review from topepo June 1, 2021 11:10
@DavisVaughan
Copy link
Member

I think I would prefix these functions with a . like .convert_*() to emphasize that they are not for general usage. Also mark them as @keyword internal. If we add a NEWS bullet (which I feel can be useful for our own tracking purposes), I would make sure it mentions that these are for developer usage.

@hfrick hfrick requested a review from DavisVaughan June 2, 2021 10:48
R/convert_data.R Outdated
#' @importFrom stats .checkMFClasses .getXlevels delete.response
#' @importFrom stats model.offset model.weights na.omit na.pass
.convert_form_to_xy_fit <- function(formula,
data,
Copy link
Member

Choose a reason for hiding this comment

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

The indentation got slightly off from the .. Ditto for the other exported functions

Copy link
Member Author

Choose a reason for hiding this comment

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

good spot! I've fixed it and ran styler of the functions in general

R/convert_data.R Outdated
.convert_form_to_xy_fit <- function(formula,
data,
...,
na.action = na.omit,
Copy link
Member

Choose a reason for hiding this comment

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

So we omit for modeling, but pass for prediction? I guess this is probably right. VS passing for both

@hfrick hfrick merged commit af3e0ae into master Jun 4, 2021
@hfrick hfrick deleted the export-convert-functions branch June 4, 2021 16:15
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export convert_form_to_xy_*() functions
2 participants