forked from BiologicalRecordsCentre/sparta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor test fix to plot_DetectionPhenology
- Loading branch information
1 parent
4c15cbd
commit e3bc003
Showing
3 changed files
with
68 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Create data | ||
n <- 15000 # size of dataset | ||
nyr <- 20 # number of years in data | ||
nSamples <- 100 # set number of dates | ||
nSites <- 50 # set number of sites | ||
set.seed(125) | ||
|
||
# Create somes dates | ||
first <- as.Date(strptime("2010/01/01", format = "%Y/%m/%d")) | ||
last <- as.Date(strptime(paste(2010 + (nyr - 1), "/12/31", sep = ""), | ||
format = "%Y/%m/%d" | ||
)) | ||
dt <- last - first | ||
rDates <- first + (runif(nSamples) * dt) | ||
|
||
# taxa are set as random letters | ||
taxa <- sample(letters, size = n, TRUE) | ||
|
||
# three sites are visited randomly | ||
site <- sample(paste("A", 1:nSites, sep = ""), size = n, TRUE) | ||
|
||
# the date of visit is selected at random from those created earlier | ||
survey <- sample(rDates, size = n, TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters