Learn R Programming

RepoGenerator (version 0.0.1)

createDownloadText: createDownloadText

Description

Builds text for file that downloads data

Usage

createDownloadText(info)

Arguments

info

data.frame listing data sources. Must have at least the following columns: Local (the name the file should be on disk after downloaded), Remote (the URL of the file), Mode (the way to write to disk, either 'w' or 'wb').

Value

Returns the block of text

Details

Creates a block of code. The first line is a comment of the file name, then is uses download.file() using the remote URL and the local filename.

Examples

Run this code
# NOT RUN {
dataList <- read.csv(system.file('metadata/DataList.csv', package='RepoGenerator'), 
    stringsAsFactors=FALSE, header=TRUE)
cat(RepoGenerator:::createDownloadText(dataList))

# }

Run the code above in your browser using DataLab