Skip to content

Instantly share code, notes, and snippets.

@snowch
Last active July 17, 2016 15:50
Show Gist options
  • Select an option

  • Save snowch/dfdf08be0afcb18dd9635107435183d6 to your computer and use it in GitHub Desktop.

Select an option

Save snowch/dfdf08be0afcb18dd9635107435183d6 to your computer and use it in GitHub Desktop.
DSUR scripts
dir.create('./DSUR/')
download.file('https://studysites.uk.sagepub.com/dsur/study/DSUR%20Data%20Files/Data%20files.zip', dest='DataFiles.zip')
unzip('DataFiles.zip', exdir='./DSUR/')
baseurl = 'https://studysites.uk.sagepub.com/dsur/study/DSUR%20R%20Script%20Files/'
scripts <- c(
'Chapter%203%20The%20R%20Environment.R',
'Chapter%204%20DSUR%20Graphs.R',
'Chapter%205%20DSUS%20Exploring%20Data.R',
'Chapter%206%20DSUR%20Correlations.R'
)
dir.create('./DSUR/Scripts/')
for (f in scripts) {
dest = gsub("/", "_", f)
dest = gsub("%20", " ", dest)
download.file(paste(baseurl, f, sep=''), dest=paste('./DSUR/Scripts/', dest, sep=''))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment