description-functions: Description functions

Description Usage Arguments Details Examples

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

1
2
3
4
5
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

1
2
3
4
5
6
7
8
## 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)

hgvandenboorn/hgutils documentation built on Sept. 9, 2019, 2:50 a.m.