View source: R/brapi_put_studies_studyDbId_observationunits.R
brapi_put_studies_studyDbId_observationunits | R Documentation |
Update the Observation Units or upload new Observation Units for a specific Study
brapi_put_studies_studyDbId_observationunits( con = NULL, studyDbId = "", observationUnits = "", observationUnitXrefList = list(), treatmentList = list(), observationsList = list(), seasonList = list() )
con |
list; required: TRUE; BrAPI connection object |
studyDbId |
character; required: TRUE; The internal study database identifier of which these observation units are updated or addded. |
observationUnits |
data.frame; required: TRUE; Data.frame of observation units. Each row in the
The Examples Section shows an example of how to construct the |
observationUnitXrefList |
list; required: FALSE; List of data frames, where each element of the list contains the cross references (as a data.frame) to a single observation unit, i.e. a single row in the
The Examples Section shows an example of how to construct the |
treatmentList |
list; required: FALSE; List of data frames, where each element of the list contains the treatments (as a data.frame) applied to a single observation unit, i.e. a single row in the
The Examples Section shows an example of how to construct the |
observationsList |
list; required: FALSE; List of data frames, where each element of the list contains the observations (as a data.frame) of a single observation unit, i.e. a single row in the
The Examples Section shows an example of how to construct the |
seasonList |
list; required: FALSE; List of data frames, where each element of the list specifies seasonal information in which observations have been made. Therefore, the number of rows in an element of the list must match the number of rows in the linked element of the
The Examples Section shows an example of how to construct the |
Use this call for updating the Observation Units or uploading new Observation Units for a specific Study. The following rules are used:
If observationUnitDbId
or observationDbId
is populated, they should be considered updates to existing records.
If an existing record of a observationUnitDbId
or observationDbId
is not found, the entered data should be treated as new records and assign new internal database identifiers.
If observationUnitDbId
or observationDbId
is un-populated (empty string or null) the entered data should be treated as new records and assign new internal database identifiers.
data.frame
brapir generator package
Other brapi_1.3:
brapi_get_allelematrices_search()
,
brapi_get_allelematrices()
,
brapi_get_attributes_categories()
,
brapi_get_attributes()
,
brapi_get_breedingmethods_breedingMethodDbId()
,
brapi_get_breedingmethods()
,
brapi_get_calls()
,
brapi_get_commoncropnames()
,
brapi_get_germplasm_germplasmDbId_attributes()
,
brapi_get_germplasm_germplasmDbId_markerprofiles()
,
brapi_get_germplasm_germplasmDbId_mcpd()
,
brapi_get_germplasm_germplasmDbId_pedigree()
,
brapi_get_germplasm_germplasmDbId_progeny()
,
brapi_get_germplasm_germplasmDbId()
,
brapi_get_germplasm()
,
brapi_get_images_imageDbId()
,
brapi_get_images()
,
brapi_get_lists_listDbId()
,
brapi_get_lists()
,
brapi_get_locations_locationDbId()
,
brapi_get_locations()
,
brapi_get_maps_mapDbId_positions_linkageGroupName()
,
brapi_get_maps_mapDbId_positions()
,
brapi_get_maps_mapDbId()
,
brapi_get_maps()
,
brapi_get_markerprofiles_markerProfileDbId()
,
brapi_get_markerprofiles()
,
brapi_get_markers_markerDbId()
,
brapi_get_markers()
,
brapi_get_methods_methodDbId()
,
brapi_get_methods()
,
brapi_get_observationlevels()
,
brapi_get_observationunits()
,
brapi_get_ontologies()
,
brapi_get_people_personDbId()
,
brapi_get_people()
,
brapi_get_programs()
,
brapi_get_samples_sampleDbId()
,
brapi_get_samples()
,
brapi_get_scales_scaleDbId()
,
brapi_get_scales()
,
brapi_get_search_germplasm_searchResultsDbId()
,
brapi_get_search_images_searchResultsDbId()
,
brapi_get_search_markers_searchResultsDbId()
,
brapi_get_search_observationtables_searchResultsDbId()
,
brapi_get_search_observationunits_searchResultsDbId()
,
brapi_get_search_programs_searchResultsDbId()
,
brapi_get_search_samples_searchResultsDbId()
,
brapi_get_search_studies_searchResultsDbId()
,
brapi_get_search_variables_searchResultsDbId()
,
brapi_get_seasons()
,
brapi_get_studies_studyDbId_germplasm()
,
brapi_get_studies_studyDbId_layouts()
,
brapi_get_studies_studyDbId_observations()
,
brapi_get_studies_studyDbId_observationunits()
,
brapi_get_studies_studyDbId_observationvariables()
,
brapi_get_studies_studyDbId_table()
,
brapi_get_studies_studyDbId()
,
brapi_get_studies()
,
brapi_get_studytypes()
,
brapi_get_traits_traitDbId()
,
brapi_get_traits()
,
brapi_get_trials_trialDbId()
,
brapi_get_trials()
,
brapi_get_variables_observationVariableDbId()
,
brapi_get_variables()
,
brapi_get_vendor_orders_orderId_plates()
,
brapi_get_vendor_orders_orderId_results()
,
brapi_get_vendor_orders_orderId_status()
,
brapi_get_vendor_orders()
,
brapi_get_vendor_plates_submissionId()
,
brapi_get_vendor_specifications()
,
brapi_post_allelematrices_search()
,
brapi_post_images()
,
brapi_post_lists_listDbId_items()
,
brapi_post_lists()
,
brapi_post_methods()
,
brapi_post_people()
,
brapi_post_phenotypes()
,
brapi_post_scales()
,
brapi_post_search_germplasm()
,
brapi_post_search_images()
,
brapi_post_search_markers()
,
brapi_post_search_observationtables()
,
brapi_post_search_observationunits()
,
brapi_post_search_programs()
,
brapi_post_search_samples()
,
brapi_post_search_studies()
,
brapi_post_search_variables()
,
brapi_post_studies_studyDbId_table()
,
brapi_post_traits()
,
brapi_post_vendor_orders()
,
brapi_post_vendor_plates()
,
brapi_put_images_imageDbId_imagecontent()
,
brapi_put_images_imageDbId()
,
brapi_put_lists_listDbId()
,
brapi_put_methods_methodDbId()
,
brapi_put_people_personDbId()
,
brapi_put_samples()
,
brapi_put_scales_scaleDbId()
,
brapi_put_studies_studyDbId_layouts()
,
brapi_put_studies_studyDbId_observations()
,
brapi_put_traits_traitDbId()
Other Studies:
brapi_get_search_studies_searchResultsDbId()
,
brapi_get_seasons()
,
brapi_get_studies_studyDbId_germplasm()
,
brapi_get_studies_studyDbId_layouts()
,
brapi_get_studies_studyDbId_observations()
,
brapi_get_studies_studyDbId_observationunits()
,
brapi_get_studies_studyDbId_observationvariables()
,
brapi_get_studies_studyDbId_table()
,
brapi_get_studies_studyDbId()
,
brapi_get_studies()
,
brapi_get_studytypes()
,
brapi_post_search_studies()
,
brapi_post_studies_studyDbId_table()
,
brapi_put_studies_studyDbId_layouts()
,
brapi_put_studies_studyDbId_observations()
Other Observations:
brapi_get_observationlevels()
,
brapi_get_observationunits()
,
brapi_get_search_observationtables_searchResultsDbId()
,
brapi_get_search_observationunits_searchResultsDbId()
,
brapi_get_studies_studyDbId_observations()
,
brapi_get_studies_studyDbId_observationunits()
,
brapi_get_studies_studyDbId_table()
,
brapi_post_phenotypes()
,
brapi_post_search_observationtables()
,
brapi_post_search_observationunits()
,
brapi_post_studies_studyDbId_table()
,
brapi_put_studies_studyDbId_observations()
## Not run: # Create a connection object con <- brapi_db()$testserver # Create an observationUnits data.frame object # with 4 observation units observationUnits <- data.frame( blockNumber = c("1", "1", "1", "1"), entryNumber = c("5", "6", "7", "8"), entryType = c("TEST", "TEST", "TEST", "CHECK"), germplasmDbId = c("1", "1", "3", "3"), observationLevel = c("plot", "plant", "plot", "plant"), observationUnitDbId = c("5", "6", "7", "8"), observationUnitName = c("Plot 3", "Plant 3", "Plot 4", "Plant 4"), plantNumber = c("0", "3", "0", "4"), plotNumber = c("3", "3", "4", "4"), positionCoordinateX = c("1", "1", "1", "1"), positionCoordinateXType = c("GRID_COL", "GRID_COL", "GRID_COL", "GRID_COL"), positionCoordinateY = c("1", "1", "2", "2"), positionCoordinateYType = c("GRID_ROW", "GRID_ROW", "GRID_ROW", "GRID_ROW"), replicate = c("0", "0", "0", "0"), studyDbId = c("1002", "1002", "1002", "1002") ) # Create an observationUnitXref list # with 4 element, because of 4 observation units observationUnitXref1 <- data.frame( id = c(), source = c() ) observationUnitXref2 <- data.frame( id = c("unit6id1", "unit6id2"), source = c("unit6src1", "unit6src2") ) observationUnitXref3 <- data.frame( id = c(), source = c() ) observationUnitXref4 <- data.frame( id = c("unit8id1"), source = c("unit8src1") ) observationUnitXrefList <- list( observationUnitXref1, observationUnitXref2, observationUnitXref3, observationUnitXref4) rm(observationUnitXref1, observationUnitXref2, observationUnitXref3, observationUnitXref4) # Create a treatment list # with 4 element, because of 4 observation units treatment1 <- data.frame( factor = c("water regimen"), modality = c("deficit")) treatment2 <- data.frame( factor = c("water regimen"), modality = c("deficit")) treatment3 <- data.frame( factor = c("water regimen", "Phosphate level"), modality = c("deficit", "high")) treatment4 <- data.frame( factor = c("water regimen", "Phosphate level"), modality = c("deficit", "high")) treatmentList <- list( treatment1, treatment2, treatment3, treatment4) rm(treatment1, treatment2, treatment3, treatment4) # Create an observations list # with 4 element, because of 4 observation units observations1 <- data.frame( # two observation on the first observation unit! germplasmDbId = c("1", "1"), germplasmName = c("Name001", "Name001"), # one existing observation with specified DbId # one new observation, where a new DbId will be assigned observationDbId = c("9", ""), observationLevel = c("plot", "plot"), observationTimeStamp = c("2013-06-14T22:11:51Z", "2020-06-18T15:22:15Z"), observationUnitDbId = c("5", "5"), observationUnitName = c("Plot 3", "Plot 3"), observationVariableDbId = c("MO_123:100002", "MO_123:100003"), observationVariableName = c("Plant height", "Carotenoid"), operator = c("Bob", "Bob"), studyDbId = c("1002", "1002"), uploadedBy = c("Bob", "Bob"), value = c("2.1", "1.86")) observations2 <- data.frame( germplasmDbId = c("1"), germplasmName = c("Name001"), observationDbId = c("10"), observationLevel = c("plant"), observationTimeStamp = c("2013-06-14T22:12:51Z"), observationUnitDbId = c("6"), observationUnitName = c("Plant 3"), observationVariableDbId = c("MO_123:100006"), observationVariableName = c("Virus severity"), operator = c("Bob"), studyDbId = c("1002"), uploadedBy = c("Bob"), value = c("4.5")) observations3 <- data.frame( germplasmDbId = c("3"), germplasmName = c("Name003"), observationDbId = c("11"), observationLevel = c("plot"), observationTimeStamp = c("2013-06-14T22:13:51Z"), observationUnitDbId = c("7"), observationUnitName = c("Plot 4"), observationVariableDbId = c("MO_123:100003"), observationVariableName = c("Carotenoid"), operator = c("Bob"), studyDbId = c("1002"), uploadedBy = c("Bob"), value = c("1.4")) observations4 <- data.frame( germplasmDbId = c("3"), germplasmName = c("Name003"), observationDbId = c("12"), observationLevel = c("plant"), observationTimeStamp = c("2013-06-14T22:14:51Z"), observationUnitDbId = c("8"), observationUnitName = c("Plant 4"), observationVariableDbId = c("MO_123:100005"), observationVariableName = c("Root color"), operator = c("Bob"), studyDbId = c("1002"), uploadedBy = c("Bob"), value = c("red")) observationsList <- list( observations1, observations2, observations3, observations4) rm(observations1, observations2, observations3, observations4) # Create a season list # with 4 element, because of 4 observation units season1 <- data.frame( # two rows because observations1 has two observations! season = c("spring", "summer"), seasonDbId = c("3", "4"), year = c("2012", "2012")) season2 <- data.frame( season = c("spring"), seasonDbId = c("3"), year = c("2012")) season3 <- data.frame( season = c("spring"), seasonDbId = c("3"), year = c("2012")) season4 <- data.frame( season = c("spring"), seasonDbId = c("3"), year = c("2012")) seasonList <- list( season1, season2, season3, season4) rm(season1, season2, season3, season4) # Make put /studies/{studyDbId}/observationunits call brapi_put_studies_studyDbId_observationunits( con = con, studyDbId = "1002", observationUnits = observationUnits, observationUnitXrefList = observationUnitXrefList, treatmentList = treatmentList, observationsList = observationsList, seasonList = seasonList) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.