-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(package): ✨ Update package structure according to R CMD CHECK r…
…esutls. Helps to prepare the package for possible publication in the future.
- Loading branch information
1 parent
0256062
commit 849b2c2
Showing
17 changed files
with
2,196 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source("renv/activate.R") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
linters: linters_with_defaults( | ||
indentation_linter = indentation_linter(4) | ||
) # see vignette("lintr") | ||
encoding: "UTF-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Created by use_targets(). Follow the comments below to fill in this target | ||
# script. Then follow the manual to check and run the pipeline: | ||
# https://books.ropensci.org/targets/walkthrough.html#inspect-the-pipeline | ||
|
||
# nolint start: commented_code_linter, trailing_whitespace_linter. | ||
|
||
# Load packages required to define the pipeline: | ||
library(targets) | ||
# library(tarchetypes) # Load other packages as needed. | ||
|
||
# Set target options: | ||
tar_option_set( | ||
packages = c("tibble") # packages that your targets need to run | ||
# format = "qs", # Optionally set the default storage format. qs is fast. | ||
# | ||
# For distributed computing in tar_make(), supply a {crew} controller as | ||
# discussed at https://books.ropensci.org/targets/crew.html. Choose a | ||
# controller that suits your needs. For example, the following sets a | ||
# controller with 2 workers which will run as local R processes: | ||
# | ||
# controller = crew::crew_controller_local(workers = 2) | ||
# | ||
# Alternatively, if you want workers to run on a high-performance computing | ||
# cluster, select a controller from the {crew.cluster} package. The following | ||
# example is a controller for Sun Grid Engine (SGE). | ||
# | ||
# controller = crew.cluster::crew_controller_sge( workers = 50, # Many | ||
# clusters install R as an environment module, and you can load it # with | ||
# the script_lines argument. To select a specific verison of R, # you may | ||
# need to include a version string, e.g. "module load R/4.3.0". # Check | ||
# with your system administrator if you are unsure. script_lines = "module | ||
# load R" ) | ||
# | ||
# Set other options as needed. | ||
) | ||
|
||
# tar_make_clustermq() is an older (pre-{crew}) way to do distributed computing | ||
# in {targets}, and its configuration for your machine is below. | ||
# options(clustermq.scheduler = "multicore") | ||
|
||
# tar_make_future() is an older (pre-{crew}) way to do distributed computing in | ||
# {targets}, and its configuration for your machine is below. Install packages | ||
# {{future}}, {{future.callr}}, and {{future.batchtools}} to allow use_targets() | ||
# to configure tar_make_future() options. | ||
|
||
# Run the R scripts in the R/ folder with your custom functions: | ||
tar_source() | ||
# source("other_functions.R") # Source other scripts as needed. | ||
|
||
# Replace the target list below with your own: | ||
list( | ||
tar_target( | ||
name = data, | ||
command = tibble(x = rnorm(100), y = rnorm(100)) | ||
# format = "feather" # efficient storage for large data frames | ||
), | ||
tar_target( | ||
name = model, | ||
command = coefficients(lm(y ~ x, data = data)) | ||
) | ||
) | ||
# nolint end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!.gitignore | ||
!meta | ||
meta/* | ||
!meta/meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name|type|data|command|depend|seed|path|time|size|bytes|format|repository|iteration|parent|children|seconds|warnings|error | ||
.Random.seed|object|192e3abaec7d64a5||||||||||||||| | ||
data|stem|0d3f14a3a96b3ff8|43fae4011a0626f4|ef46db3751d8e999|1588979285||t19697.9230297838s|d07e2e962de596ec|1750|rds|local|vector|||0.006|| | ||
model|stem|1636c25df1da2510|ae83bc723fe2997c|5d1b10f263532bdf|1816327236||t19697.9230298995s|4bab66ba4bee4440|108|rds|local|vector|||0.003|| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Installation directory. | ||
SCRIPT_DIR="$(realpath "${0%/*}")" | ||
INSTALL_DIR="$(realpath "${SCRIPT_DIR}/../inst")" | ||
|
||
# Ensure installation directory exists. | ||
if [ ! -d "${INSTALL_DIR}" ]; then | ||
mkdir -p "${INSTALL_DIR}" | ||
fi | ||
|
||
# Copy files into the `inst/` directory. | ||
files=("_targets.R" "CHANGELOG.md" "CITATION" "CITATION.cff") | ||
|
||
for file in "${files[@]}"; do | ||
cp "${SCRIPT_DIR}/../${file}" "${INSTALL_DIR}/${file}" | ||
done | ||
|
||
# Run check. | ||
/usr/bin/R --no-echo --no-restore -e "devtools::check()" | | ||
tee rcmdcheck.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# This is a helper script to run the pipeline. | ||
# Choose how to execute the pipeline below. | ||
# See https://books.ropensci.org/targets/hpc.html | ||
# to learn about your options. | ||
|
||
targets::tar_make() | ||
# targets::tar_make_clustermq(workers = 2) # nolint | ||
# targets::tar_make_future(workers = 2) # nolint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# <!-- This file was auto-generated by `targets::use_targets()` --> | ||
|
||
# Submit the pipeline as a background process with ./run.sh | ||
# module load R # Uncomment if R is an environment module. | ||
nohup nice -4 R CMD BATCH ./../run.R & | ||
|
||
# Change the nice level above as appropriate | ||
# for your situation and system. | ||
|
||
# Removing .RData is recommended. | ||
# rm -f .RData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_targets.R | ||
CHANGELOG.md | ||
CITATION | ||
CITATION.cff |
Oops, something went wrong.