ewenharrison / finalfit Goto Github PK
View Code? Open in Web Editor NEWQuickly create elegant regression results tables and plots when modelling in R
Home Page: https://finalfit.org/
License: Other
Quickly create elegant regression results tables and plots when modelling in R
Home Page: https://finalfit.org/
License: Other
Hello,
thank you very much for your package. Do you have any plan for allowing the use of interactions in models?
For finalfit
, there are displayed even if variable names are not formatted. For or_plot
, they simply disappear on the plot.
finalfit(colon_s, "mort_5yr", "age.factor * sex.factor")
or_plot(colon_s, "mort_5yr", "age.factor * sex.factor")
Hi Ewan,
Once again, great package which continues to prove itself as being extremely useful.
I would like to produce an HR plot using the pooled coxph results from mice::pool()
via the coxfit
option in hr_plot
.
I have been able to the same in a separate OR plot via glmfit = fits_pool
as per your example, but I cannot find a way to make the same work for the HR plot.
It gives the error; "object 'HR' not found" - it seems possibly to do with coxfit calling on fit2df looking for an estimate name 'HR'??
survcomp::forestplot.surv
uses a set of user-specified vectors as its input, which would work, but the format is not as nice and I would rather keep it all in finalfit if possible.
Any suggestions would be appreciated.
Cheers,
Kai
Dear developers,
I went through the code but could not find an option for this.
It would be nice to have hypothesis test names of corresponding p-values as a footnote when using summary_factorlist.
Best wishes.
First, thanks for the great tool!
I guess univariate results are not the proper ones to show in a forest plot but I would like to see the comparison between both univariate and multivariate. Could it be possible to add an option to this in hr_plot
? As a quick workaround I guess it could be easy to parse coxphuni
table as a source for hr_plot
, right?
Also, I was wondering how subgroups could be plotted in the same forest plot. Something like I have HR for the whole cohort and then HR for specific subgroups (treatment A and treatment B). Would be great to have them all plotted in the same image. Something like this or this
Amazing package!
In some areas, it is getting more common to present confidence intervals without P-values.
Would be great to have an argument P which will omit the p-values if it is set to FALSE.
Currently, I use the following workaround:
fit.pois = df %>%
glmmulti("count", c("a","b"), family = poisson, offset=(log(df$pop))) %>%
fit2df(estimate_name = "Incidence risk ratio", digits =c(2,1,0))
fit.pois$Incidence risk ratio
<- gsub(", p[=<]1", "", fit.pois$Incidence risk ratio
)
All the best
Jan
P.S: another workaround would be to set confint_level = 0.95000001
Is it possible to include variable, which name contains "forbidden" characters like white space and inside backticks? This code:
> dt<-data.frame(
+ y=factor(c('yes','yes','yes','no','no','no')) ,
+ x1=c(1,3,5,2,4,6),
+ `second x`=c(1,2,4,6,5,3),
+ check.names=F
+ )
>
> finalfit(dt,
+ dependent='y',
+ explanatory=c('x1', '`second x`'))
Produces this:
Dependent: y no yes OR (univariable) OR (multivariable)
3 x1 Mean (SD) 4.0 (2.0) 3.0 (2.0) 0.70 (0.20-1.83, p=0.485) 0.50 (NA-2.97, p=0.600)
2 second x Mean (SD) 4.7 (1.5) 2.3 (1.5) - -
1 <NA> <NA> <NA> <NA> 0.30 (0.02-1.07, p=0.183) 0.22 (NA-1.08, p=0.347)
Hi Ewen.
I am a physician and want to state your Amazing job with Finalfit.
I was wondering. Is it easy to include conditional bold formatting for significative P-values for HTML or word output?
When you try to do this through kableextra-conditional formatting it is not possible because the table results from finalfit are dataframes without some column names.
Or do you know an easy way to do this ?
Regards,
Great Job !
Hello,
Thanks for the great package!
Is there an option remove the "0" row or the "No" row via the finalfit function? I use a lot of binary variables, and it would be nice just to show the row for the "1" or "Yes".
For example, in the picture above, having "Female" "1" "12888 (41.3)" "972 (44.7)" "1.15 (1.05-1.25, p=0.002" "1.15 (1.05-1.25, p=0.002" all in the same row with no row with "0" or "-".
Would it be difficult to incorporating weighting into this package? This would be incredibly helpful for both administrative datasets as well as propensity score matching reporting. Thanks!
When computing p-value with summary_factorlist()
and using ff_percent_only()
, p-values are transformed into NA
explanatory = c("age", "age.factor", "sex.factor", "obstruct.factor")
dependent = "perfor.factor"
colon_s %>%
summary_factorlist(dependent, explanatory, p=TRUE) %>%
ff_percent_only()
label levels No Yes p
1 Age (years) Mean (SD) 59.8 (11.9) 58.4 (13.3) 0.578
2 Age <40 years 7.5 7.4 <NA>
3 40-59 years 37.0 37.0 <NA>
4 60+ years 55.4 55.6 <NA>
5 Sex Female 47.9 48.1 <NA>
6 Male 52.1 51.9 <NA>
7 Obstruction No 81.2 63.0 <NA>
8 Yes 18.8 37.0 <NA>
The problem is maybe that you remove the number of observations after the computation of summary_factorlist()
and it could be difficult to consider all the different use scenarios.
Maybe, it could be easier to consider instead an option directly within summary_factorlist()
indicating how n and % should be presented? For allowing an high flexibility, you could use the syntax of str_glue()
. For example an argument cat_format
with default value equal to "{n} ({percent})"
. It would be very easy for users to adapt the output.
Is it currently possible/are there any plans to make it possible to include more than one random effect in mixed model outputs?
Hi,
Normally you would write this to change a continuous variable to have the median reported:
colon_s %>%
summary_factorlist(dependent, explanatory, p = TRUE, cont = "median") -> t
However, when writing code for a logistic regression there doesnt seem to be the ability to put cont = "median" into it.
Looks like (at least) finalfit_internal_functions use tabs for alignment and that breaks viewing files on github.
ff_row_totals()
does two things: it adds row totals and the number of missing values. But sometimes, you do not need to present missing values (or you do not have them).
It could be worth therefore to have instead two functions ff_row_totals_without_missing()
and ff_row_totals_with_missing()
.
Best regards
Hi, I am currently conducting an analysis of missing data for my MA dissertation using the finalfit
package. I am having some issues with the function missing_compare
. I have posted a full description here. ff-glimpse
, missing_pairs
and finalit
functions do actually work.
Anyway, my code is the following
explanatory_edu <- c("ch_edu", "a4g")
dependent <- "br"
sl_cfa %>%
missing_compare(dependent, explanatory_edu)
and I am getting the following error message
> sl_cfa %>%
+ missing_compare(dependent, explanatory_edu)
Error in factor(g, levels = unique(g)) : object 'g' not found
All three variables are dichotomous factors without labels
> str(sl_cfa$br)
Factor w/ 2 levels "0","1": NA 2 2 1 1 NA 2 2 1 1 ...
> str(sl_cfa$ch_edu)
Factor w/ 2 levels "0","1": 1 2 NA 1 1 NA 1 1 2 1 ...
> str(sl_cfa$a4g)
Factor w/ 2 levels "0","1": NA 1 NA NA NA NA 1 2 1 2 ...
Would you consider supporting nlme
/lme
models in the nlme
library? (It appears that you already support nlmer
and lmer
models.)
Thank you for the package :)
There is a package collection like yours here: https://github.com/leeper/tttable I thought you may be interested in.
Best wishes
This interferes with picking up interactions. Write in error.
Hello,
I noticed that the builds on Travis take quite some time as do the local checks. For instance:
checking examples (4m 9.9s)
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
ff_permute 37.63 0.14 54.54
finalfit 22.25 0.09 26.56
ff_remove_ref 10.01 0.04 11.97
ff_plot 9.39 0.06 13.00
ff_merge 7.47 0.05 8.33
or_plot 7.43 0.08 8.89
boot_predict 7.17 0.32 8.93
dependent_label 7.02 0.14 9.23
fit2df 6.19 0.11 6.50
ff_stratify_helper 5.08 0.04 5.86
hr_plot 4.58 0.06 5.24
surv_plot 3.31 0.40 5.33
Is there a way to speed these up?
Secondly, I noticed that some code is quite repetitive and was wondering whether helpers could be written for these and perhaps this might reduce the execution time(especially for the multiple apply
calls).
Thank you,
Nelson
It would be nice to have NAs in column containing parameter values when condense=F. Now we have "-" there which forces this column to be of character
type instead of (desired) numeric
.
It seems that variable colon_s
is not included in the package.
Is it possible to see how colon_s looks like?
Thanks a lot.
Tien-Cheng.
Hi,
I'd like to thank you for your finalfit package, I had started by myself for Cox and GLM, but your routine is so nicely done with the graphic representation that I couldn't compete and I adopted it!
I got an issue with the followings missing_compare() and finalfit(), while having no problems with missing_plot():
test
pa02 | p.f | hte_conc_o2 | VM | ICU | surv_d90 | |
---|---|---|---|---|---|---|
1 | 6.1 | 218 | yes | yes | yes | 1 |
2 | 9.3 | 332 | yes | no | yes | 0 |
3 | 7.3 | 261 | no | no | no | 0 |
4 | NA | NA | yes | yes | yes | 0 |
5 | NA | NA | yes | no | yes | 0 |
6 | NA | NA | yes | no | yes | 0 |
7 | NA | NA | no | no | no | 0 |
8 | 10.7 | 382 | yes | no | yes | 0 |
9 | NA | NA | yes | yes | yes | 1 |
10 | 6.8 | 243 | yes | yes | yes | 0 |
When I use the finalfit(dependent,explanatory) for every variable I got no problem, for instance:
test%>%finalfit("surv_d90","ICU")
Dependent: | surv_d90 | 0 | 1 | OR (univariable) | OR (multivariable) | |
---|---|---|---|---|---|---|
ICU | no | 128 (89.5) | 15 (10.5) | - | - | |
yes | 99 (59.3) | 68 (40.7) | 5.86 (3.24-11.22, p<0.001) | 5.86 (3.24-11.22, p<0.001) |
I can create a loop that goes through all the explanatory variables, without fatal error, but when I use the finalfit() or missing_compare() code for all explanatory variables:
Error: Tibble columns must have consistent lengths, only values of length one are recycled:
p
explanatory
, estimate
, confint[, 1]
, confint[, 2]
rlang::last_error()
to see where the error occurred.I've tried to implement the data.frame as Tibble was involved, without succes either
test%>% data.frame%>% finalfit("surv_d90",explanatory)
Thank you for your help, and sorry if I missed some important point!
benoit
Would you consider making the total_col
argument of the summary_factorlist()
function work for numeric variables? So far, this argument works for factors (and maybe character vars) only. Thanks in advance, Norbert
data %>%
finalfit(dependent, explanatory, dependent_label_prefix = "") -> table
table %>%
knitr::kable(row.names = FALSE, align=c("l", "l", "c", "c", "l", "l"), booktabs = TRUE) %>%
kableExtra::kable_styling(latex_options = c("scale_down"))
When I add the "metrics = TRUE" term to finalfit function, this code is no longer able to knit to a pdf in R Markdown, but without it, I can.
It gives the error "LaTex Error: Not in outer par mode." I am on a mac and am using MacTex.``
Hi Ewan,
Is it possible to export the results of or_plot()
as a .png?
I am working in the safe haven so not writing reports/thesis in there but exporting all plots/tables and embedding them in .pdf manually (I know!!).
Anyhow, when I try....(reprex
won't let me change the plot width so a bit squashed here, but my actual plot looks ok)
library(finalfit)
explanatory <- c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent <- 'mort_5yr'
colon_s %>%
or_plot(dependent, explanatory)
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Waiting for profiling to be done...
#> Warning: Removed 4 rows containing missing values (geom_errorbarh).
Created on 2019-03-05 by the reprex package (v0.2.1)
...and then
library(ggplot2)
ggsave(filename = "or_plot_test.png", width = 9, height = 6.75, dpi = 600)
Created on 2019-03-05 by the reprex package (v0.2.1)
....The resulting .png looks like.....
I've tried fiddling with widths and heights etc. Is there anything else I could do to get the plot to render correctly in the .png??
Edit - I just tried exporting to .pdf instead with the same results
Just an additional feedback from the teaching session I just had recently: for a binary dependant variable, we do not need to have percentage for both 'yes' and 'no' level. It could be useful to have an option in summary_factorlist()
to not display the columns of the reference level of the dependent variable.
Best regards
I've been using finalfit to create a summary stats table (i.e., table 1) and it's great. I've been looking through the very helpful online vignettes for an option to report summary stats for dummies / logicals with a percent rather than n, however, and haven't been able to find anything. For example, rather than reporting both male and female levels, just one row with percent female would suffice and, in many cases, be more easily interpreted by the reader. Did I miss something or perhaps this could be added in the future?
Hi Ewen,
Firstly, thank you for a great package and tailoring your vignettes to a clinical research context. As a surgeon/scientist I have found them to be extremely useful.
I did however perform some crosschecking on some of my own data (no missing values) and found that the p-values on my stratified "table 1" formed by summary_factorlist()
(for both ChiSq and Fishers) did not match the results given by the base R commands; chisq.test()
and fisher.test()
.
What command does summary_factorlist()
call behind the scenes to possibly explain this discordance?
Secondly, is there anyway to specify which factor variables to apply to the option catTest = catTestfisher
(similar to the TableOne package)?
Kind regards,
Kai
Just a comment regarding function such as ff_column_totals()
or ff_row_totals()
:
To facilitate the use of these functions, it could be relevant that summary_factorlist()
adds to the output some attributes (using attr()
) to store dependent and explanory variables as well as the name of the dataset. Therefore, functions as ff_row_totals()
could, as default values, directly read these attributes.
Hello,
I think, it would be nice to have option to include quartiles along with median (instead of IQR).
IQR tells little about location of "middle half" of data, whereas quartiles do.
I mean something like Median (Q1-Q3) e.g. 20.7 (14.5-22.5).
What do you think?
Regards, and thanks for great work,
Lukasz
Hi,
I am using your package
I have a problema running
explanatory = c("x")
dependent = 'mort_5yr'
colon_s %>%
summary_factorlist(dependent, explanatory,
p=TRUE, add_dependent_label=TRUE)
if I use a numeric variable "x" with less than 6 values, the variable is considered as factor, and the test is a Chi-square, not a t-test
can you help me, please?
thank you very much in advance for your attention, and for your great package!
Please see the difference in output between these two:
colon_t = data.frame(ind1 = c(1, 2, 3, 4, 5), ind2 = c(0, 1, 0 ,1 ,0), dep = c(0,1,2,0,1))
colon_t %>% mutate(
dep.factor = factor(dep, levels = c(0, 1, 2))
) -> colon_t
colon_t %>% or_plot("dep.factor", c("ind1", "ind2"))
colon_u = data.frame(ind1 = c(1, 2, 3, 4, 5), ind2 = c(0, 1, 0 ,1 ,0), dep = c(0,1,0,0,1))
colon_u %>% mutate(
dep.factor = factor(dep, levels = c(0, 1))
) -> colon_u
colon_u %>% or_plot("dep.factor", c("ind1", "ind2"))
Is it just me not knowing how statistics work, or is there some bug here?
I came across this whilst working in the safe haven and have reproduced here with mtcars
This works fine:
library(finalfit)
library(tidyverse)
mtcars$am <- factor(mtcars$am)
explanatory = c("cyl", "hp", "wt")
dependent = "am"
mtcars %>%
finalfit(dependent, explanatory) -> tab_1
tab_1
But if I try this: (without directly loading Hmisc
)
Hmisc::label(mtcars$cyl) = "Cylinders"
Hmisc::label(mtcars$hp) = "Horsepower"
Hmisc::label(mtcars$wt) = "Weight"
Hmisc::label(mtcars$am) = "Auto or Manual"
explanatory = c("cyl", "hp", "wt")
dependent = "am"
mtcars %>%
finalfit(dependent, explanatory) -> tab_1
tab_1
I get the follwoing error
Error: `x` and `labels` must be same type
I'm sure the error was different in the safe haven, something like
Error: "x" must be either numeric or
something else that I can't remember (sorry)
When total_col = TRUE
in summary_factorlist()
, continuous variables are reported as NA rather than the mean (SD).
Hi Ewen.
Is there a way to obtaining a demographic table without stratification?
Am I omitting something from the guide? Maybe ff_merge
Regards,
Hi,
Using finalfit::coxphmulti(), is it possible to pass additional parameters to the underlying survival::coxph() function, in particular the "weights" argument? The use case would be running a survival model for a population that is already balanced between treatment vs. control groups using inverse probability of treatment weighting.
Thanks.
Hello. Your finalfit package is very nice. I very often use this package. Thank you!
Today, I updated this package to ver. 1.00.
I used na_to_p = FALSE
option because I didn't use missing values to statistical tests.
But calculated fisher P included missing values.
Next, using dependent_label_prefix = ""
option resulted in excluding missing for some reason.
After upgrading to the development version of dplyr , finalfit throws an error.
> b %>%
+ finalfit(dependent, explanatory, metrics=TRUE) -> t_log
Error: Predicate functions must return a single `TRUE` or `FALSE`, not a logical vector of length 0
The code was working perfectly just before I upgraded. I also updated to the development version of finalfit from github within the last hour or so (seeing a mention of dplyr-problems).
> rlang::last_trace()
<error/rlang_error>
Predicate functions must return a single `TRUE` or `FALSE`, not a logical vector of length 0
Backtrace:
█
1. └─b %>% finalfit(dependent, explanatory, metrics = TRUE)
2. ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
3. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
4. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
5. └─`_fseq`(`_lhs`)
6. └─magrittr::freduce(value, `_function_list`)
7. ├─base::withVisible(function_list[[k]](value))
8. └─function_list[[k]](value)
9. └─finalfit::finalfit(., dependent, explanatory, metrics = TRUE)
10. ├─base::do.call(finalfit.glm, args)
11. └─(function (.data, dependent, explanatory, explanatory_multi = NULL, ...
12. └─finalfit::summary_factorlist(...)
13. └─`%>%`(...)
14. ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
15. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
16. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
17. └─finalfit:::`_fseq`(`_lhs`)
18. └─magrittr::freduce(value, `_function_list`)
19. └─function_list[[i]](value)
20. └─purrr::keep(., ~.x < cont_cut)
21. └─purrr:::probe(.x, .p, ...)
22. └─purrr::map_lgl(.x, .p, ...)
23. └─purrr:::.f(.x[[i]], ...)
In summary_factorlist()
, if missing data rows are reported for categorical data, the P-value comparing 2 groups treats this as an additional level. Is it possible to report the missing data, without changing the P-values?
I've noticed that in recent versions of finalfit (at least 1.0.1), quantitative variables (eg AGE) don't appear in hr_plot when I set the remove_ref option to TRUE, but do appear when remove_ref is set to FALSE.
Did I miss something ?
Sincerly yours
Romuald Riem
Let's create toy dataset:
set.seed(1)
dat<-data.frame(
y=rnorm(10),
x1=gl(2,5, labels=c("A","B")),
x2=(1:10)
)
And use finalfit
with y
as dependent variable:
dat %>% finalfit.lm(dependent = 'y', explanatory = c('x1','x2'))
Dependent: y Mean (sd) Coefficient (univariable) Coefficient (multivariable)
1 x1 A 0.4 (0.8) - -
2 B -0.4 (1.1) -0.84 (-2.24 to 0.56, p=0.205) -2.19 (-4.99 to 0.60, p=0.106)
3 x2 [1,10] 0.0 (1.0) -0.06 (-0.33 to 0.21, p=0.610) 0.27 (-0.22 to 0.76, p=0.230)
So far so good. But when I make x2
non-integer, the same code fails:
set.seed(1)
dat<-data.frame(
y=rnorm(10),
x1=gl(2,5, labels=c("A","B")),
x2=(1:10)/10
)
dat %>% finalfit.lm(dependent = 'y', explanatory = c('x1','x2'))
Error in if (cj == upper) next : missing value where TRUE/FALSE needed
I tried several other integer and non-integer expalnatory variables. Results are the same.
What am I missing?
Hi,
Am fairly frustrated right now because I keep getting this error:
finalfit(temp,temp$diff_secs_num,as.numeric(temp$call.length))
Error in summary_factorlist(.data, dependent, explanatory, p = FALSE, :
Dependent variable length is 0
In addition: Warning message:
In if (!d_is.factor & !d_is.surv) { :
the condition has length > 1 and only the first element will be used
As you see here, the dependent is not 0:
length(temp$diff_secs_num)
[1] 1290113
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.00 1.00 2.00 54.77 14.00 2996.00
It is possible to write 👍
library(finalfit)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"
colon_s %>%
finalfit(dependent, explanatory, confint_level = 0.90) -> t
but it is not possible to write::
colon_s %>%
or_plot(dependent, explanatory, confint_level = 0.90)
because L_95 is harcoded into the function.
Thanks.
In the documentation, the logistic regression with reduced model output is said to contain "a multivariable model contains a subset of the variables included specified in the full univariable set."
This use of language is odd, because univariable typically means that there is only one explanatory variable, whereas multivariable means that there are several explanatory variables (Tsai, 2013).
Would it be helpful to change this terminology or allow users to alter the default language?
When making a table using a summary_factorlist()
, I passed a large list of explanatory variables, and the function threw and error because one of the variables had zero events in all arms. Is there a way to still include this variable in the table? Or at the very least throw an informative error message so it is clear which variable is causing the problem?
Is it possible to have an option to report standardized differences instead of P-values? I am thinking about propensity score matching situations.
One of the methods that I often use for generating models in R is to make a list of candidate models and then evaluate which is the best to select as the final model by one or more metrics. For that, I've written an AIC
method that can compare lists of formula and put it into the PKNCA
package. It's not a good fit for the underlying goal of the package, and I'd like to find a better home for the function and a few related functions (AIC.list
, get.best.model
, and get.first.model
) as briefly described in billdenney/pknca#71.
Would you be interested in including functions (with tests) with a pull request that does the following?
AIC.list
: evaluate the AIC of a list of models.
AIC.logical
: to handle NA
in a list of models.AIC.NULL
: to handle NULL
in a list of models.get.best.model
: select the best model from a list of models by minimum AIC.get.first.model
: select the first model that converged from a list of models.I notice that some model estimates are calculated correctly but are not necessarily printed in the correct order whenever a unicode-expression is employed in one of the factor levels of a variable. This may not be an issue with your excellent package but may be worth taking note.
Here is a simple example:
colon_s <- colon_s %>% mutate(agege65= factor(if_else(age>=65,"\u2265 65 years","< 65 years")),
nodesge3 = factor(if_else(nodes>=3,"\u2265 3","< 3"))
)
explanatory = c("agege65","nodesge3","adhere.factor")
dependent = "Surv(time, status)"
colon_s %>%
finalfit(dependent, explanatory) -> t6
knitr::kable(t6, row.names=FALSE, align=c("l", "l", "r", "r", "r", "r"))
It appears that all estimates corresponding to variables with unicode expression are automatically placed at the bottom of the table. Do you know why this is happening? Any fix for it? If I remove the unicode expression, I am able to get the output in the correct place (but I do not get to keep the desired greater or equal mathematical notation).
Hi! Thanks for your package. I 've been using it a lot and it significantly improves my workflow
I (accidentally) stumbled upon this small issue and thought I would I'd let you know
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
mtcars_df <-
mtcars %>%
dplyr::select(mpg:disp) %>%
sjlabelled::set_label(
c("mileage", "cylinder","display")
)
mtcars_tb <-
mtcars %>%
tibble::as_tibble() %>%
dplyr::select(mpg:disp) %>%
sjlabelled::set_label(
c("mileage", "cylinder","display")
)
dplyr::lst(mtcars_df, mtcars_tb) %>% purrr::map(~ class(.))
#> $mtcars_df
#> [1] "data.frame"
#>
#> $mtcars_tb
#> [1] "tbl_df" "tbl" "data.frame"
mtcars_df %>% purrr::map(~ attributes(.))
#> $mpg
#> $mpg$label
#> mpg
#> "mileage"
#>
#>
#> $cyl
#> $cyl$label
#> cyl
#> "cylinder"
#>
#>
#> $disp
#> $disp$label
#> disp
#> "display"
mtcars_tb %>% purrr::map(~ attributes(.))
#> $mpg
#> $mpg$label
#> mpg
#> "mileage"
#>
#>
#> $cyl
#> $cyl$label
#> cyl
#> "cylinder"
#>
#>
#> $disp
#> $disp$label
#> disp
#> "display"
# REMOVE THE LABELS information and CHECK
mtcars_df %>%
finalfit::remove_labels() %>%
purrr::map(~ attributes(.))
#> $mpg
#> NULL
#>
#> $cyl
#> NULL
#>
#> $disp
#> NULL
mtcars_tb %>%
finalfit::remove_labels() %>%
purrr::map(~ attributes(.))
#> $mpg
#> $mpg$label
#> mpg
#> "mileage"
#>
#>
#> $cyl
#> $cyl$label
#> cyl
#> "cylinder"
#>
#>
#> $disp
#> $disp$label
#> disp
#> "display"
Created on 2019-10-23 by the reprex package (v0.3.0)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.