id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
R_base_tools/R_base_all_190_1.txt | cores' by group (standardize to mean zero, variance one)
z <- unsplit(lapply(split(x, g), scale), g)
# or
zz <- x
split(zz, g) <- lapply(split(x, g), scale)
# and check that the within-group std dev is indeed one
tapply(z, g, sd)
tapply(zz, g, sd)
### data frame ... | |
R_base_tools/strings.html7_90_0.txt | This is a common pattern for stringr functions, because working with a single
match allows you to use much simpler data structures. To get all matches, use
` str_extract_all() ` . It returns a list:
str_extract_all(more, colour_match)
#> [[1]]
#> [1] "blue" "red"
#>
#> [[2]]
#> [1]... | |
R_base_tools/stringr.html3_22_0.txt | ### Engines
There are four main engines that stringr can use to describe patterns: | |
R_base_tools/R_base_all_93_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# deparseOpts: Options for Expression Deparsing
## Description
Process the deparsing options... | |
R_base_tools/R_base_all_101_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Bessel: Bessel Functions
## Description
Bessel Functions of integer and fractional order, ... | |
R_base_tools/strings.html7_4_0.txt | This chapter introduces you to string manipulation in R. You’ll learn the
basics of how strings work and how to create them by hand, but the focus of
this chapter will be on regular expressions, or regexps for short. Regular
expressions are useful because strings usually contain unstructured or semi-
structured data, a... | |
R_base_tools/R_base_all_53_1.txt | 6.2%2Ftopics%2FgrepRaw&utm_source=r-docs&utm_medium=docs&utm_term=grepRaw&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/R_micropan_9_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ micropan (version 1.0 ) ](/packages/micropan/versions/1.0)
# panTree: Constructing pan-genome trees
## Description
Creates a pan-genome tree based ... | |
R_base_tools/stringr.html4_5_0.txt | When we have a vector of strings, ` str_length ` will give us length
information for each string. This will be a common phenomenon in this lab –
funtions that apply to strings will also apply to each element of a character
vector
y <- c("apple", "banana", "pears")
str_length(y)
## [1] 5... | |
R_base_tools/R_base_all_127_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# tempfile: Create Names for Temporary Files
## Description
` tempfile ` returns a vector of... | |
R_base_tools/stringr.html4_3_0.txt |
# This is a string
a <- "abc"
# This is also a string
b <- "I think statistics is really super duper neat!"
# Strings can be combined into a character vector with `c`
vec <- c(a, b)
vec
## [1] "abc"
## [2] "I th... | |
R_base_tools/stringr.html4_55_0.txt |
s <- c("some words no numbers", "see you 2nite", "you are L8")
# Find strings that have digits that start of a word
str_subset(s, "\\b\\d")
## [1] "see you 2nite"
# Find strings that have digits at end of word
str_subset(s, "\\d\\b")
## [1] "you a... | |
R_base_tools/R_base_all_12_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# ns-dblcolon: Double Colon and Triple Colon Operators
## Description
Accessing exported and... | |
R_base_tools/R_micropan_37_1.txt | _datalab)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/strings.html7_71_1.txt | .\[\] \0
00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*... | |
R_base_tools/R_base_all_137_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# tracemem: Trace Copying of Objects
## Description
This function marks an object so that a ... | |
R_base_tools/R_base_all_142_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# chkDots: Warn About Extraneous Arguments in the "..." of Its Caller
## Description
Warn ab... | |
R_base_tools/R_base_all_176_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# pmatch: Partial String Matching
## Description
` pmatch ` seeks matches for the elements o... | |
R_base_tools/R_base_all_429_1.txt | code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fifelse&utm_source=r-docs&utm_medium=docs&utm_term=ifelse&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/strings.html7_100_0.txt | 2. Find all contractions. Separate out the pieces before and after the apostrophe.
### 14.4.4 Replacing matches | |
R_base_tools/R_base_all_262_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Hyperbolic: Hyperbolic Functions
## Description
These functions give the obvious hyperboli... | |
R_base_tools/strings.html7_69_0.txt | Now that you’ve learned the basics of regular expressions, it’s time to learn
how to apply them to real problems. In this section you’ll learn a wide array
of stringr functions that let you:
* Determine which strings match a pattern.
* Find the positions of matches.
* Extract the content of matches.
* Repla... | |
R_base_tools/R_base_all_245_1.txt | ty
environment ` emptyenv() ` , into which nothing may be assigned.
The replacement function ` parent.env<- ` is extremely dangerous as it can be
used to destructively change environments in ways that violate assumptions
made by the internal C code. It may be removed in the near future.
The replacement form of ` envi... | |
R_base_tools/R_base_all_287_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# strtrim: Trim Character Strings to Specified Display Widths
## Description
Trim character ... | |
R_base_tools/R_base_all_42_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Sys.getenv: Get Environment Variables
## Description
` Sys.getenv ` obtains the values of ... | |
R_base_tools/stringr.html4_67_0.txt |
s <- "iowa"
# Counts subsequent vowels as a single instance
str_count(s, "[aeiou]+")
## [1] 2
str_view(s, "[aeiou]+")
## [1] │ <io>w<a>
We can be more precise with our quantifiers using curly braces, ` "{}" ` to
indicate exactly what quantity constitutes ... | |
R_base_tools/R_base_all_343_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# QR.Auxiliaries: Reconstruct the Q, R, or X Matrices from a QR Object
## Description
Return... | |
R_base_tools/R_micropan_29_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ micropan (version 1.0 ) ](/packages/micropan/versions/1.0)
# plot.Pantree: Plotting and printing ` Pantree ` objects
## Description
Generic functio... | |
R_base_tools/R_base_all_195_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# NumericConstants: Numeric Constants
## Description
How R parses numeric constants.
## ... | |
R_base_tools/R_base_all_43_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# DateTimeClasses: Date-Time Classes
## Description
Description of the classes ` "POSIXlt" `... | |
R_base_tools/strings.html7_120_0.txt |
a1 <- "\u00e1"
a2 <- "a\u0301"
c(a1, a2)
#> [1] "á" "á"
a1 == a2
#> [1] FALSE
They render identically, but because they’re defined differently, ` fixed() `
doesn’t find a match. Instead, you can use ` coll() ` , defined next, to
respect human character comparison rules: | |
R_base_tools/R_base_all_303_2.txt |
## adding a column
sw["new1"] <- LETTERS[1:5] # adds a character column
sw[["new2"]] <- letters[1:5] # ditto
sw[, "new3"] <- LETTERS[1:5] # ditto
sw$new4 <- 1:5
sapply(sw, class)
sw$new # -> NULL: no unique partial match
sw$new4 <- NULL # delete the column
sw
sw... | |
R_base_tools/R_micropan_8_1.txt | ata.path,db),out.folder=".")
#
# # ...and compressing all files again...
# pth <- lapply( file.path( extdata.path, filenames ), xzcompress )
# pth <- lapply( file.path( extdata.path,
# paste( db, c(".h3f",".h3i",".h3m",".h3p"), sep="" ) ), xzcompress )
# ## End(Not run)
Run ... | |
R_base_tools/R_base_4_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# file.path: Construct Path to File
## Description
Construct the path to a file from compone... | |
R_base_tools/R_base_all_35_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# charmatch: Partial String Matching
## Description
` charmatch ` seeks matches for the elem... | |
R_base_tools/strings.html7_85_0.txt | 2. What word has the highest number of vowels? What word has the highest proportion of vowels? (Hint: what is the denominator?)
### 14.4.2 Extract matches | |
R_base_tools/R_base_all_329_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Internal: Call an Internal Function
## Description
` .Internal ` performs a call to an int... | |
R_base_tools/R_base_all_179_1.txt | f [ double
](/link/double?package=base&version=3.6.2) precision numbers, either or both
of which can be ` [ NaN ](/link/NaN?package=base&version=3.6.2) ` (including `
NA ` , see ` [ NA_complex_ ](/link/NA_complex_?package=base&version=3.6.2) `
and above) or plus or minus infinity.
## References
Becker, R. A., Chambe... | |
R_base_tools/R_micropan_33_1.txt | ering.
## References
Camacho, C., Coulouris, G., Avagyan, V., Ma, N., Papadopoulos, J., Bealer, K.,
Madden, T.L. (2009). BLAST+: architecture and applications. BMC
Bioinformatics, 10:421.
## See Also
` [ panPrep ](/link/panPrep?package=micropan&version=1.0) ` , ` [
readBlastTable ](/link/readBlastTable?package=mi... | |
R_base_tools/R_base_all_199_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# options: Options Settings
## Description
Allow the user to set and examine a variety of gl... | |
R_base_tools/R_base_all_183_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# lower.tri: Lower and Upper Triangular Part of a Matrix
## Description
Returns a matrix of ... | |
R_base_tools/R_base_all_390_1.txt | s to mode ` "qr" ` . Objects either are QR
decompositions or they are not.
The LINPACK interface is restricted to matrices ` x ` with less than
\\(2^{31}\\) elements.
` qr.fitted ` and ` qr.resid ` only support the LINPACK interface.
Unsuccessful results from the underlying LAPACK code will result in an error
giving... | |
R_base_tools/stringr.html3_21_0.txt | * ` str_replace() ` replaces the first matched pattern and returns a character vector. ` str_replace_all() ` replaces all matches. Similar to ` sub() ` and ` gsub() ` .
str_replace(strings, phone, "XXX-XXX-XXXX")
#> [1] "apple"
#> [2] "XXX-XXX-XXXX" ... | |
R_base_tools/R_base_all_178_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# rapply: Recursively Apply a Function to a List
## Description
` rapply ` is a recursive ve... | |
R_base_tools/strings.html7_57_0.txt | * ` ? ` : 0 or 1
* ` + ` : 1 or more
* ` * ` : 0 or more
x <- "1888 is the longest year in Roman numerals: MDCCCLXXXVIII"
str_view(x, "CC?")
#> [1] │ 1888 is the longest year in Roman numerals: MD<CC><C>LXXXVIII
str_view(x, "CC+")
#> [1] │ 1888 is the longest year in Roman numera... | |
R_base_tools/R_base_all_50_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# is.recursive: Is an Object Atomic or Recursive?
## Description
` is.atomic ` returns ` TRU... | |
R_base_tools/R_base_all_59_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Sys.localeconv: Find Details of the Numerical and Monetary Representations
in the Current Loc... | |
R_base_tools/R_base_all_421_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# Sys.info: Extract System and User Information
## Description
Reports system and user infor... | |
R_base_tools/strings.html6_43_0.txt | Quantifiers regexp | matches | example | example output
(highlighted characters are in <>)
---|---|---|---
` a? ` | zero or one | ` quant("a?") ` |
<>.<a><>.<a><a><>.<a><a><a><>
` a* ` | zero or more | ` quant("a*") ` |
<>.<a><>.<aa><>.<aaa><>
` a+ ` | one or... | |
R_base_tools/R_base_all_106_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# toString: Convert an R Object to a Character String
## Description
This is a helper functi... | |
R_base_tools/strings.html7_58_0.txt | Note that the precedence of these operators is high, so you can write: `
colou?r ` to match either American or British spellings. That means most uses
will need parentheses, like ` bana(na)+ ` .
You can also specify the number of matches precisely: | |
R_base_tools/R_base_all_206_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# typeof: The Type of an Object
## Description
` typeof ` determines the ( R internal) typ... | |
R_base_tools/R_base_all_19_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# merge: Merge Two Data Frames
## Description
Merge two data frames by common columns or row... | |
R_base_tools/R_base_all_304_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# InternalMethods: Internal Generic Functions
## Description
Many R -internal functions ar... | |
R_base_tools/R_micropan_26_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ micropan (version 1.0 ) ](/packages/micropan/versions/1.0)
# gregexpr: Extended ` [ gregexpr
](/link/gregexpr?package=micropan&version=1.0) ` with sub... | |
R_base_tools/R_base_all_21_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# make.names: Make Syntactically Valid Names
## Description
Make syntactically valid names o... | |
R_base_tools/strings.html6_34_0.txt | * ` boundary() ` : Matches boundaries between characters, line_breaks, sentences, or words.
str_split(sentences, boundary("word"))
### Match Characters | |
R_base_tools/R_base_all_62_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# dim: Dimensions of an Object
## Description
Retrieve or set the dimension of an object.
#... | |
R_base_tools/R_micropan_34_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ micropan (version 1.0 ) ](/packages/micropan/versions/1.0)
# chao: The Chao lower bound estimate of pan-genome size
## Description
Computes the Cha... | |
R_base_tools/strings.html6_36_0.txt | * The ` [:space:] ` class includes new line, and the ` [:blank:] ` class
* The ` [:blank:] ` class includes space and tab ( ` \t ` )
* The ` [:graph:] ` class contains all non-space characters, including ` [:punct:] ` , ` [:symbol:] ` , ` [:alnum:] ` , ` [:digit:] ` , ` [:alpha:] ` , ` [:lower:] ` , and ` [:u... | |
R_base_tools/R_base_all_114_1.txt | ndent characters.
[:upper:]
Upper-case letters in the current locale.
[:xdigit:]
Hexadecimal digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f .
For example, [[:alnum:]] means [0-9A-Za-z] , except the latter depends
upon the locale and the character encoding, whereas the former is independent
o... | |
R_base_tools/R_base_all_200_3.txt | package=base&version=3.6.2) ` .
[ https://en.wikipedia.org/wiki/Time_zone
](https://en.wikipedia.org/wiki/Time_zone) and [ https://data.iana.org/time-
zones/tz-link.html ](https://data.iana.org/time-zones/tz-link.html) for
extensive sets of links.
[ https://data.iana.org/time-zones/theory.html ](https://data.iana.org... | |
R_base_tools/strings.html7_19_0.txt | As shown above, ` str_c() ` is vectorised, and it automatically recycles
shorter vectors to the same length as the longest:
str_c("prefix-", c("a", "b", "c"), "-suffix")
#> [1] "prefix-a-suffix" "prefix-b-suffix" "prefix-c-suffix" | |
R_base_tools/strings.html6_32_0.txt | Patterns in stringr are interpreted as regexs. To change this default, wrap
the pattern in one of:
* ` regex(pattern, ignore_case = FALSE, multiline = FALSE, comments = FALSE, dotall = FALSE, ...) ` : Modifies a regex to ignore cases, match end of lines as well as end of strings, allow R comments within regexs, and/... | |
R_base_tools/R_base_all_174_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# lengths: Lengths of List or Vector Elements
## Description
Get the length of each element ... | |
R_base_tools/stringr.html3_18_0.txt |
strings <- c(
"apple",
"219 733 8965",
"329-293-8753",
"Work: 579-499-7527; Home: 543.355.3679"
)
phone <- "([2-9][0-9]{2})[- .]([0-9]{3})[- .]([0-9]{4})"
* ` str_detect() ` detects the presence or absence of a pattern and returns a logical vector (similar to ` grepl(... | |
R_base_tools/R_micropan_24_1.txt | //www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2FdistManhattan&utm_source=r-docs&utm_medium=docs&utm_term=distManhattan&utm_content=run_example_in_datalab)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/R_base_all_114_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# regex: Regular Expressions as used in R
## Description
This help page documents the regula... | |
R_base_tools/R_base_all_250_1.txt | package=base&version=3.6.2) ` , ` [ is.nan
](/link/is.nan?package=base&version=3.6.2) ` , etc., and the utility function
` [ complete.cases ](/link/complete.cases?package=base&version=3.6.2) ` .
` [ na.action ](/link/na.action?package=base&version=3.6.2) ` , ` [ na.omit
](/link/na.omit?package=base&version=3.6.2) ` , ... | |
R_base_tools/R_base_all_406_1.txt | code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Ftry&utm_source=r-docs&utm_medium=docs&utm_term=try&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/strings.html7_40_0.txt | 3. What patterns will the regular expression ` \..\..\.. ` match? How would you represent it as a string?
### 14.3.2 Anchors | |
R_base_tools/R_base_all_424_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# format.pval: Format P Values
## Description
` format.pval ` is intended for formatting p-v... | |
R_base_tools/R_base_all_199_6.txt | us plotting (default 500). The values at
the time the device is opened are used.
## Other options used by package graphics
` max.contour.segments ` :
positive integer, defaulting to ` 25000 ` if not set. A limit on the number of
segments in a single contour line in ` [ contour
](/link/contour?package=base&ver... | |
R_base_tools/R_base_all_368_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# prop.table: Express Table Entries as Fraction of Marginal Table
## Description
This is rea... | |
R_base_tools/strings.html7_59_0.txt | * ` {n} ` : exactly n
* ` {n,} ` : n or more
* ` {,m} ` : at most m
* ` {n,m} ` : between n and m
str_view(x, "C{2}")
#> [1] │ 1888 is the longest year in Roman numerals: MD<CC>CLXXXVIII
str_view(x, "C{2,}")
#> [1] │ 1888 is the longest year in Roman numerals: MD<CCC>LXXXVIII
... | |
R_base_tools/R_base_all_72_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# icuSetCollate: Setup Collation by ICU
## Description
Controls the way collation is done by... | |
R_base_tools/R_base_all_358_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# gettext: Translate Text Messages
## Description
If Native Language Support was enabled in ... | |
R_base_tools/R_base_all_341_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# standardGeneric: Formal Method System -- Dispatching S4 Methods
## Description
The functio... | |
R_base_tools/strings.html7_49_0.txt | A character class containing a single character is a nice alternative to
backslash escapes when you want to include a single metacharacter in a regex.
Many people find this more readable.
# Look for a literal character that normally has special meaning in a regex
str_view(c("abc", "a.c", "a*c", "a c"... | |
R_base_tools/stringr.html4_10_0.txt | Vectors in ` R ` are all expected to be of the same type: logicals, numerics,
characters, etc.,. In the case of a mixed type, ` R ` coerces all of the
elements to be the same. There is a hierarchy in coercion in that all logicals
can be represented by numerics, and all numerics can be represented as
characters, etc.,.... | |
R_base_tools/stringr.html3_30_0.txt | ` boundary() ` matches boundaries between characters, lines, sentences or
words. Itâs most useful with ` str_split() ` , but can be used with all
pattern matching functions:
x <- "This is a sentence."
str_split(x, boundary("word"))
#> [[1]]
#> [1] "This" "is" "a" "sentence"... | |
R_base_tools/R_base_all_229_1.txt | code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fcat&utm_source=r-docs&utm_medium=docs&utm_term=cat&utm_content=run_example_in_workspace)
# NOT RUN {
iter <- stats::rpois(1, lambda = 10)
## print an informative message
cat("i... | |
R_base_tools/stringr.html3_1_0.txt | 1. Character manipulation: these functions allow you to manipulate individual characters within the strings in character vectors.
2. Whitespace tools to add, remove, and manipulate whitespace. | |
R_base_tools/strings.html7_114_0.txt | ` str_locate() ` and ` str_locate_all() ` give you the starting and ending
positions of each match. These are particularly useful when none of the other
functions does exactly what you want. You can use ` str_locate() ` to find
the matching pattern, ` str_sub() ` to extract and/or modify them.
## 14.5 Other type... | |
R_base_tools/strings.html6_15_0.txt | * ` str_match(string, pattern) ` : Return the first pattern match found in each string, as a matrix with a column for each ( ) group in pattern. Also ` str_match_all() ` .
str_match(sentences, "(a|the) ([^ +])")
## Join and Split | |
R_base_tools/stringr.html4_68_0.txt |
s <- "iowa"
str_count(s, "[aeiou]{2}")
## [1] 1
str_view(s, "[aeiou]{2}")
## [1] │ <io>wa
Of course, as with other regular expressions, we must be very precise in what
we are asking, for as we ask, thus we shall receive. | |
R_base_tools/R_base_all_138_2.txt | zz, justify = "left")
## use of nsmall
format(13.7)
format(13.7, nsmall = 3)
format(c(6.0, 13.1), digits = 2)
format(c(6.0, 13.1), digits = 2, nsmall = 1)
## use of scientific
format(2^31-1)
format(2^31-1, scientific = TRUE)
## a list
z <- list(a = letters[1:3], b ... | |
R_base_tools/R_micropan_22_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ micropan (version 1.0 ) ](/packages/micropan/versions/1.0)
# readBlastTable: Reading BLAST result file
## Description
Reading a file produced by th... | |
R_base_tools/strings.html7_107_0.txt |
sentences %>%
head(5) %>%
str_split(" ")
#> [[1]]
#> [1] "The" "birch" "canoe" "slid" "on" "the" "smooth"
#> [8] "planks."
#>
#> [[2]]
#> [1] "Glue" "the" "sheet" "to" "the"
#> [6] "dark" "blue" ... | |
R_base_tools/strings.html6_20_0.txt | * ` str_pad(string, width, side = c("left", "right", "both"), pad = " ") ` : Pad strings to constant width.
str_pad(fruit, 17)
* ` str_trunc(string, width, side = c("left", "right", "both"), ellipsis = "...") ` : Truncate the width of strings, replacing content with ellipsis.
str_trunc(... | |
R_base_tools/R_base_all_252_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# sQuote: Quote Text
## Description
Single or double quote text by combining with appropriat... | |
R_base_tools/R_base_all_103_1.txt | ude ranges such as ` [A-Z] ` : include ` - ` as a
character by having it first or last in a class. (In the current
implementation ranges are in the numeric order of Unicode code points.)
One can remove the special meaning of ` ? ` , ` * ` and ` [ ` by preceding
them by a backslash (except within a character class). No... | |
R_base_tools/stringr.html3_17_0.txt | ### Tasks
Each pattern matching function has the same first two arguments, a character
vector of ` string ` s to process and a single ` pattern ` to match. stringr
provides pattern matching functions to detect , locate , extract ,
match , replace , and split strings. Iâll illustrate how they work with
so... | |
R_base_tools/strings.html7_82_0.txt | Note the use of ` str_view_all() ` . As you’ll shortly learn, many stringr
functions come in pairs: one function works with a single match, and the other
works with all matches. The second function will have the suffix ` _all ` .
#### 14.4.1.1 Exercises | |
R_base_tools/strings.html6_33_0.txt | * ` fixed() ` : Matches raw bytes but will miss some characters that can be represented in multiple ways (fast).
str_detect("\u0130", fixed("i"))
* ` coll() ` : Matches raw bytes and will use locale specific collation rules to recognize characters that can be represented in multiple ways (slow).
... | |
R_base_tools/R_base_all_428_1.txt | g) ` is equivalent to but more efficient than ` pkg %in%
loadedNamespaces() ` .
` unloadNamespace ` can be used to attempt to force a name space to be
unloaded. If the name space is attached, it is first ` [ detach
](/link/detach?package=base&version=3.6.2) ` ed, thereby running a ` [
.onDetach ](/link/.onDetach?packa... | |
R_base_tools/stringr.html4_70_0.txt | Now modify the regular expression so that in only pulls out ` "22two" ` .
Hint: what is in front of the digits and what is behind them? What regular
expressions can you combine to get what you want?
| |
R_base_tools/R_base_all_102_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# missing: Does a Formal Argument have a Value?
## Description
` missing ` can be used to te... | |
R_base_tools/strings.html7_119_0.txt | * ` fixed() ` : matches exactly the specified sequence of bytes. It ignores all special regular expressions and operates at a very low level. This allows you to avoid complex escaping and can be much faster than regular expressions. The following microbenchmark shows that it’s about 3x faster for a simple example.
... | |
R_base_tools/strings.html7_55_0.txt | 4. Write a regular expression that matches a word if it’s probably written in British English, not American English.
5. Create a regular expression that will match telephone numbers as commonly written in your country. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.