id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
R_base_tools/strings.html7_53_0.txt | 3. End with ` ed ` , but not with ` eed ` .
4. End with ` ing ` or ` ise ` . | |
R_base_tools/R_base_all_114_3.txt | ny Unicode newline
character (not just CR), and \X matches any number of Unicode characters
that form an extended Unicode sequence.
In UTF-8 mode, some Unicode properties may be supported via \p{xx} and
\P{xx} which match characters with and without property xx respectively.
For a list of supported properties s... | |
R_base_tools/R_base_all_356_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)
# dimnames: Dimnames of an Object
## Description
Retrieve or set the dimnames of an object.
... | |
R_base_tools/stringr.html4_7_0.txt | ` str_sub ` stands for “substring” rather than “subset”, which exists in the
more useful function ` str_subset ` (observe that all stringr functions begin
with ` str_ ` ). While this is one of the less useful functions, it is helpful
in illustrating a few concepts. Using ` str_sub ` , we can also specify that
we want a... | |
R_base_tools/strings.html6_26_0.txt | 1 See http://bit.ly/ISO639-1 for a complete list of locales.
## Regular Expressions | |
R_base_tools/strings.html7_22_0.txt | ### 14.2.3 Subsetting strings
You can extract parts of a string using ` str_sub() ` . As well as the
string, ` str_sub() ` takes ` start ` and ` end ` arguments which give the
(inclusive) position of the substring: | |
R_base_tools/strings.html6_24_0.txt | * ` str_conv(string, encoding) ` : Override the encoding of a string.
str_conv(fruit, "ISO-8859-1")
* ` str_view(string, pattern, match = NA) ` : View HTML rendering of all regex matches. Also ` str_view() ` to see only the first match.
str_view(sentences, "[aeiou]") | |
R_base_tools/R_base_all_226_1.txt | Run the code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fwarnings&utm_source=r-docs&utm_medium=docs&utm_term=warnings&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp... | |
R_base_tools/R_base_all_347_1.txt | after possible coercion to character). Elements of
character vectors ` x ` which are not substituted will be returned unchanged
(including any declared encoding). If ` useBytes = FALSE ` a non-ASCII
substituted result will often be in UTF-8 with a marked encoding (e.g., if
there is a UTF-8 input, and in a multibyte loc... | |
R_base_tools/R_base_all_118_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)
# Round: Rounding of Numbers
## Description
` ceiling ` takes a single numeric argument ` x ... | |
R_base_tools/R_base_all_149_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)
# builtins: Returns the Names of All Built-in Objects
## Description
Return the names of all... | |
R_base_tools/R_tools_0_1.txt | the output of ` parse_Rd() ` .
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/R_base_all_267_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)
# Random.user: User-supplied Random Number Generation
## Description
Function ` [ RNGkind ](... | |
R_base_tools/strings.html7_8_0.txt |
> "This is a string without a closing quote
+
+
+ HELP I'M STUCK
If this happen to you, press Escape and try again! | |
R_base_tools/R_base_all_147_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)
# data.matrix: Convert a Data Frame to a Numeric Matrix
## Description
Return the matrix obt... | |
R_base_tools/stringr.html3_9_0.txt | 1. ` str_pad() ` pads a string to a fixed length by adding extra whitespace on the left, right, or both sides.
x <- c("abc", "defghi")
str_pad(x, 10) # default pads on left
#> [1] " abc" " defghi"
str_pad(x, 10, "both")
#> [1] " abc " " defghi "
(You can pad with other c... | |
R_base_tools/R_base_all_261_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)
# match.arg: Argument Verification Using Partial Matching
## Description
` match.arg ` match... | |
R_base_tools/R_base_all_75_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)
# interaction: Compute Factor Interactions
## Description
` interaction ` computes a factor ... | |
R_base_tools/strings.html6_4_0.txt |
Translations (PDF) | |
R_base_tools/strings.html7_11_0.txt |
x <- c("\"", "\\")
x
#> [1] "\"" "\\"
writeLines(x)
#> "
#> \
There are a handful of other special characters. The most common are ` "\n" `
, newline, and ` "\t" ` , tab, but you can see the complete list by requesting
help on ` " ` : ` ?'"' ` , or ` ?"'" ` . You’ll also sometimes s... | |
R_base_tools/R_base_all_353_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)
# subset: Subsetting Vectors, Matrices and Data Frames
## Description
Return subsets of vect... | |
R_base_tools/strings.html7_103_0.txt | Instead of replacing with a fixed string you can use backreferences to insert
components of the match. In the following code, I flip the order of the second
and third words.
sentences %>%
str_replace("([^ ]+) ([^ ]+) ([^ ]+)", "\\1 \\3 \\2") %>%
head(5)
#> [1] "The canoe birch slid on t... | |
R_base_tools/strings.html7_34_0.txt | The simplest patterns match exact strings:
x <- c("apple", "banana", "pear")
str_view(x, "an")
#> [2] │ b<an><an>a | |
R_base_tools/R_base_all_316_1.txt | ers[1:5], 10, replace = TRUE))
for(i in unique(f)) print(i)
# }
Run the code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FControl&utm_source=r-docs&utm_medium=docs&utm_term=Control&utm_cont... | |
R_base_tools/R_base_all_276_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)
# gctorture: Torture Garbage Collector
## Description
Provokes garbage collection on (nearly... | |
R_base_tools/R_base_all_231_3.txt | integer indices are truncated:
(i <- 3.999999999) # "4" is printed
(1:5)[i] # 3
## named atomic vectors, compare "[" and "[[" :
nx <- c(Abc = 123, pi = pi)
nx[1] ; nx["pi"] # keeps names, whereas "[[" does not:
nx[[1]] ; nx[["pi"]]
# }
# NOT RUN {
## recursive indexing into lis... | |
R_base_tools/R_base_all_150_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)
# forceAndCall: Call a function with Some Arguments Forced
## Description
Call a function wi... | |
R_base_tools/R_micropan_2_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)
# entrezDownload: Downloading genome data
## Description
Retrieving genomes from NCBI us... | |
R_base_tools/R_base_all_412_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.function: Is an Object of Type (Primitive) Function?
## Description
Checks whether its ... | |
R_base_tools/strings.html7_126_0.txt | There are two useful function in base R that also use regular expressions:
* ` apropos() ` searches all objects available from the global environment. This is useful if you can’t quite remember the name of the function.
apropos("replace")
#> [1] "%+replace%" "replace" "replace_na" ... | |
R_base_tools/R_base_all_111_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)
# unique: Extract Unique Elements
## Description
` unique ` returns a vector, data frame or ... | |
R_base_tools/R_base_all_231_1.txt | rators can be used for
replacement.
` [[ ` can be applied recursively to lists, so that if the single index ` i `
is a vector of length ` p ` , ` alist[[i]] ` is equivalent to `
alist[[i1]]…[[ip]] ` providing all but the final indexing results in a list.
Note that in all three kinds of replacement, a value of ` NULL ... | |
R_base_tools/R_micropan_16_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)
# binomixMachine: Computing engine for binomial mixture models
## Description
A function... | |
R_base_tools/R_base_all_284_2.txt | e C Programming Language._
Second edition, Prentice Hall. Describes the format options in table B-1 in
the Appendix.
The C Standards, especially ISO/IEC 9899:1999 for ‘C99’. Links can be found at
[ https://developer.r-project.org/Portability.html
](https://developer.r-project.org/Portability.html) .
` man sprintf ` o... | |
R_base_tools/strings.html7_42_0.txt |
x <- c("apple", "banana", "pear")
str_view(x, "^a")
#> [1] │ <a>pple
str_view(x, "a$")
#> [2] │ banan<a>
To remember which is which, try this mnemonic which I learned from Evan
Misshula : if you begin with power ( ` ^ ` ), you end up with money ( ` $ `
). | |
R_base_tools/R_base_all_1_3.txt | nif(1); .Random.seed[1:6]
## If there is no seed, a "random" new one is created:
rm(.Random.seed); runif(1); .Random.seed[1:6]
# }
# NOT RUN {
ok <- RNGkind()
RNGkind("Wich") # (partial string matching on 'kind')
## This shows how 'runif(.)' works for Wichmann-Hill,
## using only... | |
R_base_tools/R_base_all_386_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)
# pushBack: Push Text Back on to a Connection
## Description
Functions to push back text lin... | |
R_base_tools/R_micropan_7_1.txt | etween 0.0 and 1.0 the
transformed value is shrunk towards 1, but a certain effect of larger copy
numbers is still present. In this way you can decide if the PCA should be
affected, and to what degree, by differences in copy numbers beyond 1. The PCA
can also up- or downweight some clusters compared to others. The vect... | |
R_base_tools/R_base_all_274_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)
# matmult: Matrix Multiplication
## Description
Multiplies two matrices, if they are conform... | |
R_base_tools/strings.html7_29_0.txt | 1. In code that doesn’t use stringr, you’ll often see ` paste() ` and ` paste0() ` . What’s the difference between the two functions? What stringr function are they equivalent to? How do the functions differ in their handling of ` NA ` ?
2. In your own words, describe the difference between the ` sep ` and ` co... | |
R_base_tools/R_base_all_302_1.txt | alue to be specified
## -- it is always NULL
for(i in c(-1:3, 9)) print(switch(i, 1, 2 , 3, 4))
## visibility
switch(1, invisible(pi), pi)
switch(2, invisible(pi), pi)
# }
Run the code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag... | |
R_base_tools/R_base_all_135_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)
# identity: Identity Function
## Description
A trivial identity function returning its argum... | |
R_base_tools/R_base_all_173_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)
# noquote: Class for ‘no quote’ Printing of Character Strings
## Description
Print character... | |
R_base_tools/R_base_all_228_1.txt | , "a" < "b")
## More convenient for interactive "line by line" evaluation:
stopifnot(exprs = {
all.equal(pi, 3.1415927)
2 < 2
all(1:10 < 12)
"a" < "b"
})
# long all.equal() error messages are abbreviated:
stopifnot(all.equal(rep(list(pi),4), list(3.1, 3.14, 3.141, 3.1415... | |
R_base_tools/R_base_all_395_1.txt | rwise usually ` 8 ` .
sizeof.longdouble
the number of bytes in a C ` long double ` type. Will be zero if there is no
such type (or its use was disabled when R was built), otherwise possibly `
12 ` (most 32-bit builds) or ` 16 ` (most 64-bit builds).
sizeof.pointer
the number of bytes in a C ` SEXP ` t... | |
R_base_tools/R_base_all_391_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)
# trimws: Remove Leading/Trailing Whitespace
## Description
Remove leading and/or trailing w... | |
R_base_tools/strings.html7_61_0.txt | #### 14.3.4.1 Exercises
1. Describe the equivalents of ` ? ` , ` + ` , ` * ` in ` {m,n} ` form. | |
R_base_tools/R_base_all_238_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)
# reg.finalizer: Finalization of Objects
## Description
Registers an R function to be call... | |
R_base_tools/R_base_all_348_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)
# srcfile: References to Source Files and Code
## Description
These functions are for workin... | |
R_base_tools/strings.html7_112_0.txt | 1. Split up a string like ` "apples, pears, and bananas" ` into individual components.
2. Why is it better to split up by ` boundary("word") ` than ` " " ` ? | |
R_base_tools/R_base_all_122_1.txt | ): it is only portable to use
` file.rename ` to change file name(s) within a single directory.
## Details
The ` … ` arguments are concatenated to form one character string: you can
specify the files separately or as one vector. All of these functions expand
path names: see ` [ path.expand
](/link/path.expand?packag... | |
R_base_tools/strings.html7_13_0.txt |
c("one", "two", "three")
#> [1] "one" "two" "three"
### 14.2.1 String length | |
R_base_tools/R_base_all_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
[ base (version 3.6.2 ) ](/packages/base/versions/3.6.2)
# colSums: Form Row and Column Sums and Means
## Description
Form row and column sums and me... | |
R_base_tools/R_base_all_39_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)
# findInterval: Find Interval Numbers or Indices
## Description
Given a vector of non-decrea... | |
R_base_tools/R_base_all_124_1.txt | ll return ` from ` .
For ` seq ` (only), up to two of ` from ` , ` to ` and ` by ` can be supplied
as complex values provided ` length.out ` or ` along.with ` is specified. More
generally, the default method of ` seq ` will handle classed objects with
methods for the ` Math ` , ` Ops ` and ` Summary ` group generics.
... | |
R_base_tools/R_base_all_243_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.setFileTime: Set File Time
## Description
Uses system calls to set the times on a file... | |
R_base_tools/R_base_all_220_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)
# call: Function Calls
## Description
Create or test for objects of ` [ mode
](/link/mode?pa... | |
R_base_tools/R_tools_1_0.txt | [ RDocumentation ](/)
Moon [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)
Search all packages and functions
[ tools (version 3.6.2 ) ](/packages/tools/versions/3.6.2)
# pskill: Kill a Process
## Description
` pskill ` sends a signal to a process, usually to... | |
R_base_tools/R_base_all_388_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.getpid: Get the Process ID of the R Session
## Description
Get the process ID of the ... | |
R_base_tools/strings.html6_47_0.txt |
packageVersion("stringr")
[1] '1.5.0'
* * * | |
R_base_tools/strings.html7_50_0.txt | This works for most (but not all) regex metacharacters: ` $ ` ` . ` ` | ` ` ? ` ` * ` ` + ` ` ( ` ` ) ` ` [ ` ` { ` . Unfortunately, a few characters have special meaning even inside a character class and must be handled with backslash escapes: ` ] ` ` \ ` ` ^ ` and ` - ` .
You can use alternation to pick between o... | |
R_base_tools/stringr.html3_10_0.txt | ` str_pad() ` will never make a string shorter:
str_pad(x, 4)
#> [1] " abc" "defghi" | |
R_base_tools/R_base_all_318_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)
# gl: Generate Factor Levels
## Description
Generate factors by specifying the pattern of th... | |
R_base_tools/R_base_all_372_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)
# as.Date: Date Conversion Functions to and from Character
## Description
Functions to conve... | |
R_base_tools/R_base_all_235_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)
# duplicated: Determine Duplicate Elements
## Description
` duplicated() ` determines which ... | |
R_base_tools/stringr.html4_36_0.txt | There is also ` str_subset ` which will instead retain each element of a
character vector matching a pattern, discarding everything else
x <- c("apple", "banana", "melon")
str_subset(x, "a")
## [1] "apple" "banana" | |
R_base_tools/strings.html7_30_0.txt | 3. Use ` str_length() ` and ` str_sub() ` to extract the middle character from a string. What will you do if the string has an even number of characters?
4. What does ` str_wrap() ` do? When might you want to use it? | |
R_base_tools/stringr.html4_23_0.txt | Oddly (and this also applies to most ` stringr ` functions), these operations
typically only happen on the first instance of a pattern match. So, for
example, if a particular pattern shows up multiple times in a string, the
replacement will only occur on the first
dog <- "dog_dog_dog_dog_dog"
str_r... | |
R_base_tools/R_base_all_332_1.txt | ss several vectors to paste0, they are concatenated in a
## vectorized way.
(nth <- paste0(1:12, c("st", "nd", "rd", rep("th", 9))))
## paste works the same, but separates each input with a space.
## Notice that the recycling rules make every input as long as the longest input.
paste(month.abb,... | |
R_base_tools/strings.html7_113_0.txt | 3. What does splitting with an empty string ( ` "" ` ) do? Experiment, and then read the documentation.
### 14.4.6 Find matches | |
R_base_tools/R_base_all_235_1.txt | base&version=3.6.2) ` ) which use the same concept.
Values in ` incomparables ` will never be marked as duplicated. This is
intended to be used for a fairly small set of values and will not be efficient
for a very large set.
Except for factors, logical and raw vectors the default ` nmax = NA ` is
equivalent to ` nmax... | |
R_base_tools/R_base_all_165_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/strings.html7_89_0.txt | Note that ` str_extract() ` only extracts the first match. We can see that
most easily by first selecting all the sentences that have more than 1 match:
more <- sentences[str_count(sentences, colour_match) > 1]
str_view_all(more, colour_match)
#> [1] │ It is hard to erase <blue> or <red> ink.
... | |
R_base_tools/R_base_all_20_1.txt | ns%2F3.6.2%2Ftopics%2Flist.files&utm_source=r-docs&utm_medium=docs&utm_term=list.files&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/R_base_all_124_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)
# seq: Sequence Generation
## Description
Generate regular sequences. ` seq ` is a standard ... | |
R_base_tools/R_base_all_143_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)
# get: Return the Value of a Named Object
## Description
Search by name for an object ( ` ge... | |
R_base_tools/R_base_all_105_1.txt | browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FmemCompress&utm_source=r-docs&utm_medium=docs&utm_term=memCompress&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/R_micropan_15_1.txt | 09_GID123.fsa
# ...and compress the input file again...
pth <- lapply( file.path( extdata.path, filenames ), xzcompress )
Run the code above in your browser using [ DataLab
](https://www.datacamp.com/datalab/preview?_tag=rdocs&rdocsPath=packages%2Fmicropan%2Fversions%2F1.0%2Ftopics%2FpanPrep&utm_sou... | |
R_base_tools/R_base_all_323_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)
# Reserved: Reserved Words in R
## Description
The reserved words in R 's parser are
` [ ... | |
R_base_tools/strings.html7_102_0.txt | With ` str_replace_all() ` you can perform multiple replacements by supplying
a named vector:
x <- c("1 house", "2 cars", "3 people")
str_replace_all(x, c("1" = "one", "2" = "two", "3" = "three"))
#> [1] "one house" "two cars" "three people" | |
R_base_tools/R_base_all_408_2.txt | sion=3.6.2) ` .
For other interfaces to the underlying serialization format, see ` [ serialize
](/link/serialize?package=base&version=3.6.2) ` and ` [ saveRDS
](/link/saveRDS?package=base&version=3.6.2) ` .
## Examples
[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase... | |
R_base_tools/R_base_all_221_1.txt | ver). Future versions may allow some control of the result type.
` Negate ` corresponds to Common Lisp's ` complement ` . Given a (predicate)
function ` f ` , it creates a function which returns the logical negation of
what ` f ` returns.
## See Also
Function ` [ clusterMap ](/link/clusterMap?package=base&version=3... | |
R_base_tools/R_base_all_182_1.txt | //www.datacamp.com/)
| |
R_base_tools/strings.html7_110_0.txt |
fields <- c("Name: Hadley", "Country: NZ", "Age: 35")
fields %>% str_split(": ", n = 2, simplify = TRUE)
#> [,1] [,2]
#> [1,] "Name" "Hadley"
#> [2,] "Country" "NZ"
#> [3,] "Age" "35"
Instead of splitting up strings by patterns, you can also split up by
charac... | |
R_base_tools/stringr.html4_27_0.txt |
s <- "tHe quIcK brOWn fOX juMPeD oVeR tHe LAzY dOG"
# Make all lower
str_to_lower(s)
## [1] "the quick brown fox jumped over the lazy dog"
# Make all upper
str_to_upper(s)
## [1] "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG"
# Make ... | |
R_base_tools/R_base_all_382_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)
# structure: Attribute Specification
## Description
` structure ` returns the given object w... | |
R_base_tools/R_base_all_65_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)
# base-defunct: Defunct Functions in Package base
## Description
The functions or variables... | |
R_base_tools/stringr.html4_57_0.txt |
phone_strings <- c("Home: (507)-645-5489",
"Cell: 219.917.9871",
"My work phone is 507-202-2332",
"I don't have a phone")
Using functions from this lab, extract the phone numbers from the character
vector and modify the strings so t... | |
R_base_tools/R_base_all_293_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)
# readRDS: Serialization Interface for Single Objects
## Description
Functions to write a si... | |
R_base_tools/R_base_all_131_1.txt | modify each argument
using ` [ factor ](/link/factor?package=base&version=3.6.2) ` or ` [ addNA
](/link/addNA?package=base&version=3.6.2) ` .
Non-factor arguments ` a ` are coerced via ` factor(a, exclude=exclude) ` .
Since R 3.4.0, care is taken _not_ to count the excluded values (where they
were included in the ` ... | |
R_base_tools/strings.html7_47_0.txt | ### 14.3.3 Character classes and alternatives
There are a number of special patterns that match more than one character.
You’ve already seen ` . ` , which matches any character apart from a newline.
There are four other useful tools: | |
R_base_tools/R_base_all_322_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.info: format(.) Information
## Description
Information is returned on how ` [ forma... | |
R_base_tools/R_base_all_199_4.txt | d warning and error messages show a summary of the call stack?
By default error calls are shown in non-interactive sessions.
` showNCalls ` :
integer. Controls how long the sequence of calls must be (in bytes) before
ellipses are used. Defaults to 40 and should be at least 30 and no more than
500.
` show.error... | |
R_base_tools/R_base_all_104_1.txt | # close devices before printing
cat("Now sending PDF graphics to the printer:\n")
system("lpr Rplots.pdf")
cat("bye bye...\n")
}
quit("yes")
# }
Run the code above in your browser using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%... | |
R_base_tools/R_base_all_387_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)
# rawConnection: Raw Connections
## Description
Input and output raw connections.
## Usage... | |
R_base_tools/stringr.html3_11_0.txt | So if you want to ensure that all strings are the same length (often useful
for print methods), combine ` str_pad() ` and ` str_trunc() ` :
x <- c("Short", "This is a long string")
x %>%
str_trunc(10) %>%
str_pad(10, "right")
#> [1] "Short " "This is..." | |
R_base_tools/strings.html7_70_0.txt | A word of caution before we continue: because regular expressions are so
powerful, it’s easy to try and solve every problem with a single regular
expression. In the words of Jamie Zawinski:
> Some people, when confronted with a problem, think “I know, I’ll use regular
> expressions.” Now they have two problems. | |
R_base_tools/strings.html7_32_0.txt | ## 14.3 Matching patterns with regular expressions
Regexps are a very terse language that allow you to describe patterns in
strings. They take a little while to get your head around, but once you
understand them, you’ll find them extremely useful. | |
R_base_tools/R_base_all_241_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)
# diag: Matrix Diagonals
## Description
Extract or replace the diagonal of a matrix, or cons... | |
R_base_tools/stringr.html4_51_0.txt |
s <- c("h^t", "hat", "hut", "hit")
str_subset(s, "\\^")
## [1] "h^t"
Question 3 Use ` str_extract ` to extract the first letter of each string in
this vector. Then combine those letters with ` str_c ` to create a single
character string |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.