Learn R Programming

dataesgobr (version 1.0.0)

get_name: Extract the name of the file in the URL

Description

Extract the name of the file in the URL

Usage

get_name(url, format)

Arguments

url

A string with URL and the name of the file

format

The data's format to check the extension

Value

A string with the file's name

Examples

Run this code
# NOT RUN {
library(dataesgobr)
name <- get_name("archivo-de-datos.csv&rnd=1234", "text/csv")
name <- get_name("https://datos.ayto-arganda.es/contratos.pdf", "application/pdf")
# }

Run the code above in your browser using DataLab