Giter Site home page Giter Site logo

nzpoliceutilities's Introduction

NZPoliceUtilities

Helper R package to assist the design of R products for New Zealand Police's (NZP) National Road Policing Centre (NRPC).

Will contain useful functions and non-private data for quick reference and auto-formatting, i.e.

  • loading the approved NZP colours as an R theme, for use in graphing
  • pulling in and pushing out files from arbitrary paths, read from elsewhere and stored in env instead of as plaintext in codebase
    • means that file path and/or file doesnt need to be written inside the code

This is NOT to be used to store filepaths, actual files or data on NZP processes/people.

To load this package in R:

  1. Install the required packages for loading non-CRAN packages
  2. Load this package
install.packages("devtools") # only have to do this if `devtools` has never been installed before
install.packages("stringr") # only have to do this if `stringr` has never been installed before
devtools::install_github("Argel-Tal/NZPoliceUtilities")

To see the full list of exported functions:

library("NZPoliceUtilities")
ls("package:NZPoliceUtilities")

WFH to do

  • Convert this to binaries so it can be loaded without Rtools ๐Ÿ™„๐Ÿ˜ 

Credits

Author(s):

Jack MacCormick

Style attributions:

Fong Chun Chan

nzpoliceutilities's People

Contributors

argel-tal avatar

Watchers

 avatar

nzpoliceutilities's Issues

Need to scan assignment and equality testing for un-spaced operations

  • a==b needs to come back as 2 un-spaced operators. Currently unchecked for
  • var=x needs to come back as 1 un-spaced operator. Currently unchecked for

Should be recommending a == b & var = x

TO DO:

  1. Replace
  countOperatorNoSpace <- length(setdiff(stringr::str_extract_all(codeRaw, "[\\+\\-\\*].")[[1]], 
                                         unlist(stringr::str_match_all(str_extract_all(codeRaw, "[\\+\\-\\*].")[[1]], ". "))))
  listOperatorNoSpace <- setdiff(stringr::str_extract_all(codeRaw, "[\\+\\-\\*].")[[1]], 
                                 unlist(stringr::str_match_all(stringr::str_extract_all(codeRaw, "[\\+\\-\\*].")[[1]], ". ")))
  
  countOperatorNoSpace1 <- length(setdiff(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*]")[[1]], 
                                         unlist(stringr::str_match_all(str_extract_all(codeRaw, ".[\\+\\-\\*]")[[1]], " ."))))
  listOperatorNoSpace1 <- setdiff(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*]")[[1]], 
                                 unlist(stringr::str_match_all(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*]")[[1]], " .")))

with

  countOperatorNoSpace <- length(setdiff(stringr::str_extract_all(codeRaw, "[\\+\\-\\*\\=].")[[1]], 
                                         unlist(stringr::str_match_all(str_extract_all(codeRaw, "[\\+\\-\\*\\=].")[[1]], ". "))))
  listOperatorNoSpace <- setdiff(stringr::str_extract_all(codeRaw, "[\\+\\-\\*\\=].")[[1]], 
                                 unlist(stringr::str_match_all(stringr::str_extract_all(codeRaw, "[\\+\\-\\*\\=].")[[1]], ". ")))
  
  countOperatorNoSpace1 <- length(setdiff(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*\\=]")[[1]], 
                                         unlist(stringr::str_match_all(str_extract_all(codeRaw, ".[\\+\\-\\*\\=]")[[1]], " ."))))
  listOperatorNoSpace1 <- setdiff(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*\\=]")[[1]], 
                                 unlist(stringr::str_match_all(stringr::str_extract_all(codeRaw, ".[\\+\\-\\*\\=]")[[1]], " .")))
  1. Recompile and re-upload package

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.