Sharing R scripts

174 views
Skip to first unread message

Caren Dymond

unread,
Jul 20, 2016, 6:14:39 PM7/20/16
to LANDIS-II Users
It seems silly to me for different people in this community to make their own R scripts when we could share.

What do you think? Would you be willing to share them here or on a Github or other platform?

Thanks

Robert Scheller

unread,
Jul 21, 2016, 12:45:20 PM7/21/16
to LANDIS-II Users
Caren,

I completely agree.  We should be sharing R scripts.  I think we should use this group to do so for a couple reasons:  
1.  Easy to upload, easy to search
2.  GitHub requires quite a bit of permissions management for write access.

Cheers,

R

Caren Dymond

unread,
Aug 27, 2016, 8:18:25 PM8/27/16
to LANDIS-II Users
Here is a basic data handling and graphing script for dealing with Log_Summary output from ForCS.
ForCS Basic log_Summary data handling and graphs Aug 15 2016.txt

Caren Dymond

unread,
Oct 7, 2016, 2:50:39 PM10/7/16
to LANDIS-II Users
Here is my code for assigning many fires seasons of daily FWI values into FWI Bins for the Dynamic Fire extension.

This might be trivial to most people, but it took me all morning to figure out so I might as well share!

## User must set working directory

## read in file with daily FWI values over many fires seasons, r.g. output from CFFDRS package
firewx <- read.csv("eco1fwi_withFSwDC.csv", header=TRUE)
FWI = firewx$FWI

## calculate bin lower/left values based on percentile values from Table 1 in the Dynamic Fire System v2.0.3 User Guide
bins <- quantile(FWI, c(0,.465,.765,.9,.975), names = F)

## assign all FWI values to bins
firewx$FWIBin <- findInterval(FWI, bins, rightmost.closed = FALSE, all.inside = FALSE)

## overwrite input file with dataframe that now has FWI Bins
write.table(firewx, file="eco1fwi_withFSwDC.csv", sep = ",", eol = "\r", row.names = FALSE, col.names = TRUE)

Reply all
Reply to author
Forward
0 new messages