Skip to content

Instantly share code, notes, and snippets.

@bbest
Created October 25, 2014 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbest/6fb2b13f229e4782eb94 to your computer and use it in GitHub Desktop.
Save bbest/6fb2b13f229e4782eb94 to your computer and use it in GitHub Desktop.
Here's a quick way to loop through running a bunch of species and generating a document by running Knit HTML in RStudio.
---
title: "Maxent Species Report"
output: html_document
---
Here's a quick way to loop through running a bunch of species and generating a document by running Knit HTML in RStudio.
```{r, results='asis'}
spp = c('a','b','c')
for (sp in spp){
cmd = sprintf('maxent.exe -input %s_in.shp -output %s_out.shp', sp, sp)
#system(cmd) # uncomment this to run it
cat(sprintf('## %s\n\ncommand: `%s`\n\n', sp, cmd))
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment