Learn R Programming

wikiTools (version 1.2.14)

filext: Extract the extension of a file

Description

Extract the extension of a file

Usage

filext(fn)

Value

A character vector of extension names.

Arguments

fn

Character vector with the files whose extensions are to be extracted.

Author

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Details

This function extracts the extension of a vector of file names.

Examples

Run this code
## For a single item:
filext("Albert Einstein.jpg")
## You can do the same for a vector:
filext(c("Hillary Duff.png", "Britney Spears.jpg", "Avril Lavigne.tiff"))

Run the code above in your browser using DataLab