Giter VIP home page Giter VIP logo

ptspotter's Introduction

PT Spotter version 1.0.1

CRAN status R build status Codecov test coverage CRAN RStudio mirror downloads R-CMD-check

For more guidance please see the ptspotter blog

Description

Helper functions for use with ProjectTemplate


Functions

  • 'adj_file_nos()': Increase or decrease scripts with numerical prefixes.
    Arguments:
    target: Required. The number in the sequential scripts to begin the adjustment. Use single digits only. The adjustment will affect script with that leading digit and greater.
    directory: The directory holding the sequential scripts to adjust.
    action: "up or "down". Defaults to "up". Whether to adjust file numbers up or down.
    step: Defaults to 1. The step by which to increment (or decrease) the file numbering. Accepts decimals also.

  • 'log_file_ops()': Creates a specified logging directory and logfile if required. Expects 'log4r' is attached to namespace.
    Arguments:
    dir_path: The name of the folder in which the logfile should be saved. Creates the folder if required.
    logfile_nm: Provide a name for the logfile. Do not include suffix. Defaults to "logfile".

  • 'log_enable()': Assigns file appender and logger objects to global environment. Expects 'log4r' is attached to namespace.
    Arguments:
    logfile_loc: The path to the logfile.
    pos: The environment which to assign pipeline_message. Defaults to 1, equivalent to the .GlobalEnv.
    logger_nm: What to call the logger. Provide unquoted strings with no spaces. Defaults to my_logger.
    appender_nm: What to call the appender function. Provide unquoted strings with no spaces. Defaults to file_app.

  • 'memory_report()': Performs a manual garbage collection. Print memory size. Uses 'utils::memory.size()' unless on Mac OS, where 'pryr::mem_used()' is used.

  • 'seq_file_ops()': Write a series of sequentially numbered files within a specified directory. Creates the directory if required.
    Arguments:
    target_dir: Directory to create files. Creates the directory if file.exists(target_dir) evaluates to FALSE.
    n: The number of files to create. Accepts a single number or numerical vector.
    filetype: The suffix to append the filename with. Do not include full stops / periods. Defaults to "R".
    force: Defaults to FALSE. If set to TRUE, seq_file_ops will overwrite any pre-existing files that match the write filenames asked for.

  • 'wrap_up()': Calculates and prints execution duration since start_time <- Sys.time. Plays an audio jingle using 'beepr'. Stops execution with a message indicating file location of wrap_up call.
    Arguments:
    start_time: Optional POSIXct object, created by assigning Sys.time() #' to an object prior to executing wrap_up().

Code of Conduct

Please note that the ptspotter project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.


Installation Notes

  • If installing from GitHub results in a non-zero exit status, try: Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS=TRUE), solution from here.

ptspotter's People

Contributors

r-leyshon avatar arcadeantics avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.