Type: | Package |
Title: | SpongeBob-Case Converter : spOngEboB-CASe CoNVertER |
Version: | 0.4.0 |
Maintainer: | Jay Qi <jayqi.opensource@gmail.com> |
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. |
Suggests: | testthat, fortunes, ggplot2 |
License: | BSD_3_clause + file LICENSE |
URL: | https://github.com/jayqi/spongebob |
BugReports: | https://github.com/jayqi/spongebob/issues |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2019-03-02 06:34:12 UTC; jqi |
Author: | Jay Qi [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2019-03-02 08:00:03 UTC |
ASCII Spongebob : AsCIi sPOngEbob
Description
ASCII Mocking Spongebob used by spongebobsay
.
aSCIi mOckiNg SPOngEboB uSED bY spongebobsay
.
Usage
ascii_spongebob(print = TRUE)
Arguments
print |
a length-1 logical flag for whether to print output to console. |
Value
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.
See Also
Examples
ascii_spongebob()
art <- ascii_spongebob(print = FALSE)
cat(art)
SpongeBob ASCII Messages : sPongEBoB aScii MesSAgEs
Description
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.
Usage
spongebobsay(what, print = TRUE, width = NULL)
spongebobthink(what, print = TRUE, width = NULL)
spongebobwhisper(what, print = TRUE, width = NULL)
Arguments
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 |
Details
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
.
Value
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.
See Also
Examples
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"
)
SpongeBob-Case Conversion : sPOngEBOb-CasE cOnVErsIoN
Description
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.
Usage
tospongebob(x, ...)
Arguments
x |
object with text to be converted to Mocking SpongeBob case. |
... |
onlY hERe tO sATisFy R CMd CHeCk. |
Details
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
objectmatrix
: convert data and dimnames of a matrix
tospongebob.table
: convert data and dimnames of a table
Value
object with its text converted to Mocking SpongeBob case. ObjECt WiTH iTS tEXt CONvErTeD TO mOCkinG SponGEBob CasE.
Examples
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)
SpongeBob-Case Conversion for Character Vectors
Description
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.
Usage
## S3 method for class 'character'
tospongebob(x, ..., convert.names = TRUE)
Arguments
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 |
Value
the input vector with its text converted to Mocking SpongeBob case. tHe inPuT VecTor WItH its TeXt ConvErTed To MOckInG SPoNGebOB cASe.
See Also
Examples
spongebob:::tospongebob.character("SpongeBob-Case Conversion")
spongebob:::tospongebob.character(c(
"S3 generic function",
"Mocking SpongeBob case"
))
SpongeBob-Case Conversion for Data Frames
Description
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.
Usage
## S3 method for class 'data.frame'
tospongebob(x, ..., convert.rownames = TRUE,
convert.colnames = TRUE)
Arguments
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 |
Value
data.frame with its text converted to Mocking SpongeBob case.
See Also
Examples
df1 <- head(datasets::CO2)
tospongebob(df1)
df2 <- head(datasets::mtcars)
tospongebob(df2)
SpongeBob-Case Conversion for List-like Objects
Description
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.
Usage
## Default S3 method:
tospongebob(x, ..., convert.names = TRUE)
Arguments
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 |
Value
object with its text converted to Mocking SpongeBob case. ObjECt WiTH iTS tEXt CONvErTeD TO mOCkinG SponGEBob CasE.
See Also
Examples
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)