-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Decrease dependency #618
Comments
Yes, CRAN might complain but I don't think it's a deal breaker for the release on CRAN |
And now it's 31 packages : ) Imports includes 31 non-default packages.
Importing from so many packages makes the package vulnerable to any of
them becoming unavailable. Move as many as possible to Suggests and
use conditionally. |
One of my propositions is to either go with |
rmarkdown::html_dependency_bootstrap("default") Maybe this function can be copied to the package or we can put a |
How about the other way around? Core packages use |
We also have |
we should get rid of "%>%" all together. But I think we should do it |
|
We can create our own function for > rlang::is_empty
function (x)
length(x) == 0 and for dplyr::mutate(param_char := clean_description(.data[[param_char]])) |
Not only on this package, but we might consider re-exporting all functions from (or just a subset of those) |
Will try to prepare initial PR and let's see where we can go with the limitation |
the library(teal.modules.clinical)
data <-
tmc_ex_adlb %>%
dplyr::select(ADY, PARAMCD, PARAM, AVAL, AVALU, ANRIND) %>%
dplyr::arrange(ADY) %>%
dplyr::select(-ADY) %>%
dplyr::group_by(PARAMCD, PARAM) %>%
dplyr::mutate(INDEX = dplyr::row_number()) %>%
dplyr::ungroup() %>%
dplyr::mutate(aval_anrind = paste(AVAL, ANRIND)) %>%
dplyr::select(-c(AVAL, ANRIND))
data_pivot <-
data %>%
tidyr::pivot_wider(names_from = INDEX, values_from = aval_anrind)
data_reshape <-
data %>%
as.data.frame() %>%
reshape(
direction = "wide",
idvar = c("PARAMCD", "PARAM", "AVALU"),
v.names = "aval_anrind",
timevar = "INDEX"
)
colnames(data_reshape)[-c(1:3)] <- unique(data$INDEX)
attr(data_reshape, "reshape") <- NULL
attr(data_reshape, "reshapeWide") <- NULL
dim(data_pivot)
#> [1] 3 1003
dim(data_reshape)
#> [1] 3 1003
identical(
as.data.frame(data_pivot)[1:3, 1:1003],
data_reshape[1:3, 1:1003]
)
#> [1] TRUE Created on 2024-01-26 with reprex v2.1.0 Final objects just differ in terms of order of remaining attributes ( |
labor_table_raw <- labor_table_raw %>%
dplyr::mutate(param_char := clean_description(.data[[param_char]])) can be substituted with labor_table_raw[[param_char]] <- clean_description(labor_table_raw[[param_char]]) |
The same for anl <- anl %>% dplyr::mutate(`:=`(hlt, as.character(hlt))) to anl[[hlt]] <- as.character(anl[[hlt]]) and we can get rid of |
For |
@shajoezhu @pawelru @donyunardi would the split of |
Hey, a summary of the work for the reduction of dependencies is below
|
hi @m7pr , i am so glad you raise this again. I considered this back in 2021 for both tern, and tmc. for tern we have started doing some. but not exactly the split of table and graphs. for tmc, it is more complex, i would like to rethink, and consider merging teal.goshawk and teal.osperay before the new split |
This makes sense if they do not overlap. I believe there are a couple of tables with graphs, though; we need to check that those do not overlap with the function dep split. For the pkg names, we could make them more compact (e.g. |
I like |
My 2c in the discussion. I propose to:
Let's not distract ourselves with these topics. I'm very much looking forward for this PR to happen and I feel that discussing these here might introduce significant delays. |
Sure! |
Close #618 Moved from `Imports` to `Suggests` - `styler` d42dbfc because of #618 (comment) and usage in vignettes 8a9a80e Removed - `magrittr` 772cf9d because of #618 (comment) - `tidyr` e585e0a because of #618 (comment) and #618 (comment) - `rlang` f2c0bfd 04537f1 a94b84b because of #618 (comment) and #618 (comment) --------- Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: Davide Garolini <davide.garolini@roche.com> Co-authored-by: Davide Garolini <davide.garolini@roche.com>
Let us create an issue for the number of imports as cran will complain about it (similar to insightsengineering/teal.modules.general#456)
Originally posted by @mhallal1 in #602 (review)
The text was updated successfully, but these errors were encountered: