Package 'fcuk'

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-10-04 02:58:49 UTC
Source: https://github.com/ThinkR-open/fcuk

Help Index


Rerun with correcyion

Description

Rerun with correcyion

Usage

## S3 method for class 'fcuk'
x + y

Arguments

x

blank object of class fcuk

y

an integer corresponding to the position of the proposal to be reused

Examples

## Not run: 
view(iris)# error
.+1 # return View(iris)


## End(Not run)

Add library(fcuk) to the .Rprofile file

Description

After calling this function, fcuk will be launched everytime you launch your current R project (or any project if you use option global = TRUE).

Usage

add_fcuk_to_rprofile(global = TRUE)

Arguments

global

Whether to add it to the global .Rprofile (TRUE) or just to the .Rprofile file of your current project (FALSE, the default).

Examples

fcuk::add_fcuk_to_rprofile()

Capture and parse an error message.

Description

Capture and parse an error message.

Usage

catch_error(sentence = geterrmessage())

Arguments

sentence

an error message to parse

Examples

catch_error()
catch_error("Error: object 'iri' not found\n")
catch_error("Error: object 'view' not found\n")

Error Analysis

Description

Error Analysis

Usage

error_analysis(asked_objet = catch_error(), n = 2)

Arguments

asked_objet

the name to analyse

n

number of names to suggest

Examples

fcuk::error_analysis() #last error is analysed
fcuk::error_analysis("view")
fcuk::error_analysis("iri")

Find closest object names

Description

Analyse a typo and suggests the two closest names.

Usage

error_correction_propostion(asked_objet, method = "jaccard", n = 2)

Arguments

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.

Value

a character vector with the closest neighbors

Examples

error_correction_propostion("iri")

Extract the name of all objects loaded in the R environments

Description

Fetch the name of all objects loaded in the environments (functions, values, data...)

Usage

get_all_objets_from_r()

Value

a list with the names of all objects contained in the environments

Examples

get_all_objets_from_r()

return corrected instruction

Description

return corrected instruction

Usage

get_last(n = 1)

Arguments

n

postion of the correction

Examples

get_last()

Init error tracker

Description

After lauching this function, every error message will be analysed. This function is called when loading the package.

Usage

init_error_tracker()

Examples

getOption("error")
fcuk::init_error_tracker()
getOption("error")

Remove error tracker

Description

After lauching this function, the errors will no longer be analysed.

Usage

remove_error_tracker()

Examples

getOption("error")
fcuk::remove_error_tracker()
getOption("error")