This file contains hidden or 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
| library(EML) | |
| library(dataone) | |
| library(arcticdatautils); | |
| mpath <- '/home/sjclark/ASL/forKNB/asl_yuk_kusk_metadata.xml' | |
| eml <- read_eml(mpath) | |
| cn <- CNode('PROD') | |
| mn <- getMNode(cn,'urn:node:KNB') | |
| csvpid <- 'urn:uuid:6b37b187-f6a4-4fa1-a1d9-330bf71754ab' |
This file contains hidden or 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
| cgries.16.1 | |
| http://purl.dataone.org/odo/ECSO_00002917 | |
| Chenlung.18.7 | |
| http://purl.dataone.org/odo/ECSO_00002454 | |
| http://purl.dataone.org/odo/ECSO_00002458 |
This file contains hidden or 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
| ark:/90135/q13j39xf/6/mrt-eml.xml |
This file contains hidden or 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
| > mydf <- data.frame(x = c("A", "B", NA), y = c(NA, "B", "C")) | |
| > mydf | |
| x y | |
| 1 A <NA> | |
| 2 B B | |
| 3 <NA> C | |
| > ifelse(is.na(mydf[1,"x"]), as.character(mydf[1,"y"]), as.character(mydf[1,"x"])) | |
| [1] "A" |
This file contains hidden or 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
| path <- "plots" | |
| dir.create(path) | |
| # Make and save a plot for each Region and Location combination | |
| regions <- na.omit(unique(df$SASAP.Region)) | |
| for (region in regions) { | |
| locations <- na.omit(unique(subset(df, SASAP.Region == region)$SASAP.Location)) | |
| for (location in locations) { |
This file contains hidden or 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
| proportion_of_reach_traveled <- function(reach, | |
| days_in_river, | |
| reach_travel_time, | |
| days_to_get_to) { | |
| if (days_in_river < days_to_get_to[reach]) { | |
| return(0) | |
| } else if (days_in_river > days_to_get_to[reach+1]) { | |
| return(1) | |
| } else { |
This file contains hidden or 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
| library(dataone) | |
| cn <- CNode("PROD") | |
| mn <- getMNode(cn, "urn:node:ARCTIC") | |
| qr <- query(mn, 'q=formatType:METADATA+-obsoletedBy:*+"carbon flux"&fl=identifier,title,origin') | |
| qr_enhanced <- lapply(qr, function(r) { | |
| # Collapse multi-valued origin into comma-separated char vector | |
| r$origin <- paste0(unlist(r$origin), collapse = ", ") |
This file contains hidden or 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
| > taxon_coverage <- set_taxonomicCoverage( | |
| + c("Macrocystis pyrifera", "Homo sapiens"), | |
| + expand = TRUE) | |
| Retrieving data for taxon 'Macrocystis pyrifera' | |
| Retrieving data for taxon 'Homo sapiens' | |
| > taxon_coverage |
This file contains hidden or 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
| library(EML) | |
| library(taxize) | |
| specieslist <- c("Melanitta perspicillata","Oncorhynchus nerka") | |
| cls <- classification(specieslist, db = 'itis') | |
| tc <- new("taxonomicClassification") | |
| tc <- c(new("taxonomicClassification", taxonRankName = new("taxonRankName", .Data = cls[nrow(cls), "rank"]), taxonRankValue = new("taxonRankValue", .Data = cls[nrow(cls), "name"]))) | |
| while (i > 0) { |
This file contains hidden or 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
| for(i in 1 : length(image_pids)){ | |
| publish_object(mn, | |
| image_paths[i], | |
| # format_id = "image/jpeg", | |
| public = F, | |
| pid = image_pids[i]) | |
| print(c("image", i, "uploaded")) | |
| } | |
| # set rights |