Title: | The Ultimate Helper for Clumsy Fingers |
---|---|
Description: | Automatically suggests a correction when a typo occurs. |
Authors: | Vincent Guyader |
Maintainer: | Vincent Guyader <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3.1 |
Built: | 2024-12-03 02:55:22 UTC |
Source: | https://github.com/ThinkR-open/fcuk |
Rerun with correcyion
## S3 method for class 'fcuk' x + y
## S3 method for class 'fcuk' x + y
x |
blank object of class fcuk |
y |
an integer corresponding to the position of the proposal to be reused |
## Not run: view(iris)# error .+1 # return View(iris) ## End(Not run)
## Not run: view(iris)# error .+1 # return View(iris) ## End(Not run)
After calling this function, fcuk will be launched everytime you launch your
current R project (or any project if you use option global = TRUE
).
add_fcuk_to_rprofile(global = TRUE)
add_fcuk_to_rprofile(global = TRUE)
global |
Whether to add it to the global .Rprofile ( |
fcuk::add_fcuk_to_rprofile()
fcuk::add_fcuk_to_rprofile()
Capture and parse an error message.
catch_error(sentence = geterrmessage())
catch_error(sentence = geterrmessage())
sentence |
an error message to parse |
catch_error() catch_error("Error: object 'iri' not found\n") catch_error("Error: object 'view' not found\n")
catch_error() catch_error("Error: object 'iri' not found\n") catch_error("Error: object 'view' not found\n")
Error Analysis
error_analysis(asked_objet = catch_error(), n = 2)
error_analysis(asked_objet = catch_error(), n = 2)
asked_objet |
the name to analyse |
n |
number of names to suggest |
fcuk::error_analysis() #last error is analysed fcuk::error_analysis("view") fcuk::error_analysis("iri")
fcuk::error_analysis() #last error is analysed fcuk::error_analysis("view") fcuk::error_analysis("iri")
Analyse a typo and suggests the two closest names.
error_correction_propostion(asked_objet, method = "jaccard", n = 2)
error_correction_propostion(asked_objet, method = "jaccard", n = 2)
asked_objet |
the R name producing an error |
method |
Method for distance calculation. The default is "jaccard", see stringdist-metrics. |
n |
number of corrections to suggest. |
a character vector with the closest neighbors
error_correction_propostion("iri")
error_correction_propostion("iri")
Fetch the name of all objects loaded in the environments (functions, values, data...)
get_all_objets_from_r()
get_all_objets_from_r()
a list with the names of all objects contained in the environments
get_all_objets_from_r()
get_all_objets_from_r()
return corrected instruction
get_last(n = 1)
get_last(n = 1)
n |
postion of the correction |
get_last()
get_last()
After lauching this function, every error message will be analysed. This function is called when loading the package.
init_error_tracker()
init_error_tracker()
getOption("error") fcuk::init_error_tracker() getOption("error")
getOption("error") fcuk::init_error_tracker() getOption("error")
After lauching this function, the errors will no longer be analysed.
remove_error_tracker()
remove_error_tracker()
getOption("error") fcuk::remove_error_tracker() getOption("error")
getOption("error") fcuk::remove_error_tracker() getOption("error")