All Projects → dreamRs → prefixer

dreamRs / prefixer

Licence: GPL-3.0 license
Prefix function with their namespace & other development tools

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to prefixer

colorscale
Create a color scale from a single color
Stars: ✭ 80 (-38.93%)
Mutual labels:  addin, rstudio-addin
Version3-1
Version 2020 (3.1) of Chem4Word - A Chemistry Add-In for Microsoft Word
Stars: ✭ 14 (-89.31%)
Mutual labels:  addin
Outlook-Add-in-SSO
[MOVED] The sample implements an Outlook add-in that uses Office's SSO system to get access to Microsoft Graph APIs and adds buttons to the Outlook ribbon.
Stars: ✭ 48 (-63.36%)
Mutual labels:  addin
Script-Help
📝 This VSTO Add-In is used for cleaning & creating a script for batch loading records into SQL Server, Oracle, Documentum, Markup or Markdown Languages. The functionality within the ribbon allows a quick way of preparing a bulk data load. Otherwise, the requests can be both time-consuming and error prone. It is written in 3 different versions a…
Stars: ✭ 65 (-50.38%)
Mutual labels:  addin
Version3
Version 3 of Chem4Word - A Chemistry Add-In for Microsoft Word
Stars: ✭ 53 (-59.54%)
Mutual labels:  addin
ssms-addin
SQL Server Management Studio 2018 Productivity Tool
Stars: ✭ 15 (-88.55%)
Mutual labels:  addin
brushthat
Brush up your tests!
Stars: ✭ 20 (-84.73%)
Mutual labels:  rstudio-addin
Excel-Timesheet
⏰ This Add-In is used to produce a timesheet file with functionality to import your Google Timeline. The standard timesheet has options for start and end dates, day of week and default start, end and break times. The Google timeline options are start and end dates, UTC selection, daylight savings time parameters and title filter for timeline ent…
Stars: ✭ 25 (-80.92%)
Mutual labels:  addin
data-assistant
ArcGIS Pro Add-in that assists in emergency management, local government and state government data aggregation workflows.
Stars: ✭ 16 (-87.79%)
Mutual labels:  addin
awesome-monodevelop
A curated list of awesome Visual Studio for macOS and MonoDevelop addins, tools and resources.
Stars: ✭ 24 (-81.68%)
Mutual labels:  addin
gwt-material-addins
Custom Components for gwt-material.
Stars: ✭ 35 (-73.28%)
Mutual labels:  addin
Excel-Favorites
⭐ This VSTO Add-In creates a custom "Favorites" ribbon. Key distinctive attributes include dedicated buttons for changing the visibility/sort order of sheets, copying visible cells, Excel's camera feature, Snipping Tool, Problem Steps Recorder (PSR) and Windows Calculator. It is written in 3 different versions as a VSTO Add-In in C# and VB.NET a…
Stars: ✭ 37 (-71.76%)
Mutual labels:  addin
Cake.Docker
Cake AddIn that extends Cake with Docker
Stars: ✭ 45 (-65.65%)
Mutual labels:  addin
sql-hunting-dog
Quick Search Tool (AddIn) for Microsoft SQL Management Studio
Stars: ✭ 33 (-74.81%)
Mutual labels:  addin
Notehighlight2016
Source code syntax highlighting for OneNote 2016 and OneNote for O365 . NoteHighlight 2013 port for OneNote 2016 (32-bit and 64-bit)
Stars: ✭ 2,907 (+2119.08%)
Mutual labels:  addin
local-government-desktop-addins
A series of ArcGIS Desktop Add-ins used in the ArcGIS for Local Government editing maps.
Stars: ✭ 58 (-55.73%)
Mutual labels:  addin
sqlquery
Htmlwidget to write SQL queries
Stars: ✭ 31 (-76.34%)
Mutual labels:  addin
upnews
Display news and update outdated github R packages
Stars: ✭ 25 (-80.92%)
Mutual labels:  rstudio-addin
D365FONinjaDevTools
To make of you a Ninja Developer in Dynamics 365 For Finance and Operations
Stars: ✭ 70 (-46.56%)
Mutual labels:  addin
Fusion360WrapSketch
Wrap sketch curves around a cylinder
Stars: ✭ 33 (-74.81%)
Mutual labels:  addin

prefixer::

Prefix function with their namespace and other tools for writing functions / packages

Travis-CI Build Status Project Status: Active-The project has reached a stable, usable state and is being actively developed. Lifecycle: stable R build status

Overview

It can be useful to prefix function in a script to prevent use of the wrong one, e.g. stats::filter vs dplyr::filter or plyr::summarise vs dplyr::summarise. This package provide a Shiny gadget to interactively add prefix to function in a script, if a function exist in several packages, you can choose the one you want use.

If you're in a package, you can generate @importFrom tag from function definition and after remove prefix if needed.

Installation :

# with remotes
remotes::install_github("dreamRs/prefixer")

⚠️ functions of this package will modify your scripts

prefixer:: gadget

You can launch the addin via RStudio's Addins menu. Interface looks like this :

fread_dir <- function(path, pattern = "\\.csv$") {
  paths <- list.files(path = path, pattern = pattern, full.names = TRUE)
  files <- lapply(paths, fread)
  files <- setNames(files, paths)
  rbindlist(l = files, idcol = "path")
}

Becomes =>

fread_dir <- function(path, pattern = "\\.csv$") {
  paths <- list.files(path = path, pattern = pattern, full.names = TRUE)
  files <- lapply(paths, data.table::fread)
  files <- stats::setNames(files, paths)
  data.table::rbindlist(l = files, idcol = "path")
}

@importFrom

From prefixed functions, you can generate roxygen @importFrom tag via addin @importFrom.

Or manually with import_from(fun = fread_dir):

#' @importFrom data.table fread rbindlist
#' @importFrom stats setNames
fread_dir <- function(path, pattern = "\\.csv$") {
  paths <- list.files(path = path, pattern = pattern, full.names = TRUE)
  files <- lapply(paths, data.table::fread)
  files <- stats::setNames(files, paths)
  data.table::rbindlist(l = files, idcol = "path")
}

Unprefix

After generated @importFrom tags, you can if you want remove prefix before your functions via addin Unprefix :

#' @importFrom data.table fread rbindlist
#' @importFrom stats setNames
fread_dir <- function(path, pattern = "\\.csv$") {
  paths <- list.files(path = path, pattern = pattern, full.names = TRUE)
  files <- lapply(paths, fread)
  files <- setNames(files, paths)
  rbindlist(l = files, idcol = "path")
}

Roxygen comments

Addin Roxygen comment allow to comment selected line with #'.

Not-ASCII

Addin Not-ASCII escape all not-ASCII characters between quotes to Unicode, to avoid warning in R CMD check :

frenchFileInput <- function(inputId) {
  fileInput(
    inputId = inputId,
    label = "Sélectionner un fichier :",
    buttonLabel = "Parcourir...",
    placeholder = "Aucun fichier sélectionné"
  )
}

becomes =>

frenchFileInput <- function(inputId) {
  fileInput(
    inputId = inputId,
    label = "S\u00e9lectionner un fichier :",
    buttonLabel = "Parcourir...",
    placeholder = "Aucun fichier s\u00e9lectionn\u00e9"
  )
}

Show Non-ASCII files

Show files containing Non-ASCII characters in RStudio markers tabs. This function is similar to tools::showNonASCIIfile.

show_nonascii_file()

Check Rd files

Check if your Rd files (documentation) contains examples and return value:

check_Rd_examples()
# 1 Rd file(s) with no examples. 
#  - unprefix.Rd 

check_Rd_value()
# 2 Rd file(s) with no value. 
#  - prefixer.Rd 
#  - unprefix.Rd 

Count calls

Get functions used in scripts and where they come from, for example functions used in this package:

count_calls("R/")
#                      call  n                  package
# 1                    tags 36                htmltools
# 2              rstudioapi 15                     <NA>
# 3         str_replace_all 15                  stringr
# 4                     div  9                htmltools
# 5                       b  8                     <NA>
# 6            observeEvent  8                    shiny
# 7                     pre  6                htmltools
# 8           set_selection  6                 prefixer
# 9  getSourceEditorContext  5               rstudioapi
# 10             insertText  5               rstudioapi
# ...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].