mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
plots new accept pri, sec and ter arguments instead of x,y,z to avoid confusion. tests, tests, tests
This commit is contained in:
parent
e463fa0670
commit
652a8ca1b7
28 changed files with 3275 additions and 179 deletions
|
|
@ -1,10 +1,10 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data_plots.R
|
||||
\name{allign_axes}
|
||||
\alias{allign_axes}
|
||||
\title{Alligns axes between plots}
|
||||
\name{align_axes}
|
||||
\alias{align_axes}
|
||||
\title{Aligns axes between plots}
|
||||
\usage{
|
||||
allign_axes(...)
|
||||
align_axes(...)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{ggplot2 objects or list of ggplot2 objects}
|
||||
|
|
@ -13,5 +13,5 @@ allign_axes(...)
|
|||
list of ggplot2 objects
|
||||
}
|
||||
\description{
|
||||
Alligns axes between plots
|
||||
Aligns axes between plots
|
||||
}
|
||||
|
|
@ -15,3 +15,7 @@ list
|
|||
\description{
|
||||
Idea from the answer: https://stackoverflow.com/a/62979238
|
||||
}
|
||||
\examples{
|
||||
argsstring2list("A=1:5,b=2:4")
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,4 +32,5 @@ Create a baseline table
|
|||
}
|
||||
\examples{
|
||||
mtcars |> create_baseline(by.var = "gear", add.p = "yes" == "yes")
|
||||
create_baseline(default_parsing(mtcars), by.var = "am", add.p = FALSE, add.overall = FALSE, theme = "lancet")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,13 @@ data.frame
|
|||
Filter function to filter data set by variable type
|
||||
}
|
||||
\examples{
|
||||
default_parsing(mtcars) |> data_type_filter(type=c("categorical","continuous")) |> attributes()
|
||||
default_parsing(mtcars) |>
|
||||
data_type_filter(type = c("categorical", "continuous")) |>
|
||||
attributes()
|
||||
default_parsing(mtcars) |>
|
||||
data_type_filter(type = NULL) |>
|
||||
attributes()
|
||||
\dontrun{
|
||||
default_parsing(mtcars) |> data_type_filter(type=c("test","categorical","continuous"))
|
||||
default_parsing(mtcars) |> data_type_filter(type = c("test", "categorical", "continuous"))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Deparses expression as string, substitutes native pipe and adds assign
|
|||
}
|
||||
\examples{
|
||||
list(
|
||||
as.symbol(paste0("mtcars$","mpg")),
|
||||
as.symbol(paste0("mtcars$", "mpg")),
|
||||
rlang::call2(.fn = "select", !!!list(c("cyl", "disp")), .ns = "dplyr"),
|
||||
rlang::call2(.fn = "default_parsing", .ns = "FreesearchR")
|
||||
) |>
|
||||
|
|
|
|||
|
|
@ -17,3 +17,6 @@ data.frame
|
|||
\description{
|
||||
Factorize variables in data.frame
|
||||
}
|
||||
\examples{
|
||||
factorize(mtcars,names(mtcars))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
\alias{line_break}
|
||||
\title{Line breaking at given number of characters for nicely plotting labels}
|
||||
\usage{
|
||||
line_break(data, lineLength = 20, fixed = FALSE)
|
||||
line_break(data, lineLength = 20, force = FALSE)
|
||||
}
|
||||
\arguments{
|
||||
\item{data}{string}
|
||||
|
|
@ -22,5 +22,5 @@ Line breaking at given number of characters for nicely plotting labels
|
|||
}
|
||||
\examples{
|
||||
"Lorem ipsum... you know the routine" |> line_break()
|
||||
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed = TRUE)
|
||||
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(force = TRUE)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,3 +15,12 @@ data of same class as input
|
|||
\description{
|
||||
Remove empty/NA attributes
|
||||
}
|
||||
\examples{
|
||||
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |> dplyr::bind_cols()
|
||||
ds |>
|
||||
remove_empty_attr() |>
|
||||
str()
|
||||
mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |> remove_empty_attr() |>
|
||||
str()
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/helpers.R
|
||||
\name{remove_na_attr}
|
||||
\alias{remove_na_attr}
|
||||
\title{Remove NA labels}
|
||||
\usage{
|
||||
remove_na_attr(data, attr = "label")
|
||||
}
|
||||
\arguments{
|
||||
\item{data}{data}
|
||||
}
|
||||
\value{
|
||||
data.frame
|
||||
}
|
||||
\description{
|
||||
Remove NA labels
|
||||
}
|
||||
\examples{
|
||||
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label"))
|
||||
ds |>
|
||||
remove_na_attr() |>
|
||||
str()
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
% Please edit documentation in R/helpers.R
|
||||
\name{remove_nested_list}
|
||||
\alias{remove_nested_list}
|
||||
\title{Very simple function to remove nested lists, lik ewhen uploading .rds}
|
||||
\title{Very simple function to remove nested lists, like when uploading .rds}
|
||||
\usage{
|
||||
remove_nested_list(data)
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ remove_nested_list(data)
|
|||
data.frame
|
||||
}
|
||||
\description{
|
||||
Very simple function to remove nested lists, lik ewhen uploading .rds
|
||||
Very simple function to remove nested lists, like when uploading .rds
|
||||
}
|
||||
\examples{
|
||||
dplyr::tibble(a = 1:10, b = rep(list("a"), 10)) |> remove_nested_list()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ Easily subset by data type function
|
|||
}
|
||||
\examples{
|
||||
default_parsing(mtcars) |> subset_types("ordinal")
|
||||
default_parsing(mtcars) |> subset_types(c("dichotomous", "ordinal" ,"categorical"))
|
||||
default_parsing(mtcars) |> subset_types(c("dichotomous", "ordinal", "categorical"))
|
||||
#' default_parsing(mtcars) |> subset_types("factor",class)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue