Title: | Tools for Geocaching |
---|---|
Description: | Tools for solving common geocaching puzzle types, and other Geocaching-related tasks. |
Authors: | Alun Hewinson [cre, aut] |
Maintainer: | Alun Hewinson <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0.9001 |
Built: | 2024-11-03 05:21:27 UTC |
Source: | https://github.com/alunhewinson/geocacher |
The "hash" here is not a true hash, since the output has a variable number of characters, but is instead a string representation of the number of characters in the input string in hexadecimal format.
alphash(x, case_sensitive = FALSE, alphabet = standard_alphabet)
alphash(x, case_sensitive = FALSE, alphabet = standard_alphabet)
x |
A character vector to be hashed |
case_sensitive |
NOT IN USE. This parameter will probably be removed |
alphabet |
NOT IN USE. This parameter will probably be removed |
A character vector equal in length to the input x
Make a frequency table of the characters in a string
analyse_frequency( x, case_sensitive = FALSE, alphabet = standard_alphabet, collapse = FALSE )
analyse_frequency( x, case_sensitive = FALSE, alphabet = standard_alphabet, collapse = FALSE )
x |
A character vector |
case_sensitive |
Logical. Should lower and upper case letters be kept separate |
alphabet |
A list containing lower and upper case alphabets |
collapse |
A character value to be passed to paste() to collapse x into a single string. If collapse=FALSE (default), no collapse is implemented |
A tibble of the frequencies, with one row for each input string
A helper table for base64 conversion and lookup
base64
base64
An object of class tbl_df
(inherits from tbl
, data.frame
) with 64 rows and 3 columns.
Designed to convert into Geocaching-style style coordinates, but future styles may be accommodated.
expressCoordinates(x, style = "GC")
expressCoordinates(x, style = "GC")
x |
A numeric vector of length 2 |
style |
placeholder for future development if requirements emerge |
A character of length 1 with an alternative expression of the coordinates
expressCoordinates(c(55.9327, -3.25103))
expressCoordinates(c(55.9327, -3.25103))
parseCoordinates
takes a variety of string inputs for coordinates in the
following formats:
- N00 00.000 W000 00.000
- N00 00 00 W000 00 00
- N00.0000 W00.0000
and converts them into a numeric vector of length 2
parseCoordinates(x)
parseCoordinates(x)
x |
A string for the coordinates to be converted |
A numeric vector holding the n(orth) and e(ast) coordinates
parseCoordinates("N55 55.555 W003 14.159") parseCoordinates("N 55 55.555 E003 14.159") parseCoordinates("N55.92592 W3.23598")
parseCoordinates("N55 55.555 W003 14.159") parseCoordinates("N 55 55.555 E003 14.159") parseCoordinates("N55.92592 W3.23598")
This is a wrapper for vigenere
where decrypt is set to FALSE
qqmiaiii(x, key, alphabet = standard_alphabet)
qqmiaiii(x, key, alphabet = standard_alphabet)
x |
A string to encrypt or decrypt |
key |
The encryption or decryption key |
alphabet |
A list of letters in lower and upper case |
Caesar-shift a string by a given number of letters.
rot(x, n = 13, alphabet = standard_alphabet, showWarn = TRUE)
rot(x, n = 13, alphabet = standard_alphabet, showWarn = TRUE)
x |
A string. |
n |
A number of letters to shift the string by. |
alphabet |
A list containing lower and upper case alphabets |
showWarn |
boolean. Do you want to see warnings about alphabets? |
A string
rot("abc") rot("abc", n=2) rot("abc", n=5, list(lw=letters[1:7], up=LETTERS[1:7]))
rot("abc") rot("abc", n=2) rot("abc", n=5, list(lw=letters[1:7], up=LETTERS[1:7]))
Caesar-shift a string over all possible number n
rot_all(x, alphabet = standard_alphabet)
rot_all(x, alphabet = standard_alphabet)
x |
A string. |
alphabet |
A list containing lower and upper case alphabets. |
a vector of strings
rot_all("abc") rot_all("abc", list(lw=letters[1:7], up=LETTERS[1:7]))
rot_all("abc") rot_all("abc", list(lw=letters[1:7], up=LETTERS[1:7]))
Value and frequency of Scrabble letters
Scrabble
Scrabble
An object of class tbl_df
(inherits from tbl
, data.frame
) with 27 rows and 3 columns.
Find the Scrabble value of words
Scrabble_score(x, language = "en")
Scrabble_score(x, language = "en")
x |
A vector of character strings |
language |
A character string for the linguistic Scrabble edition, conforming to ISO 639-1 Current supported languages: en |
An integer vector
Scrabble_score(c("kwyjibo", "jozxyqk"))
Scrabble_score(c("kwyjibo", "jozxyqk"))
The standard alphabet for the locale, for use in Caesar-based encryption etc.
standard_alphabet
standard_alphabet
An object of class list
of length 2.
Encrypt or decrypt a string using a key
vigenere(x, key, decrypt = TRUE, alphabet = standard_alphabet)
vigenere(x, key, decrypt = TRUE, alphabet = standard_alphabet)
x |
A string to encrypt or decrypt |
key |
The encryption or decryption key |
decrypt |
Are you decrypting an encrypted string? |
alphabet |
A list of letters in lower and upper case |
A string
vigenere("MN vdopf wq brcep zwtcd.", "midway") vigenere("My treasure is buried he... find it who may.", "La Bouche", decrypt = FALSE)
vigenere("MN vdopf wq brcep zwtcd.", "midway") vigenere("My treasure is buried he... find it who may.", "La Bouche", decrypt = FALSE)
This function requires you to have a valid what3words API key called
W3WAPIKey
stored as an environment variable
w3w(x)
w3w(x)
x |
A vector, or list, of words. Strings with dots in them will be split. After splitting, there must be a multiple of three words. Either a vector of words, for a single latitude/longitude pair, or a list of vectors for vectorised operations. This wrapper also accepts a single string of three words separated by full stops. |
a numeric vector of length 2, consisting of lat(itude) and lon(gitude)
## Not run: w3w("president.always.lying") w3w("unseen.academicals.football") ## returns NAs w3w(list("special.tools.required", "cliffs.falling.rocks", "available.during.winter", "ultraviolet.light.required")) w3w(c("protests", "memo", "consoles")) ## End(Not run)
## Not run: w3w("president.always.lying") w3w("unseen.academicals.football") ## returns NAs w3w(list("special.tools.required", "cliffs.falling.rocks", "available.during.winter", "ultraviolet.light.required")) w3w(c("protests", "memo", "consoles")) ## End(Not run)
Find the value of words
word_score(x)
word_score(x)
x |
A vector of character strings |
An integer vector
word_score(c("infinite", "monkey", "cage"))
word_score(c("infinite", "monkey", "cage"))