description-functions: Description functions

description-functionsR Documentation

Description functions

Description

Read, write and update the DESCRIPTION file. read.description reads the DESCRIPTION file in the current project directory and returns a named list. write.description writes the named list back to disk, overwriting the current DESCRIPTION file. Finally, update_description combines both functions by reading the DESCRIPTION file, updating or creating a field and writing the result back to disk.

Usage

read.description()

write.description(description)

update_description(fieldname, value, after = NULL)

Arguments

description

the DESCRIPTION file.

fieldname

the name of the field.

value

the new value.

after

if the field name is new, the name of the field after which the element is placed.

Details

The 'Depends', 'Imports' and 'Suggests' fields are sorted before writing the DESCRIPTION file.

Examples

## Not run: 
description = read.description()
write.description(read.description())

#update date in description file
update_description("Date", format(Sys.Date(), "%Y%-%m-%d"))

## End(Not run)


hgutils documentation built on March 31, 2022, 5:06 p.m.