README.md

cutlery

Lifecycle: experimental contributions welcome

Collection of functions used for performing range of common tasks. Convert columns to factors, get fiscal year from a date, query postgreSQL database, write to clipboard, send email from Outlook, kill a windows process, a ggplot theme

All contributions are welcome

Installation

The package is not available on CRAN but can be installed from GitHub

devtools::install_github("amit-agni/cutlery")

Notes * During installation, you may get an error that a dependency package is not available. In such cases, install the mentioned packages and then install cutlery + For example : ERROR: dependency ‘DBI’ is not available for package ‘cutlery’

Currently implemented functions

Example

Convert multiple columns for a dataframe to factor

DT <- data.frame(c1=c("a","b","c")
,c11 = c("a","b","c")
,c2 = 1:3
,c3 = c(1.1,1.2,1.3)
,stringsAsFactors = F)

DT <- DTconvert2factor(DT,"int")

Notes * The repo folder is stored in Onedrive and sync'd on Mac and Windows. There were issues due to the different line endings on both the platforms. Windows adds CRLF whereas Mac adds LF. So when the repo was commited on Windows and Onedrive was sync'd, on Mac it would recognise the line endings as modified changes. This was solved by adding .attributes file Source

DISCLAIMER : Some of these functions are modifications to the functions from the already existing CRAN/github packages. For example the cutlery::fiscal_quarter() is a modified version of lubridate::quarter()



amit-agni/cutlery documentation built on Dec. 31, 2019, 2:09 p.m.