knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(mosaic)
library(purrr)
library(lubridate)
df_apply <- function(.data, execution, condition, .else, ...){
  .data |>
    lapply( function(x) if(condition(x)) execution(x) else .else(x)) %>%
    as.data.frame()
}

#
df_apply(iris, round, is.numeric, toupper)
n <- 7L
TestData <- tibble(
  double = rnorm(n, 100),
  x = 123400/10^(1L:n),
  integer = (1L:n)*(1L:n),
  character = LETTERS[1L:n],
  factor = factor(letters[1L:n]),
  logical = rep(c(TRUE, FALSE), length.out = n)
)
library(devtools)
packageVersion('devtools')
create_package("FunctionPkg")


haoping-he/FunctionPkg documentation built on April 14, 2022, 10:46 a.m.