Title: | SpongeBob-Case Converter : spOngEboB-CASe CoNVertER |
---|---|
Description: | Convert text (and text in R objects) to Mocking SpongeBob case <https://knowyourmeme.com/memes/mocking-spongebob> and show them off in fun ways. CoNVErT TexT (AnD TeXt In r ObJeCtS) To MOCkINg SpoNgebOb CAsE <https://knowyourmeme.com/memes/mocking-spongebob> aND shOw tHem OFf IN Fun WayS. |
Authors: | Jay Qi [aut, cre] |
Maintainer: | Jay Qi <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 0.4.0 |
Built: | 2025-02-16 05:16:25 UTC |
Source: | https://github.com/cran/spongebob |
ASCII Mocking Spongebob used by spongebobsay
.
aSCIi mOckiNg SPOngEboB uSED bY spongebobsay
.
ascii_spongebob(print = TRUE)
ascii_spongebob(print = TRUE)
print |
a length-1 logical flag for whether to print output to console. |
a character string containing the ASCII art. Use
cat
to print with proper formatting.
A CHaRACtER stRINg cONtaINiNG ThE ASciI ARt. uSe cat
TO
prInT WiTH prOper FORmatTiNg.
ascii_spongebob() art <- ascii_spongebob(print = FALSE) cat(art)
ascii_spongebob() art <- ascii_spongebob(print = FALSE) cat(art)
A set of functions that generate SpongeBob ASCII art with speech bubbles in the style of cowsay.
a seT OF fuNctiOnS tHat GEnerAte sPONgeBOb AScIi aRT wiTH SpeEcH buBBLeS In THe sTylE OF cOWsaY.
spongebobsay(what, print = TRUE, width = NULL) spongebobthink(what, print = TRUE, width = NULL) spongebobwhisper(what, print = TRUE, width = NULL)
spongebobsay(what, print = TRUE, width = NULL) spongebobthink(what, print = TRUE, width = NULL) spongebobwhisper(what, print = TRUE, width = NULL)
what |
an object accepted by |
print |
a length-1 logical, indicating whether to print output to console. |
width |
a length-1 positive integer or numeric whole number specifying width to wrap text |
These functions will convert the input to Mocking SpongeBob case
using tospongebob
. If the converted output is not already a
character vector, it will be converted to such using
print
.
The ASCII SpongeBob graphic is available standalone using
ascii_spongebob
.
a character string containing the ASCII art. Use
cat
to print with proper formatting.
A CHaRACtER stRINg cONtaINiNG ThE ASciI ARt. uSe cat
TO
prInT WiTH prOper FORmatTiNg.
spongebobsay("globalVariables is a hideous hack and I will never use it.") spongebobthink( "@hadley you shouldn't say you'll never use things when only two years later you think it's fine -- hadley" ) spongebobwhisper( "it's still a hideous hack, but you just have to suck it up if you want your package on CRAN" )
spongebobsay("globalVariables is a hideous hack and I will never use it.") spongebobthink( "@hadley you shouldn't say you'll never use things when only two years later you think it's fine -- hadley" ) spongebobwhisper( "it's still a hideous hack, but you just have to suck it up if you want your package on CRAN" )
tospongebob
is an S3 generic function for converting text
in R objects to
Mocking SpongeBob case. The core method for character vectors will return
the input character vector with case-converted elements. For other objects,
it will attempt to appropriately find text and convert them.
tospongebob
IS an S3 gENErIC FunCtIoN fOR cOnveRtIng Text IN r obJEcts
To MocKinG SpOnGEbob
CasE. tHe cOrE MEtHOd FoR CharActEr VECtorS wIll RetURN tHe INPuT chARaCTer
VEcTOr WItH cASe-cONVeRTed ELeMenTS. foR oThER objECTs, iT wIlL aTtemPT tO
APprOPrIAtELy fInd tEXt aNd cONvERT tHEm.
tospongebob(x, ...)
tospongebob(x, ...)
x |
object with text to be converted to Mocking SpongeBob case. |
... |
onlY hERe tO sATisFy R CMd CHeCk. |
This section describes the (non-exported) S3 methods in more detail.
The core tospongebob.character
method takes an input character
vector and returns the same vector with its elements converted to Mocking
SpongeBob case. Names of the vector are also converted unless parameter
convert.names = FALSE
. This method is then leveraged by all other
methods.
The default tospongebob.default
method will iterate through any
elements of list-like objects and attempt to convert those. It will also
convert the names of the object unless parameter convert.names = FALSE
.
NULL values are passed through as NULL.
Additional S3 methods for the following classes have been implemented:
tospongebob.array
: convert data and dimnames of an array
tospongebob.data.frame
: convert row names, column names, and convertible columns of a data.frame
tospongebob.environment
: create a copy of an environment with its objects converted
tospongebob.factor
: convert levels of factor vectors
tospongebob.fortune
: convert the content of a fortunes::fortune object
tospongebob.function
: deparse function into a character vector, convert, and then combine into one string block
tospongebob.ggplot
: convert text labels in
ggplot2::ggplot
object
matrix
: convert data and dimnames of a matrix
tospongebob.table
: convert data and dimnames of a table
object with its text converted to Mocking SpongeBob case. ObjECt WiTH iTS tEXt CONvErTeD TO mOCkinG SponGEBob CasE.
tospongebob("SpongeBob-Case Conversion") tospongebob(c("S3 generic function", "Mocking SpongeBob case")) tospongebob(packageDescription("base")) df <- head(datasets::CO2) tospongebob(df) tospongebob(summary(df)) nicktoons <- list( spongebob = list( episodes = c("Help Wanted", "Reef Blower", "Tea at the Treedome"), characters = c("SpongeBob", "Patrick", "Squidward", "Sandy") ), hey_arnold = list( episodes = c("Downtown as Fruits", "Eugene's Bike"), characters = c("Arnold", "Gerald", "Helga") ) ) tospongebob(nicktoons)
tospongebob("SpongeBob-Case Conversion") tospongebob(c("S3 generic function", "Mocking SpongeBob case")) tospongebob(packageDescription("base")) df <- head(datasets::CO2) tospongebob(df) tospongebob(summary(df)) nicktoons <- list( spongebob = list( episodes = c("Help Wanted", "Reef Blower", "Tea at the Treedome"), characters = c("SpongeBob", "Patrick", "Squidward", "Sandy") ), hey_arnold = list( episodes = c("Downtown as Fruits", "Eugene's Bike"), characters = c("Arnold", "Gerald", "Helga") ) ) tospongebob(nicktoons)
Convert character vectors to
Mocking SpongeBob
case. This is an S3 method for character vectors. Generally, you will not be
using this method directly; instead, use the S3 generic
tospongebob
. If you really need to use this method, you will
need to do spongebob:::tospongebob.character
because it is an internal
method.
## S3 method for class 'character' tospongebob(x, ..., convert.names = TRUE)
## S3 method for class 'character' tospongebob(x, ..., convert.names = TRUE)
x |
character vector with text to be converted to Mocking SpongeBob case. |
... |
onlY hERe tO sATisFy R CMd CHeCk. |
convert.names |
logical, indicating whether or not to convert the names of the object |
the input vector with its text converted to Mocking SpongeBob case. tHe inPuT VecTor WItH its TeXt ConvErTed To MOckInG SPoNGebOB cASe.
spongebob:::tospongebob.character("SpongeBob-Case Conversion") spongebob:::tospongebob.character(c( "S3 generic function", "Mocking SpongeBob case" ))
spongebob:::tospongebob.character("SpongeBob-Case Conversion") spongebob:::tospongebob.character(c( "S3 generic function", "Mocking SpongeBob case" ))
Convert data.frame objects to
Mocking SpongeBob
case. This is the S3 method for data.frame objects. Generally, you will not
be using this method directly; instead, use the S3 generic
tospongebob
. If you really need to use this method, you will
need to do spongebob:::tospongebob.data.frame
because it is an
internal method.
This method will convert character and factor columns to Mocking SpongeBob case. It will also optionlly convert column and row names, enabled by default.
## S3 method for class 'data.frame' tospongebob(x, ..., convert.rownames = TRUE, convert.colnames = TRUE)
## S3 method for class 'data.frame' tospongebob(x, ..., convert.rownames = TRUE, convert.colnames = TRUE)
x |
data.frame with text to be converted to Mocking SpongeBob case. |
... |
onlY hERe tO sATisFy R CMd CHeCk. |
convert.rownames |
logical, indicating whether or not to convert the row names of the data.frame |
convert.colnames |
logical, indicating whether or not to convert the column names of the data.frame |
data.frame with its text converted to Mocking SpongeBob case.
df1 <- head(datasets::CO2) tospongebob(df1) df2 <- head(datasets::mtcars) tospongebob(df2)
df1 <- head(datasets::CO2) tospongebob(df1) df2 <- head(datasets::mtcars) tospongebob(df2)
Convert list-like objects to
Mocking SpongeBob
case. This is the default S3 method the S3 generic
tospongebob
. Generally, you will not need to use this method
directly; instead, use tospongebob
. If you really need to use
this method, you will need to do spongebob:::tospongebob.default
because it is an internal method.
## Default S3 method: tospongebob(x, ..., convert.names = TRUE)
## Default S3 method: tospongebob(x, ..., convert.names = TRUE)
x |
object with text to be converted to Mocking SpongeBob case. |
... |
onlY hERe tO sATisFy R CMd CHeCk. |
convert.names |
logical, indicating whether or not to convert the names of the object |
object with its text converted to Mocking SpongeBob case. ObjECt WiTH iTS tEXt CONvErTeD TO mOCkinG SponGEBob CasE.
nicktoons <- list( spongebob = list( episodes = c("Help Wanted", "Reef Blower", "Tea at the Treedome"), characters = c("SpongeBob", "Patrick", "Squidward", "Sandy") ), hey_arnold = list( episodes = c("Downtown as Fruits", "Eugene's Bike"), characters = c("Arnold", "Gerald", "Helga") ) ) spongebob:::tospongebob.default(nicktoons)
nicktoons <- list( spongebob = list( episodes = c("Help Wanted", "Reef Blower", "Tea at the Treedome"), characters = c("SpongeBob", "Patrick", "Squidward", "Sandy") ), hey_arnold = list( episodes = c("Downtown as Fruits", "Eugene's Bike"), characters = c("Arnold", "Gerald", "Helga") ) ) spongebob:::tospongebob.default(nicktoons)