id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
R_base_tools/strings.html6_8_0.txt | * ` str_which(string, pattern, negate = FALSE) ` : Find the indexes of strings that contain a pattern match.
str_which(fruit, "a")
* ` str_locate(string, pattern) ` : Locate the positions of pattern matches in a string. Also ` str_locate_all() ` .
str_locate(fruit, "a") | |
R_base_tools/strings.html7_128_0.txt | ## 14.7 stringi
stringr is built on top of the stringi package. stringr is useful when
you’re learning because it exposes a minimal set of functions, which have been
carefully picked to handle the most common string manipulation functions.
stringi, on the other hand, is designed to be comprehensive. It contains
al... | |
R_base_tools/R_base_all_70_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)
# Constants: Built-in Constants
## Description
Constants built into R .
## Usage
... | |
R_base_tools/R_base_all_281_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)
# slice.index: Slice Indexes in an Array
## Description
Returns a matrix of integers indicat... | |
R_base_tools/R_base_all_43_3.txt | # an hour ago
as.POSIXlt(Sys.time(), "GMT") # the current time in GMT
format(.leap.seconds) # the leap seconds in your time zone
print(.leap.seconds, tz = "PST8PDT") # and in Seattle's
# }
# NOT RUN {
<!-- % ..test should be diffable from here on: -->
# }
# NOT RUN... | |
R_base_tools/R_base_all_289_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)
# memlimits: Query and Set Heap Size Limits
## Description
Query and set the maximal size of... | |
R_base_tools/R_base_all_13_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)
# startsWith: Does String Start or End With Another String?
## Description
Determines if ent... | |
R_base_tools/R_base_all_99_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)
# sign: Sign Function
## Description
` sign ` returns a vector with the signs of the corresp... | |
R_base_tools/strings.html7_73_0.txt | ### 14.4.1 Detect matches
To determine if a character vector matches a pattern, use ` str_detect() ` .
It returns a logical vector the same length as the input: | |
R_base_tools/strings.html6_30_0.txt | Use ` writeLines() ` to see how R views your string after all special
characters have been parsed.
For example, ` writeLines("\\.") ` will be parsed as ` \. ` | |
R_base_tools/R_base_all_339_1.txt | eview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2F.Platform&utm_source=r-docs&utm_medium=docs&utm_term=.Platform&utm_content=run_example_in_workspace)
# NOT RUN {
## Note: this can be done in a system-independent way by dir.exists()
if(.Platform$OS.type == "unix") {
... | |
R_base_tools/R_base_all_265_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.sleep: Suspend Execution for a Time Interval
## Description
Suspend execution of R e... | |
R_base_tools/R_base_all_264_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)
# formatC: Formatting Using C-style Formats
## Description
` formatC() ` formats numbers ind... | |
R_base_tools/strings.html6_28_0.txt | Pattern arguments in stringr are interpreted as regular expressions after any
special characters have been parsed .
In R, you write regular expressions as strings , sequences of characters
surrounded by quotes( ` "" ` ) or single quotes ( ` '' ` ). | |
R_base_tools/R_base_all_63_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)
# print.data.frame: Printing Data Frames
## Description
Print a data frame.
## Usage
... | |
R_base_tools/stringr.html3_3_0.txt | ## Getting and setting individual characters
You can get the length of the string with ` str_length() ` : | |
R_base_tools/R_base_all_285_1.txt | ))
close(con)
unique(Encoding(A)) # will most likely be UTF-8
# }
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%2FreadLines&utm_source=r-docs&utm_medium=docs&utm_term=readLine... | |
R_base_tools/R_base_all_64_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)
# getwd: Get or Set Working Directory
## Description
` getwd ` returns an absolute filepath ... | |
R_base_tools/R_base_all_245_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)
# environment: Environment Access
## Description
Get, set, test for and create environments.... | |
R_base_tools/strings.html7_43_0.txt | To force a regular expression to only match a complete string, anchor it with
both ` ^ ` and ` $ ` :
x <- c("apple pie", "apple", "apple cake")
str_view(x, "apple")
#> [1] │ <apple> pie
#> [2] │ <apple>
#> [3] │ <apple> cake
str_view(x, "^apple$")
#> [2] │ <apple> | |
R_base_tools/R_micropan_33_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)
# blastAllAll: Making BLAST search all against all genomes
## Description
Runs a recipro... | |
R_base_tools/stringr.html4_1_0.txt | The focus of this lab is going to be on strings and string manipulation. We
will be fascilitating this with the ` stringr ` package
# install.packages("stringr")
library(stringr)
library(dplyr) | |
R_base_tools/R_base_all_112_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)
# ISOdatetime: Date-time Conversion Functions from Numeric Representations
## Description
Co... | |
R_base_tools/strings.html7_71_0.txt | As a cautionary tale, check out this regular expression that checks if a email
address is valid:
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[... | |
R_base_tools/R_base_all_207_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)
# mean: Arithmetic Mean
## Description
Generic function for the (trimmed) arithmetic mean.
... | |
R_base_tools/strings.html6_7_0.txt | * ` str_detect(string, pattern, negate = FALSE) ` : Detect the presence of a pattern match in a string. Also ` str_like() ` .
str(fruit, "a")
* ` str_starts(string, pattern, negate = FALSE) ` : Detect the presence of a pattern match at the beginning of a string. Also ` str_ends() ` .
st... | |
R_base_tools/R_base_all_400_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)
# strwrap: Wrap Character Strings to Format Paragraphs
## Description
Each character string ... | |
R_base_tools/R_base_all_217_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)
# order: Ordering Permutation
## Description
` order ` returns a permutation which rearrange... | |
R_base_tools/R_base_all_198_5.txt | empty value of argument ` open ` .
For ` file ` the description is a path to the file to be opened or a complete
URL (when it is the same as calling ` url ` ), or ` "" ` (the default) or `
"clipboard" ` (see the ‘Clipboard’ section). Use ` "stdin" ` to refer to the
C-level ‘standard input’ of the process (which need n... | |
R_base_tools/R_base_all_410_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)
# cut: Convert Numeric to Factor
## Description
` cut ` divides the range of ` x ` into inte... | |
R_base_tools/R_base_all_360_2.txt | %B `
Full month name in the current locale. (Also matches abbreviated name on
input.)
` %c `
Date and time. Locale-specific on output, ` "%a %b %e %H:%M:%S %Y" ` on input.
` %C `
Century (00--99): the integer part of the year divided by 100.
` %d `
Day of the month as decimal number (01--... | |
R_base_tools/R_base_all_380_2.txt | case ` scan ` returns a
list of vectors with the types given by the types of the elements in ` what `
. This provides a way of reading columnar data. If any of the types is ` NULL
` , the corresponding field is skipped (but a ` NULL ` component appears in
the result).
The type of ` what ` or its components can be one... | |
R_base_tools/R_base_all_200_2.txt | distributions (including the one from which that
quote was taken) or sysadmins have chosen to copy a time-zone file to `
localtime ` . For a non-symlink, the ultimate fallback is to compare that file
to all files in the time-zone database.
Some Linux platforms provide two other mechanisms which are tried in turn
befo... | |
R_base_tools/R_base_all_316_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)
# Control: Control Flow
## Description
These are the basic control-flow constructs of the R... | |
R_base_tools/strings.html7_94_0.txt | 1. The first word from each sentence.
2. All words ending in ` ing ` .
3. All plurals.
### 14.4.3 Grouped matches | |
R_base_tools/R_base_all_198_7.txt | le.
Tfile <- file()
cat("abc\ndef\n", file = Tfile)
readLines(Tfile)
close(Tfile)
# }
# NOT RUN {
## fifo example -- may hang even with OS support for fifos
if(capabilities("fifo")) {
zzfil <- tempfile(fileext="-fifo")
zz <- fifo(zzfil, "w+")
writeLines("abc", zz)
... | |
R_base_tools/R_base_all_172_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)
# args: Argument List of a Function
## Description
Displays the argument names and correspon... | |
R_base_tools/R_base_all_355_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)
# shQuote: Quote Strings for Use in OS Shells
## Description
Quote a string to be passed to ... | |
R_base_tools/R_base_all_68_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)
# prod: Product of Vector Elements
## Description
` prod ` returns the product of all the va... | |
R_base_tools/R_base_0_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/stringr.html4_49_0.txt |
s <- c("apple", "pineapple", "banana")
str_subset(s, "a")
## [1] "apple" "pineapple" "banana"
str_subset(s, "^a")
## [1] "apple"
Likewise, we use ` "$" ` to indicate the end of a string | |
R_base_tools/R_base_all_3_1.txt | ounding:
# chol() unlike qr() does not use a tolerance.
try(chol(m))
(Q <- chol(m, pivot = TRUE))
## we can use this by
pivot <- attr(Q, "pivot")
crossprod(Q[, order(pivot)]) # recover m
## now for a non-positive-definite matrix
( m <- matrix(c(5,-5,-5,3), 2, 2) )
try(chol(... | |
R_base_tools/strings.html6_1_0.txt | ## On this page
* Detect Matches
* Mutate Strings
* Subset Strings
* Join and Split
* Manage Lengths
* Order Strings
* Helpers
* Regular Expressions
* Need to Know
* Interpretation
* Match Characters
* Alternates
* Anchors
* Look Arounds
* Quantifiers
* G... | |
R_base_tools/R_base_all_422_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)
# Cstack_info: Report Information on C Stack Size and Usage
## Description
Report informatio... | |
R_base_tools/R_base_all_301_1.txt | g/reports/tr10/) ) is likely to be increasingly
influential. Where available R by default makes use of ICU ( [
http://site.icu-project.org/ ](http://site.icu-project.org/) ) for collation
(except in a C locale).
## See Also
` [ factor ](/link/factor?package=base&version=3.6.2) ` for the behaviour with
factor argum... | |
R_base_tools/R_base_all_215_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)
# write: Write Data to a File
## Description
The data (usually a matrix) ` x ` are written t... | |
R_base_tools/R_base_all_65_2.txt | since deprecated wrappers for ` [ find.package
](/link/find.package?package=base&version=3.6.2) ` and ` [ path.package
](/link/path.package?package=base&version=3.6.2) ` .
## See Also
` [ Defunct ](/link/Defunct?package=base&version=3.6.2) ` , ` [ base-
deprecated ](/link/base-deprecated?package=base&version=3.6.2) ... | |
R_base_tools/R_base_all_85_1.txt | tion ](/link/connection?package=base&version=3.6.2) ` : re-encoded
connections have some special handling of BOMs). The rest of this section
applies when this has not been done so ` x ` starts with a BOM.
Implementations will generally interpret a BOM for ` from ` given as one of `
"UCS-2" ` , ` "UTF-16" ` and ` "UTF-... | |
R_base_tools/R_base_all_356_1.txt | e/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fdimnames&utm_source=r-docs&utm_medium=docs&utm_term=dimnames&utm_content=run_example_in_workspace)
# NOT RUN {
## simple versions of rownames and colnames
## could be defined as follows
rownames0 <- function(x) dimna... | |
R_base_tools/R_base_all_52_2.txt | . Calling this function
in other circumstances will give undefined results.
An intrinsic limitation in the ` exit ` argument is that it won't work if the
function itself uses ` on.exit ` with ` add= FALSE ` (the default), since the
existing calls will override the one supplied by ` trace ` .
Tracing does not nest. An... | |
R_base_tools/stringr.html4_34_0.txt |
s <- c("oneword", "two.words", "this.has.three")
str_split(s, "\\.")
## [[1]]
## [1] "oneword"
##
## [[2]]
## [1] "two" "words"
##
## [[3]]
## [1] "this" "has" "three"
### Subsetting and Extracting | |
R_base_tools/R_base_all_141_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)
# droplevels: Drop Unused Levels from Factors
## Description
The function ` droplevels ` is ... | |
R_base_tools/R_base_all_212_1.txt | ial issue is signed zeroes: on IEC 60559 platforms there are two
zeroes with internal representations differing by sign. Where possible R
treats them as the same, but for example direct output from C code often does
not do so and may output -0.0 (and on Windows whether it does so or not
depends on the version of Win... | |
R_base_tools/R_base_all_280_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)
# strtoi: Convert Strings to Integers
## Description
Convert strings to integers according t... | |
R_base_tools/R_base_all_315_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)
# replace: Replace Values in a Vector
## Description
` replace ` replaces the values in ` x ... | |
R_base_tools/R_base_all_297_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)
# rle: Run Length Encoding
## Description
Compute the lengths and values of runs of equal va... | |
R_base_tools/strings.html7_24_0.txt |
str_sub("a", 1, 5)
#> [1] "a"
You can also use the assignment form of ` str_sub() ` to modify strings: | |
R_base_tools/R_base_all_37_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)
# dataframeHelpers: Data Frame Auxiliary Functions
## Description
Internal auxiliary functio... | |
R_base_tools/R_base_all_92_1.txt | ic
](/link/is.numeric?package=base&version=3.6.2) (x) ` is true).
Complex values are sorted first by the real part, then the imaginary part.
The ` "auto" ` method selects ` "radix" ` for short (less than \\(2^{31}\\)
elements) numeric vectors, integer vectors, logical vectors and factors;
otherwise, ` "shell" ` .
Ex... | |
R_base_tools/R_base_all_198_6.txt | ces
Chambers, J. M. (1998) _Programming with Data. A Guide to the S Language._
Springer.
Ripley, B. D. (2001) Connections. _R News_ , **1/1** , 16--7. [
https://www.r-project.org/doc/Rnews/Rnews_2001-1.pdf
](https://www.r-project.org/doc/Rnews/Rnews_2001-1.pdf)
## See Also
` [ textConnection ](/link/textConnection... | |
R_base_tools/strings.html7_3_0.txt | You’re reading the first edition of R4DS; for the latest on this topic see the
Strings chapter in the second edition.
## 14.1 Introduction | |
R_base_tools/R_base_all_212_2.txt | ce=r-docs&utm_medium=docs&utm_term=Arithmetic&utm_content=run_example_in_workspace)
# NOT RUN {
x <- -1:12
x + 1
2 * x + 3
x %% 2 #-- is periodic
x %/% 5
x %% Inf # now is defined by limit (gave NaN in earlier versions of R)
# }
Run the code above in your browser using ... | |
R_base_tools/R_base_all_253_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)
# diff: Lagged Differences
## Description
Returns suitably lagged and iterated differences.
... | |
R_base_tools/strings.html7_1_0.txt | Show table of contents
## Table of contents | |
R_base_tools/R_base_all_178_1.txt | r using [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Frapply&utm_source=r-docs&utm_medium=docs&utm_term=rapply&utm_content=run_example_in_workspace)
Powered by [ DataCamp ](https://www.datacamp.com/)
| |
R_base_tools/strings.html6_6_0.txt |
library(stringr)
## Detect Matches | |
R_base_tools/R_micropan_19_1.txt | ing overlapping hits
hmmer.table <- rbind(hmmer.table,htab)
}
# ...and compressing them again...
pth <- lapply( file.path( extdata.path, filenames ), xzcompress )
# Finally, the clustering
clustering.domains <- dClust(hmmer.table)
Run the code above in your browser using [ Dat... | |
R_base_tools/R_base_all_79_1.txt | e passed in a call to this routine.
Additionally, the list will have an additional class, being CRoutine,
CallRoutine, FortranRoutine or ExternalRoutine corresponding to the R
interface by which it should be invoked.
If any of the symbols is not found, an error is raised.
If name contains only one symbol name and un... | |
R_base_tools/R_base_all_376_1.txt | not part of a
valid character it is printed in hex in the form \xab and this is repeated
until the start of a valid character. (This will rapidly recover from minor
errors in UTF-8.)
## Multi-byte locales
In all locales, the characters in the ASCII range ( 0x00 to 0x7f ) are
printed in the same way, as-is if ... | |
R_base_tools/R_base_all_17_1.txt | sion=3.6.2) ` is a valid logical object.
Where a component of ` x ` or ` y ` is ` NA ` , the result will be ` NA ` if
the outcome is ambiguous. In other words ` NA & TRUE ` evaluates to ` NA ` ,
but ` NA & FALSE ` evaluates to ` FALSE ` . See the examples below.
See [ Syntax ](/link/Syntax?package=base&version=3.6.2) ... | |
R_base_tools/R_base_0_1.txt | nu <- seq(-10, 9, length.out = 2001)
## --- I() --- --- --- ---
matplot(nu, t(outer(xx, nu, besselI)), type = "l", ylim = c(-50, 200),
main = expression(paste("Bessel ", I[nu](x), " for fixed ", x,
", as ", f(nu))),
xlab = expression(nu))
abline(v... | |
R_base_tools/R_base_all_406_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)
# try: Try an Expression Allowing Error Recovery
## Description
` try ` is a wrapper to run ... | |
R_base_tools/R_base_all_78_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)
# name: Names and Symbols
## Description
A ‘name’ (also known as a ‘symbol’) is a way to ref... | |
R_base_tools/R_base_all_340_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)
# sets: Set Operations
## Description
Performs **set** union, intersection, (asymmetric!) di... | |
R_base_tools/strings.html7_0_0.txt | Skip to main content
# R for Data Science | |
R_base_tools/R_base_all_204_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)
# normalizePath: Express File Paths in Canonical Form
## Description
Convert file paths to c... | |
R_base_tools/R_base_all_54_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)
# all.names: Find All Names in an Expression
## Description
Return a character vector contai... | |
R_base_tools/R_base_all_256_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)
# Recall: Recursive Calling
## Description
` Recall ` is used as a placeholder for the name ... | |
R_base_tools/R_base_all_343_1.txt | # columns are int b1 c1 c2 b2 c3
a$pivot
pivI <- sort.list(a$pivot) # the inverse permutation
all.equal (x, qr.Q(a) %*% qr.R(a)) # no, no
stopifnot(
all.equal(x[, a$pivot], qr.Q(a) %*% qr.R(a)), # TRUE
all.equal(x , qr.Q(a) %*% qr.R(a)[, pivI])) # TRUE too!
#... | |
R_base_tools/R_base_all_423_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)
# remove: Remove Objects from a Specified Environment
## Description
` remove ` and ` rm ` c... | |
R_base_tools/strings.html7_105_0.txt | 2. Implement a simple version of ` str_to_lower() ` using ` replace_all() ` .
3. Switch the first and last letters in ` words ` . Which of those strings are still words? | |
R_base_tools/strings.html7_62_0.txt | 2. Describe in words what these regular expressions match: (read carefully to see if I’m using a regular expression or a string that defines a regular expression.)
1. ` ^.*$ `
2. ` "\\{.+\\}" `
3. ` \d{4}-\d{2}-\d{2} `
4. ` "\\\\{4}" `
3. Create regular expressions to find all words that: | |
R_base_tools/R_base_all_259_1.txt | `
## Examples
[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Fsink&utm_source=r-docs&utm_medium=docs&utm_term=sink&utm_content=run_example_in_workspace)
# NOT RUN {
sink("sink-examp.txt")
i <- 1:10
outer(i, i, ... | |
R_base_tools/strings.html6_18_0.txt | * ` str_glue(..., .sep = "", .envir = parent.frame()) ` : Create a string from strings and {expressions} to evaluate.
str_glue("Pi is {pi}")
* ` str_glue_data(.x, ..., .sep = "", .envir = parent.frame(), .na = "NA") ` : Use a data frame, list, or environment to create a string from strings and {expre... | |
R_base_tools/stringr.html3_29_0.txt | The downside of ` coll() ` is speed. Because the rules for recognising which
characters are the same are complicated, ` coll() ` is relatively slow
compared to ` regex() ` and ` fixed() ` . Note that when both ` fixed() ` and
` regex() ` have ` ignore_case ` arguments, they perform a much simpler
comparison than ` coll... | |
R_base_tools/strings.html7_35_0.txt | The next step up in complexity is ` . ` , which matches any character (except
a newline):
str_view(x, ".a.")
#> [2] │ <ban>ana
#> [3] │ p<ear> | |
R_base_tools/R_base_all_339_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)
# .Platform: Platform Specific Variables
## Description
` .Platform ` is a list with some de... | |
R_base_tools/stringr.html4_66_0.txt |
s <- "iowa"
str_count(s, "[aeiou]")
## [1] 3
str_view(s, "[aeiou]")
## [1] │ <i><o>w<a>
However, we may be interested in knowing how many instances of subsequent
vowels there are. In this case, we have “io” and “a”. We can specify that the
pattern we are look... | |
R_base_tools/R_tools_0_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)
# parse_Rd: Parse an Rd File
## Description
This function reads an R documentation (Rd) fi... | |
R_base_tools/R_base_all_110_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)
# which.min: Where is the Min() or Max() or first TRUE or FALSE ?
## Description
Determines ... | |
R_base_tools/stringr.html4_65_0.txt |
s <- c("xz", "xyz", "xyyz", "xyyyz", "xyyyyz")
# We want everything that starts with "x", may or may not have "y", ends with "z"
str_detect(s, "xy*z")
## [1] TRUE TRUE TRUE TRUE TRUE
Quantifiers also allow us to further define patterns. For this next example,
we will use ` str_... | |
R_base_tools/R_base_all_96_1.txt | ta.frame ` are converted to factor
columns unless protected by ` [ I ](/link/I?package=base&version=3.6.2) ` or
argument ` stringsAsFactors ` is false. If a list or data frame or matrix is
passed to ` data.frame ` it is as if each component or column had been passed
as a separate argument (except for matrices protected... | |
R_base_tools/R_base_all_247_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)
# summary: Object Summaries
## Description
` summary ` is a generic function used to produce... | |
R_base_tools/R_base_all_336_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)
# traceback: Get and Print Call Stacks
## Description
By default ` traceback() ` prints the ... | |
R_base_tools/R_base_all_197_2.txt | y ` , ` ftp_proxy ` :
(and more). Optional. Settings for ` [ download.file
](/link/download.file?package=base&version=3.6.2) ` : see its help for further
details.
## See Also
` [ Sys.getenv ](/link/Sys.getenv?package=base&version=3.6.2) ` and ` [
Sys.setenv ](/link/Sys.setenv?package=base&version=3.6.2) ` to ... | |
R_base_tools/R_base_all_19_1.txt | t possible, an error is
thrown.
If a ` by.x ` column name matches one of ` y ` , and if ` no.dups ` is true
(as by default), the y version gets suffixed as well, avoiding duplicate
column names in the result.
The complexity of the algorithm used is proportional to the length of the
answer.
In SQL database terminolog... | |
R_base_tools/R_base_all_302_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)
# switch: Select One of a List of Alternatives
## Description
` switch ` evaluates ` EXPR ` ... | |
R_base_tools/R_base_all_143_1.txt | kage=base&version=3.6.2) ` for an
efficient way of both checking existence and getting an object.
` [ assign ](/link/assign?package=base&version=3.6.2) ` , the inverse of `
get() ` , see above.
Use ` [ getAnywhere ](/link/getAnywhere?package=base&version=3.6.2&to=utils) `
for searching for an object anywhere, includi... | |
R_base_tools/stringr.html4_18_0.txt | To that end, here are some of the more common functions we will be using,
though it is by no means comprehensive
Function | Description
---|---
` str_sub() ` | Extract substring from a given start to end position
` str_replace() ` | Replace the first instance of a substring with another
` str_replace_al... | |
R_base_tools/R_base_all_285_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)
# readLines: Read Text Lines from a Connection
## Description
Read some or all text lines fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.