Coder Social home page Coder Social logo

octopus's Introduction

octopus

The aim of library(octopus) is to make a few of my commonly-used utility functions available to colleagues.

Installation

devtools::install_github("woodwards/octopus")

Functions

  • %notin% is a companion for %in%.

  • allequal() determines whether two objects are equal.

  • as_numeric() is the same as as.numeric but suppressing the warnings.

  • autosnake(df) converts dataframe names to snake_case using ensnakeify().

  • despace() removes factors, spaces and NA from a dataframe prior to writing.

  • dotty(df) quickly visualises dataframe contents using ggplot().

  • ensnakeify() converts strings to snake_case. Symbols are converted to underscore, but you can optionally convert them to text, by supplying a named vector such as c("%" = "percent", "/" = "per", "@" = "at", "#" = "hashtag").

  • excel_to_date() converts Excel date numbers to Date.

  • fillgaps() fills gaps in a vector with the first non-NA value.

  • is_loaded() checks whether a package is loaded.

  • not_all_na() is a helper function to identify dataframe columns that contain values.

  • not_all_same() is a helper function to identify dataframe columns that contain more than one value.

  • obj_to_str() converts an object to a string.

  • str_to_obj() converts a string (generated using obj_to_str()) back to an object.

  • summaree(df) is a modification of summary(df) that gives more information on string columns.

  • write_data(df) writes a dataframe to a text file (but only if it has changed).

octopus's People

Contributors

woodwards-dnz avatar

Stargazers

 avatar

Watchers

 avatar  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.