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 |
Creates a file copying current code without comments and tabuations
clear.code()
clear.code()
clear code to be executed
# Copy and paste all the following code in RStudio 1+1 clear.code()
# 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
copypaste()
copypaste()
A data frame object named "x" in .GlobalEnv
# 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}
# 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
libraries()
libraries()
libraries compiled
# 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]
# 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
r.args()
r.args()
arguments ready to run
# Copy and paste the function in RStudio, select the text and push Addins/Read Arguments rnorm(n=100)
# 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
read.all(dir = getwd())
read.all(dir = getwd())
dir |
directory to read |
data frame objects
lib<-getwd() read.all(lib)
lib<-getwd() read.all(lib)