Learn R Programming

risk.assessr (version 3.0.1)

extract_version: Extract Package Version from File Path

Description

This function extracts the version number from a package source file name based on the package name and expected file pattern.

Usage

extract_version(path, package_name)

Value

A character string representing the extracted version number, or `NULL` if no match is found.

Arguments

path

A character string specifying the file path or URL.

package_name

A character string specifying the name of the package.

Examples

Run this code
if (FALSE) {
link <- "https://bioconductor.org/packages/3.14/bioc/src/contrib/GenomicRanges_1.42.0.tar.gz"
extract_version(link, "GenomicRanges")
}

Run the code above in your browser using DataLab