Package 'shortcuts'

Title: Useful Shortcuts to Interact with 'RStudio' Scripts
Description: Integrates clipboard copied data in R Studio, loads and installs libraries within a R script and returns all valid arguments of a selected function.
Authors: José Carlos Del Valle <[email protected]>
Maintainer: José Carlos Del Valle <[email protected]>
License: GPL-3
Version: 1.3.0
Built: 2024-10-14 02:45:24 UTC
Source: https://github.com/jcval94/shortcuts

Help Index


Creates a file copying current code without comments and tabuations

Description

Creates a file copying current code without comments and tabuations

Usage

clear.code()

Value

clear code to be executed

Examples

# Copy and paste all the following code in RStudio

1+1

clear.code()

A function to import copied data in RStudio via clipboard, the use of Addins is also highly recommended

Description

A function to import copied data in RStudio via clipboard, the use of Addins is also highly recommended

Usage

copypaste()

Value

A data frame object named "x" in .GlobalEnv

Examples

# Copy (Ctrl+C) a excel/google sheets/ online table such as the table:
# https://en.wikipedia.org/wiki/Standard_normal_table

# Then push Addins -> shortcuts / Copy Paste or Run the following code:

copypaste()

if("x" %in% ls()){x}

Compiles and installs all libraries in the current RStudio script where the word library is written

Description

Compiles and installs all libraries in the current RStudio script where the word library is written

Usage

libraries()

Value

libraries compiled

Examples

# Copy and paste all the following code in RStudio

loaded_pkgs<-(.packages())


# library(ggplot2)
# library(dplyr)

libraries()

loaded_pkgs2<-(.packages())


loaded_pkgs2[!loaded_pkgs2 %in% loaded_pkgs]

Displays all arguments and its values from a selected R function

Description

Displays all arguments and its values from a selected R function

Usage

r.args()

Value

arguments ready to run

Examples

# Copy and paste the function in RStudio, select the text and push Addins/Read Arguments


rnorm(n=100)

Read all documents in a folder and subfolders assigning them to the global environment; just extensions ".txt" and ".csv" are allowed

Description

Read all documents in a folder and subfolders assigning them to the global environment; just extensions ".txt" and ".csv" are allowed

Usage

read.all(dir = getwd())

Arguments

dir

directory to read

Value

data frame objects

Examples

lib<-getwd()

read.all(lib)