Learn R Programming

filesstrings

This started out as a package for file and string manipulation. Since then, the fs file manipulation package and the `strex string manipulation package emerged, offering functionality previously given by this package (but slightly better). Those packages have hence almost pushed ‘filesstrings’ into extinction. However, it still has a small number of unique, handy file manipulation functions which can be seen in the vignette. One example is a function to remove spaces from all file names in a directory.

Installation

To install the release version of filesstrings from CRAN, in R, enter

install.packages("filesstrings")

Copy Link

Version

Install

install.packages('filesstrings')

Monthly Downloads

1,499

Version

3.4.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Rory Nolan

Last Published

February 11th, 2024

Functions in filesstrings (3.4.0)

str_split_by_nums

Split a string by its numeric characters.
locate_braces

Locate the braces in a string.
str_elem

Extract a single character from a string, using its index.
match_arg

Argument Matching
str_elems

Extract several single elements from a string.
nice_file_nums

Make file numbers comply with alphabetical order
str_before_nth

Text before the nth occurrence of pattern.
str_after_nth

Text after the nth occurrence of pattern.
move_files

Move files around.
str_to_vec

Convert a string to a vector of characters
str_remove_quoted

Remove the quoted parts of a string.
str_paste_elems

Extract bits of a string and paste them together.
str_nice_nums

Make string numbers comply with alphabetical order.
str_trim_anything

Trim something other than whitespace.
str_split_camel_case

Split a string based on CamelCase
str_singleize

Remove back-to-back duplicates of a pattern in a string.
unitize_dirs

Put files with the same unit measurements into directories
create_dir

Create directories if they don't already exist
currency

Get the currencies of numbers within a string.
before_last_dot

Get the part of a string before the last period.
extend_char_vec

Pad a character vector with empty strings.
group_close

Group together close adjacent elements of a vector.
nth_number_after_mth

Find the nth number after the mth occurrence of a pattern.
remove_dir

Remove directories
put_in_pos

Put specified strings in specified positions in an otherwise empty character vector.
extract_numbers

Extract numbers from a string.
extract_non_numerics

Extract non-numbers from a string.
can_be_numeric

Check if a string could be considered as numeric.
filesstrings

filesstrings: handy file and string manipulation
all_equal

nth_number_before_mth

Find the nth number before the mth occurrence of a pattern.
rename_with_nums

Replace file names with numbers
remove_filename_spaces

Remove spaces in file names
str_locate_nth

Get the indices of the \(n\)th instance of a pattern.
str_give_ext

Ensure a file name has the intended extension.