Conversation
…and some of their information #182
| #get outpath name from metapid | ||
| systema <- getSystemMetadata(mn, metapid) | ||
| systema_name <- systema@fileName | ||
| outpath <- paste("/home/mnguyen/", systema_name, sep = "") |
There was a problem hiding this comment.
this is a path to my user... not sure how else to create an outpath that could apply to any user
dmullen17
left a comment
There was a problem hiding this comment.
This is a good start. See if you can make some of the changes and then we can move forward from there
| outpath <- paste("/home/mnguyen/", systema_name, sep = "") | ||
|
|
||
| #download data from metapid | ||
| download_data_objects(mn, c(metapid), c(outpath)) |
There was a problem hiding this comment.
This is pretty useful: You can download dataone objects directly like this eml <- read_eml(rawToChar(dataone::getObject(mn, metapid)))
So you won't need to use download_data_objects
| #the raw award string numbers | ||
| raw_award_string <- c() | ||
| funding <- eml@dataset@project@funding@para | ||
| for(i in 1:length(funding)){ |
There was a problem hiding this comment.
if you change this to seq_along(funding) then it handles the case where length = 0. Rather than the case of for in 1:0 which gives you an error
| raw_award_string <- c() | ||
| funding <- eml@dataset@project@funding@para | ||
| for(i in 1:length(funding)){ | ||
| award <- funding@.Data[[i]]@.Data[[1]] |
There was a problem hiding this comment.
You might be able to replace some of these with eml_get function. Look up the documentation with ?eml_get and see if you can use it to simplify some of the code
|
|
||
| #get xml from metapid | ||
| eml <- read_eml(eml_file) #read in eml_file | ||
| list <- list() #will be output list |
There was a problem hiding this comment.
You generally don't want to name your objects using already existing names. Since list is already the name of a function you want to rename your list to something like "output"
No description provided.