Title: | Quickly Retrieve Datasets from the 'Mindat' API |
---|---|
Description: | The goal of OpenMindat R package is to provide functions for users or machines to quickly and easily retrieve datasets from the mindat.org API (<https://api.mindat.org/schema/redoc/>). |
Authors: | Xiang Que [aut, cre] , Xiaogang Ma [aut] |
Maintainer: | Xiang Que <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-01-15 05:41:27 UTC |
Source: | https://github.com/quexiang/openmindat |
Convert the mindat R dataframe to JSON-LD string
ConvertDF2JsonLD(inputdata,template = NULL)
ConvertDF2JsonLD(inputdata,template = NULL)
inputdata |
R dataframe of retrieived data from Mindat database. |
template |
filepath to the template |
## Not run: df <-geomaterials_search_name("Quartz") df_out <-ConvertDF2JsonLD(df) ## End(Not run)
## Not run: df <-geomaterials_search_name("Quartz") df_out <-ConvertDF2JsonLD(df) ## End(Not run)
Convert the mindat R dataframe to TTL string
ConvertDF2TTL (inputdata,template = NULL)
ConvertDF2TTL (inputdata,template = NULL)
inputdata |
R dataframe of retrieived data from Mindat database. |
template |
filepath to the template |
## Not run: df <-geomaterials_search_name("Quartz") df_out <-ConvertDF2TTL(df) ## End(Not run)
## Not run: df <-geomaterials_search_name("Quartz") df_out <-ConvertDF2TTL(df) ## End(Not run)
: Queries the list of geomaterials that minmum value of the given birifrigence value.
geomaterials_bi_greater_than(gt, ...)
geomaterials_bi_greater_than(gt, ...)
gt |
float value.Birifrigence is calculated from refractive index as (rimax-rimin).Range: bi_min - bi_max. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "bi_min" of geomaterials. retrieve all the geomaterials that has higher birifrigence than the given value(gt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_bi_greater_than(0.2) ## End(Not run)
## Not run: df <-geomaterials_bi_greater_than(0.2) ## End(Not run)
: Queries the list of geomaterials that have lower birifrigence than lt.
geomaterials_bi_less_than(lt, ...)
geomaterials_bi_less_than(lt, ...)
lt |
float value.Birifrigence is calculated from refractive index as (rimax-rimin).Range: bi_min - bi_max. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "bi_max" of geomaterials. retrieve all the geomaterials that has higher birifrigence than the given value(lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_bi_less_than(0.3) ## End(Not run)
## Not run: df <-geomaterials_bi_less_than(0.3) ## End(Not run)
: Queries the list of geomaterials that have lower birifrigence than lt.
geomaterials_bi_range(gt,lt, ...)
geomaterials_bi_range(gt,lt, ...)
gt |
float value.Birifrigence is calculated from refractive index as (rimax-rimin).Range: bi_min - bi_max. |
lt |
float value.Birifrigence is calculated from refractive index as (rimax-rimin).Range: bi_min - bi_max. |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "bi_min"and "bi_max" of geomaterials. retrieve all the geomaterials that has the birifrigence within the given range of (gt,lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_bi_range(0.2,0.3) ## End(Not run)
## Not run: df <-geomaterials_bi_range(0.2,0.3) ## End(Not run)
: Queries the list of geomaterials that match an given groupid.
geomaterials_by_groupid(gid,...)
geomaterials_by_groupid(gid,...)
gid |
integer value. The id of the group to which this mineral belongs |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "groupid" of geomaterials. retrieve all the geomaterials that match an given groupid.
df, a data frame of geomaterials
## Not run: df <-geomaterials_by_groupid(0) ## End(Not run)
## Not run: df <-geomaterials_by_groupid(0) ## End(Not run)
: Queries the list of geomaterials that match an given cleavagetype
geomaterials_cleavagetype(types, ...)
geomaterials_cleavagetype(types, ...)
types |
vector of given cleavagetype (array of strings or null). The field "cleavage" is used to describe the crystallographic orientation of cleavage directions or planes and quality. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "cleavagetype" of geomaterials. Items Enum: "Distinct/Good" "Imperfect/Fair" "None Observed" "Perfect" "Poor/Indistinct" "Very Good"
df, a data frame of geomaterials
## Not run: df <-geomaterials_cleavagetype(c("Poor/Indistinct")) ## End(Not run)
## Not run: df <-geomaterials_cleavagetype(c("Poor/Indistinct")) ## End(Not run)
: Queries the list of geomaterials that match a given colors.
geomaterials_colour(colors, ...)
geomaterials_colour(colors, ...)
colors |
vector of given colors. colors of the mineral or rock - individual minerals at localities can also have color information. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "colour" of geomaterials. For example: "Brown", "Yellow", "green", "Pink","White","Orange","Blue","Gold","Dark brown","Purple".
df, a data frame of geomaterials
## Not run: df <-geomaterials_colour(c("bright blue")) ## End(Not run)
## Not run: df <-geomaterials_colour(c("bright blue")) ## End(Not run)
Queries the list of geomaterials that contain all the given elements listed in icl_elm_vector, but do not contain the given elements listed in ecl_elms_vector.
geomaterials_contain_all_but_not_elems(icl_elm_vector, ecl_elms_vector, ...)
geomaterials_contain_all_but_not_elems(icl_elm_vector, ecl_elms_vector, ...)
icl_elm_vector |
vector of elements. |
ecl_elms_vector |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_inc" and "elements_exc" of geomaterials. This function queries the list of geological materials that contain an given list of elements (icl_elm_vector), but not contain the other list of elements (ecl_elms_vector). It performs the query operation by calling the mindat_geomaterial_list function.
df, a data frame of geomaterials.
## Not run: df<-geomaterials_contain_all_but_not_elems (c('Fe','S'), c('O'),fields ="id,name,mindat_formula,elements") ## End(Not run)
## Not run: df<-geomaterials_contain_all_but_not_elems (c('Fe','S'), c('O'),fields ="id,name,mindat_formula,elements") ## End(Not run)
retrieve the geomaterials that contain all of the elements.This function queries the list of geomaterials that contain all the given elements. It performs the query operation by calling the mindat_geomaterial_list function
geomaterials_contain_all_elems(icl_elms_vector,...)
geomaterials_contain_all_elems(icl_elms_vector,...)
icl_elms_vector |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments that can be passed to the mindat_geomaterial_list function. |
This function releated to the field "elements_inc" of geomaterials.
df, a data frame of geomaterials list.
## Not run: df <-geomaterials_contain_all_elems (c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
## Not run: df <-geomaterials_contain_all_elems (c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
: Queries the list of geological materials that contain any one of the given elements.
geomaterials_contain_any_but_not_elems(any_elems_vector,ecl_elms_vector,...)
geomaterials_contain_any_but_not_elems(any_elems_vector,ecl_elms_vector,...)
any_elems_vector |
vector of elements. vector of any elements contained. |
ecl_elms_vector |
vector of elements. vector of any elements excluded. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_inc" of geomaterials. This function queries the list of geological materials that contain any element of an given list (any_elems). It performs the query operation by looping through each given element and calling the mindat_geomaterial_list function.
df, a data frame of geomaterials.
## Not run: df <-geomaterials_contain_any_but_not_elems(c('Fe','S'), c('O')) ## End(Not run)
## Not run: df <-geomaterials_contain_any_but_not_elems(c('Fe','S'), c('O')) ## End(Not run)
: Queries the list of geological materials that contain any one of the given elements.
geomaterials_contain_any_elems(any_elems, ...)
geomaterials_contain_any_elems(any_elems, ...)
any_elems |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_inc" of geomaterials. This function queries the list of geological materials that contain any element of an given list (any_elems). It performs the query operation by looping through each given element and calling the mindat_geomaterial_list function.
df, a data frame of geomaterials.
## Not run: df <-geomaterials_contain_any_elems (c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
## Not run: df <-geomaterials_contain_any_elems (c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
retrieve the geomaterials that only contain elements in an given list (icl_only_elms_vector).
geomaterials_contain_only_elems (icl_only_elms_vector,...)
geomaterials_contain_only_elems (icl_only_elms_vector,...)
icl_only_elms_vector |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments that can be passed to the mindat_geomaterial_list function. |
This function releated to the fields "elements_inc" and "elements_exc" of geomaterials. Here is a list of all elements that can make up geomaterials:'H','Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Na', 'Mg', 'Al','Si', 'P', 'S','Cl',K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge','As','Se', 'Br', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd','In', 'Sn', 'Sb', 'Te', 'I', 'Cs',Ba', 'La', 'Ce', 'Nd', 'Sm', 'Gd', 'Dy', 'Er','Yb', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au','Hg','Tl', 'Pb', 'Bi', 'Th', 'U' It performs the query operation by calling the mindat_geomaterial_list function
df, a data frame of geomaterials.
## Not run: df <-geomaterials_contain_only_elems(c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
## Not run: df <-geomaterials_contain_only_elems(c('Fe','S'),fields ="id,name,mindat_formula,elements") ## End(Not run)
: Queries the list of geomaterials that have the given crystal system.
geomaterials_crystal_system(crystals, ...)
geomaterials_crystal_system(crystals, ...)
crystals |
vector of given crystals. "crystal system of the mineral; "Amorphous","Hexagonal","Icosahedral","Isometric","Monoclinic","Orthorhombic","Tetragonal","Triclinic","Trigonal" |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "crystal_system" of geomaterials. Items Enum: "Amorphous" "Hexagonal" "Icosahedral" "Isometric" "Monoclinic" "Orthorhombic" "Tetragonal" "Triclinic" "Trigonal"
df, a data frame of geomaterials
## Not run: df <-geomaterials_crystal_system(c("Icosahedral")) ## End(Not run)
## Not run: df <-geomaterials_crystal_system(c("Icosahedral")) ## End(Not run)
: Queries the list of geomaterials that have higher density than gt.
geomaterials_dens_greater_than(gt, ...)
geomaterials_dens_greater_than(gt, ...)
gt |
float value. dmeas: measured density of the mineral. This is either the lower limit (if there is a dmeas2) or average (if there is no dmeas2). dmeas2:measured maximum density of mineral |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "density_min" of geomaterials. retrieve all the geomaterials that has higher density than the given density(gt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_dens_greater_than(2) ## End(Not run)
## Not run: df <-geomaterials_dens_greater_than(2) ## End(Not run)
: Queries the list of geomaterials that have lower density than lt.
geomaterials_dens_less_than(lt, ...)
geomaterials_dens_less_than(lt, ...)
lt |
float value. dmeas: measured density of the mineral. This is either the lower limit (if there is a dmeas2) or average (if there is no dmeas2). dmeas2:measured maximum density of mineral |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "density_max" of geomaterials. retrieve all the geomaterials that has higher density than the given density(lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_dens_less_than(3) ## End(Not run)
## Not run: df <-geomaterials_dens_less_than(3) ## End(Not run)
: Queries the list of geomaterials that match an given range.
geomaterials_dens_range(gt,lt, ...)
geomaterials_dens_range(gt,lt, ...)
gt |
float value |
lt |
float value dmeas: measured density of the mineral. This is either the lower limit (if there is a dmeas2) or average (if there is no dmeas2). dmeas2:measured maximum density of mineral |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "density_min" and "density_max" of geomaterials. retrieve all the geomaterials records that has the density within an given range of (gt,lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_dens_range(2,3) ## End(Not run)
## Not run: df <-geomaterials_dens_range(2,3) ## End(Not run)
: Queries the list of geomaterials that have an given diapheny.
geomaterials_diapheny(diapheny, ...)
geomaterials_diapheny(diapheny, ...)
diapheny |
string. The diaphany of the mineral - transparent; translucent; opaque |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "diapheny" of geomaterials. The diaphany of the mineral(Items Enum): "Opaque" "Translucent" "Transparent"
df, a data frame of geomaterials
## Not run: df <-geomaterials_diapheny("Transparent") ## End(Not run)
## Not run: df <-geomaterials_diapheny("Transparent") ## End(Not run)
: Queries the list of geomaterials that have the given entrytype
geomaterials_entrytype(types,...)
geomaterials_entrytype(types,...)
types |
list of entry types. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "entrytype" of geomaterials. Items Enum: 0 1 2 3 4 5 6 7 8 Multiple choice: 0- mineral; 1-synonym; 2-variety; 3-mixture; 4-series; 5-grouplist; 6-polytype; 7-rock; 8-commodity Releated field: entrytype_text (description of the entrytype).
df, a data frame of geomaterials
## Not run: df <-geomaterials_entrytype(c('1')) ## End(Not run)
## Not run: df <-geomaterials_entrytype(c('1')) ## End(Not run)
: Queries the list of geomaterials that have the given expand.
geomaterials_expand(expanded_fields,...)
geomaterials_expand(expanded_fields,...)
expanded_fields |
list of expand (Array of strings (Expanded fields)).Select fields to expand. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "expand" of geomaterials. The field expand(Items Enum): "description" "type_localities" "localities" "relations" "~all" "*"
df, a data frame of geomaterials
## Not run: df <-geomaterials_expand("~all") ## End(Not run)
## Not run: df <-geomaterials_expand("~all") ## End(Not run)
: Queries the list of geomaterials with an empty or not empty of a given field.
geomaterials_field_exists(fieldname,bexists,...)
geomaterials_field_exists(fieldname,bexists,...)
fieldname |
string |
bexists |
bool |
... |
Further named parameters.Other optional arguments. |
This function releated to all the fields of geomaterials. e.g. meteoritical_code_exists.Meteoritical code exists. Include non-empty (true) / include empty only (false) retrieve the geomaterial list with an empty or not empty of a given field.
df, a list of geomaterials
## Not run: df <-geomaterials_field_exists("meteoritical_code") ## End(Not run)
## Not run: df <-geomaterials_field_exists("meteoritical_code") ## End(Not run)
: Queries the list of geomaterials that have the given fracturetype.
geomaterials_fracturetype(types, ...)
geomaterials_fracturetype(types, ...)
types |
list of types.fracturetype(Array of strings or null): How the mineral breaks-"Conchoidal" "Fibrous" "Hackly" "Irregular/Uneven" "Micaceous" "None observed" "Splintery" "Step-Like" "Sub-Conchoidal". |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "fracturetype" of geomaterials. fracturetype(Items Enum): "Conchoidal" "Fibrous" "Hackly" "Irregular/Uneven" "Micaceous" "None observed" "Splintery" "Step-Like" "Sub-Conchoidal"
df, a data frame of geomaterials
## Not run: df <-geomaterials_fracturetype(c("Step-Like")) ## End(Not run)
## Not run: df <-geomaterials_fracturetype(c("Step-Like")) ## End(Not run)
: Queries the list of geomaterials that have higher hardness than an given value(hmin).
geomaterials_hardness_gt(hmin, ...)
geomaterials_hardness_gt(hmin, ...)
hmin |
float value of the Mohs scale of mineral hardness, which ranging from 0 to 10. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "hardness_min" of geomaterials. retrieve all the geomaterials that has higher hardness than the given value(hmin). hmin:the given value of minimum Moh's hardness
df, a data frame of geomaterials
## Not run: df <-geomaterials_hardness_gt(8) ## End(Not run)
## Not run: df <-geomaterials_hardness_gt(8) ## End(Not run)
: Queries the list of geomaterials that have lower hardness than an given vlaue(hmax).
geomaterials_hardness_lt(hmax, ...)
geomaterials_hardness_lt(hmax, ...)
hmax |
float value of the Mohs scale of mineral hardness, which ranging from 0 to 10. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "hardness_max" of geomaterials. retrieve all the geomaterials that has lower hardness than an given value(hmax). hamx: maximum Moh's hardness
df, a data frame of geomaterials
## Not run: df <-geomaterials_hardness_lt(2) ## End(Not run)
## Not run: df <-geomaterials_hardness_lt(2) ## End(Not run)
: Queries the list of geomaterials that have hardness within the given range.
geomaterials_hardness_range(hmin,hmax, ...)
geomaterials_hardness_range(hmin,hmax, ...)
hmin |
float value of the Mohs scale of mineral hardness, which ranging from 0 to 10. |
hmax |
float value of the Mohs scale of mineral hardness, which ranging from 0 to 10. |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "hardness_min" and "hardness_max" of geomaterials. retrieve all the geomaterials that has the hardness within an given range(hmin,hmax). hmin:the given value of minimum Moh's hardness hamx: maximum Moh's hardness
df, a data frame of geomaterials
## Not run: df <-geomaterials_hardness_range(2,3) ## End(Not run)
## Not run: df <-geomaterials_hardness_range(2,3) ## End(Not run)
: Queries the geomaterials within or without the ima.
geomaterials_ima(btrue,...)
geomaterials_ima(btrue,...)
btrue |
boolean value.TRUE IMA approved, otherwise not approved. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ima" of geomaterials. retrieve all the geomaterials that are approved by the IMA or not.
df, a data frame of geomaterials
## Not run: df <-geomaterials_ima(TRUE) ## End(Not run)
## Not run: df <-geomaterials_ima(TRUE) ## End(Not run)
: Queries the geomaterials with an given .
geomaterials_ima_notes(enum_item,...)
geomaterials_ima_notes(enum_item,...)
enum_item |
Array of integers or null. Ima notes: multiple choice (OR) : "GROUP" "INTERMEDIATE" "NAMED_AMPHIBOLE" "PENDING_APPROVAL" "PUBLISHED_WITHOUT_APPROVAL" "REDEFINED" "REJECTED" "RENAMED" "UNNAMED_INVALID" "UNNAMED_VALID" |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ima_notes" of geomaterials. Rejected by the IMA; Pending approval; IMA Approved Group Name; Redefined by the IMA; Renamed by the IMA; Intermediate member of a solid-solution series; Published without approval; Unnamed (probably valid); Unnamed (probably invalid); Named Amphibole
retrieve all the geomaterials that match the input IMA notes.
df, a data frame of geomaterials
## Not run: df <-geomaterials_ima_notes(c("PENDING_APPROVAL")) ## End(Not run)
## Not run: df <-geomaterials_ima_notes(c("PENDING_APPROVAL")) ## End(Not run)
: Queries the geomaterials with an given ima status.
geomaterials_ima_status(enum_status,...)
geomaterials_ima_status(enum_status,...)
enum_status |
Ima status: multiple choice (OR):"APPROVED" "DISCREDITED" "GRANDFATHERED" "PENDING_PUBLICATION" "QUESTIONABLE" |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ima_status" of geomaterials. retrieve all the geomaterials that match the input IMA notes.
df, a data frame of geomaterials
## Not run: df <-geomaterials_ima_status(c("APPROVED")) ## End(Not run)
## Not run: df <-geomaterials_ima_status(c("APPROVED")) ## End(Not run)
: Queries the geomaterials that match an given lustretype.
geomaterials_lustretype(types, ...)
geomaterials_lustretype(types, ...)
types |
string of the type name (Array of strings or null). adamantine, subadamtine, vitreous, subvitreous, resinous, waxy, greasy, silky, pearly, metallic, submetallic, dull, earthy |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "lustretype" of geomaterials. lustretype(Items Enum): "Adamantine" "Dull" "Earthy" "Greasy" "Metallic" "Pearly" "Resinous" "Silky" "Sub-Adamantine" "Sub-Metallic" "Sub-Vitreous" "Vitreous" "Waxy" multiple choice (AND)
df, a data frame of geomaterials
## Not run: df <-geomaterials_lustretype(c("Adamantine")) ## End(Not run)
## Not run: df <-geomaterials_lustretype(c("Adamantine")) ## End(Not run)
: Queries the geomaterials with a given string matched its given meteoritical_code.
geomaterials_meteoritical_code(str_meteoritical_code,...)
geomaterials_meteoritical_code(str_meteoritical_code,...)
str_meteoritical_code |
boolean, meteoritical code exists. Include non-empty (TRUE) / include empty only (FALSE). |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "meteoritical_code_exists" of geomaterials. Meteoritical code exists. Include non-empty (true) / include empty only (false). retrieve all the geomaterials that match the input str_meteoritical_code.
df, a data frame of geomaterials
## Not run: df <-geomaterials_meteoritical_code(TRUE) ## End(Not run)
## Not run: df <-geomaterials_meteoritical_code(TRUE) ## End(Not run)
: Queries the geomaterials with a given name.
geomaterials_name(str_name,...)
geomaterials_name(str_name,...)
str_name |
Text search supporting: _ as wildcards, e.g. "qu_rtz", "bario*" |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "name" of geomaterials. retrieve all the geomaterials that match the input IMA notes.
df, a data frame of geomaterials
## Not run: df <-geomaterials_name("qu_rtz") ## End(Not run)
## Not run: df <-geomaterials_name("qu_rtz") ## End(Not run)
retrieve the geomaterials that do not contain any of the given elements.
geomaterials_not_contain_elems (ecl_elms_vector, ...)
geomaterials_not_contain_elems (ecl_elms_vector, ...)
ecl_elms_vector |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_exc" of geomaterials.
df, a data frame of geomaterials list.
## Not run: df <-geomaterials_not_contain_elems (c('Fe','S', 'O'), fields ="id,name,mindat_formula,elements") ## End(Not run)
## Not run: df <-geomaterials_not_contain_elems (c('Fe','S', 'O'), fields ="id,name,mindat_formula,elements") ## End(Not run)
: Queries the geomaterials have the lower optical 2v value than the given lt.
geomaterials_optical2v_max(lt, ...)
geomaterials_optical2v_max(lt, ...)
lt |
list of the signs.Please refer to the details. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "optical2v_max" of geomaterials. optical2vcalc:The calculated 2V angle minimum or average of biaxial minerals optical2vcalc2:The calculated 2V angle maximum of biaxial minerals optical2vmeasured:The measured 2V angle minimum or average of biaxial minerals optical2vmeasured2:The measured 2V angle maximum of biaxial minerals
df, a data frame of geomaterials
## Not run: df <-geomaterials_optical2v_max(0.2) ## End(Not run)
## Not run: df <-geomaterials_optical2v_max(0.2) ## End(Not run)
: Queries the geomaterials have the higher optical 2v value than the given gt.
geomaterials_optical2v_min(gt, ...)
geomaterials_optical2v_min(gt, ...)
gt |
given value of optical 2v of mineral.Please refer to the details. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "optical2v_mix" of geomaterials. optical2vcalc:The calculated 2V angle minimum or average of biaxial minerals optical2vcalc2:The calculated 2V angle maximum of biaxial minerals optical2vmeasured:The measured 2V angle minimum or average of biaxial minerals optical2vmeasured2:The measured 2V angle maximum of biaxial minerals
df, a data frame of geomaterials
## Not run: df <-geomaterials_optical2v_min(0.1) ## End(Not run)
## Not run: df <-geomaterials_optical2v_min(0.1) ## End(Not run)
: Queries the geomaterials have the higher optical 2v value than the given lt.
geomaterials_optical2v_range(gt,lt,...)
geomaterials_optical2v_range(gt,lt,...)
gt |
given value of minimum of optical 2v of mineral.Please refer to the details. |
lt |
an given value of maximum of optical 2v of mineral.Please refer to the details. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "optical2v_min" and "optical2v_max" of geomaterials. optical2vcalc:The calculated 2V angle minimum or average of biaxial minerals optical2vcalc2:The calculated 2V angle maximum of biaxial minerals optical2vmeasured:The measured 2V angle minimum or average of biaxial minerals optical2vmeasured2:The measured 2V angle maximum of biaxial minerals
df, a data frame of geomaterials
## Not run: df <-geomaterials_optical2v_range(0.1,0.2) ## End(Not run)
## Not run: df <-geomaterials_optical2v_range(0.1,0.2) ## End(Not run)
: Queries the geomaterials match an given optical signs.
geomaterials_opticalsign(signs, ...)
geomaterials_opticalsign(signs, ...)
signs |
list of the signs(string or null). sign for uniaxial and biaxial minerals: +;-;+/- .Please refer to the details. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "opticalsign" of geomaterials. Optical sign: single choice (Enum): "+", "+/-", "-"
df, a data frame of geomaterials
## Not run: df <-geomaterials_opticalsign("-") ## End(Not run)
## Not run: df <-geomaterials_opticalsign("-") ## End(Not run)
: Queries the geomaterials match an given optical type.
geomaterials_opticaltype(types, ...)
geomaterials_opticaltype(types, ...)
types |
list of the types for the field of opticaltype. Please refer to the details. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "opticaltype" of geomaterials. transparent mineral. opticaltype(Enum) :"Biaxial" "Isotropic" "Uniaxial"
df, a data frame of geomaterials
## Not run: df <-geomaterials_opticaltype("Isotropic") ## End(Not run)
## Not run: df <-geomaterials_opticaltype("Isotropic") ## End(Not run)
: Queries the geomaterials by an given id for its polytype. A mineral that differs from another only in the stacking of similar structural units in its atomic structure
geomaterials_polytypeof(ptype, ...)
geomaterials_polytypeof(ptype, ...)
ptype |
integer. an mindat id of the mineral that this record is the polytype of |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "polytypeof" of geomaterials. retrieve the geomaterials with an given id of polytypeof.
df, a data frame of geomaterials
## Not run: df <-geomaterials_polytypeof(0,fields = "id,name,polytypeof") ## End(Not run)
## Not run: df <-geomaterials_polytypeof(0,fields = "id,name,polytypeof") ## End(Not run)
: Queries the geomaterials have the higher refractive index than an given value(gt).
geomaterials_ri_gt(gt, ...)
geomaterials_ri_gt(gt, ...)
gt |
float value. Refractive index, from (rimax>=). |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ri_min" of geomaterials. retrieve the geomaterials with the refractive index higher than an given value(gt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_ri_gt(0.3) ## End(Not run)
## Not run: df <-geomaterials_ri_gt(0.3) ## End(Not run)
: Queries the geomaterials have the lower refractive index than an given value(lt).
geomaterials_ri_lt(lt,...)
geomaterials_ri_lt(lt,...)
lt |
float value. Refractive index, to (rimin<=) |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ri_max" of geomaterials. retrieve the geomaterials with the refractive index lower than an given value(lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_ri_lt(0.5) ## End(Not run)
## Not run: df <-geomaterials_ri_lt(0.5) ## End(Not run)
: Queries the list of geomaterials that have refractive index within an given range(gt,lt).
geomaterials_ri_range(gt,lt, ...)
geomaterials_ri_range(gt,lt, ...)
gt |
float value. Refractive index, from (rimax>=). |
lt |
float value. Refractive index, to (rimin<=) |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "ri_min" and "ri_max" of geomaterials. retrieve all the geomaterials that has the refractive index within the range of (gt,lt).
df, a data frame of geomaterials
## Not run: df <-geomaterials_ri_range(0.2,0.5) ## End(Not run)
## Not run: df <-geomaterials_ri_range(0.2,0.5) ## End(Not run)
: Queries the list of geomaterials by a given name.
geomaterials_search_name(name,...)
geomaterials_search_name(name,...)
name |
string. Text search supporting wildcards, e.g. qu_rtz, bario*" |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "name" of geomaterials. retrieve the geomaterial list that match the given name.
df, a list of geomaterials
## Not run: df <-geomaterials_search_name("Quartz") ## End(Not run)
## Not run: df <-geomaterials_search_name("Quartz") ## End(Not run)
: Queries the list of geomaterials that match an given steak.
geomaterials_streak(str,...)
geomaterials_streak(str,...)
str |
string. The color of the streak (color of powdered mineral) |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "steak" of geomaterials. The color of the streak (color of powdered mineral). retrieve the geomaterials that has the given steak.
df, a data frame of geomaterials
## Not run: df <-geomaterials_streak("orange") ## End(Not run)
## Not run: df <-geomaterials_streak("orange") ## End(Not run)
: Queries the list of geomaterials that match an given synid.
geomaterials_synid(idnum,...)
geomaterials_synid(idnum,...)
idnum |
integer,an given synonym id. |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "synid" of geomaterials. The id of the geomaterial that is the synonym of this record (this geomaterial cannot be added to a locality). retrieve the geomaterials that has an given synid.
df, a data frame of geomaterials
## Not run: df <-geomaterials_synid(3777) ## End(Not run)
## Not run: df <-geomaterials_synid(3777) ## End(Not run)
: Queries the list of geomaterials that were updated at an given time
geomaterials_updated_at(strDate,...)
geomaterials_updated_at(strDate,...)
strDate |
string |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "updated_at" of geomaterials. Last updated datetime in format %Y-%m-%d %H:%M:%S retrieve the geomaterials that have the latest updated at the given time.
df, a data frame of geomaterials
## Not run: df <-geomaterials_updated_at("2020-2-12 10:15:12") ## End(Not run)
## Not run: df <-geomaterials_updated_at("2020-2-12 10:15:12") ## End(Not run)
: Queries the list of geomaterials that match the given varietyof.
geomaterials_varietyof(intvalue,...)
geomaterials_varietyof(intvalue,...)
intvalue |
integer, id of mineral that has this variety. |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "varietyof" of geomaterials. Varieties are geomaterials that have a special distinction from the main geomaterial ie. amethyst var. quartz retrieve the geomaterials that are varieties of an given id of geomaterials.
df, a data frame of geomaterials
## Not run: df <-geomaterials_varietyof(3337) ## End(Not run)
## Not run: df <-geomaterials_varietyof(3337) ## End(Not run)
: Queries the geomaterials include non-utf mineral names or not.
geomeaterials_non_utf(btrue =TRUE,...)
geomeaterials_non_utf(btrue =TRUE,...)
btrue |
boolean. Include non-UTF mineral names?.Default is TRUE. |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "non_utf" of geomaterials. retrieve the geomaterials that contain (or not contain) the non-utf name.
df, a data frame of geomaterials
## Not run: df <-geomeaterials_non_utf(TRUE,fields = "id,name,non_utf") ## End(Not run)
## Not run: df <-geomeaterials_non_utf(TRUE,fields = "id,name,non_utf") ## End(Not run)
: Queries the geomaterials by an given ordering.
geomeaterials_ordering(ord, ...)
geomeaterials_ordering(ord, ...)
ord |
string of field. Prepend "-" to the field name for descending order. Enum: "approval_year" "id" "minstats__ms_locentries" "minstats__ms_photos" "name" "updttime" "weighting". |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "ordering" of geomaterials. ordering=-id - sort by id descending. Prepend "-" to the field name for descending order. fields:"approval_year" "id" "minstats__ms_locentries" "minstats__ms_photos" "name" "updttime" "weighting". retrieve the geomaterials by an given ordering.
df, a data frame of geomaterials
## Not run: df <-geomeaterials_ordering(-id) ## End(Not run)
## Not run: df <-geomeaterials_ordering(-id) ## End(Not run)
Convert the mindat R dataframe to JSON-LD string
getExtension (filename)
getExtension (filename)
filename |
R dataframe of retrieived data from Mindat database. |
filename<- "fname.txt" fname_extension<- getExtension(filename)
filename<- "fname.txt" fname_extension<- getExtension(filename)
: Queries the list of localities.
localities_list_all(...)
localities_list_all(...)
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "ids" of localities. retrieve all the localities.
df, a data frame of localities
## Not run: df <-localities_list_all(fields = "id,name,latitude,longitude") ## End(Not run)
## Not run: df <-localities_list_all(fields = "id,name,latitude,longitude") ## End(Not run)
: Queries the list of localities that are within a given country.
localities_list_country(country,...)
localities_list_country(country,...)
country |
name of country, |
... |
Further named parameters.Other optional arguments. |
This function releated to the field "country" of localities. Enum: "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antigua and Barbuda" "Argentina" "Armenia" "Aruba" "Ashmore and Cartier Islands" "Australia" "Austria" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bosnia And Herzegovina" "Botswana" "Bouvet Island" "Brazil" "British Indian Ocean Territories" "British Solomon Islands" "British Virgin Islands" "Brunei" "Bulgaria" "Burkina Faso" "Burundi" "Cambodia" "Cameroon" "Canada" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Christmas Island" "Cocos Islands" "Colombia" "Comoro Islands" "Cook Islands" "Costa Rica" "Croatia" "Cuba" "Cyprus" "Czech Republic" "Democratic Republic of the Congo" "Denmark" "Djibouti" "Dominica" "Dominican Republic" "East Timor" "Ecuador" "Egypt" "El Salvador" "Equatorial Guinea" "Estonia" "Ethiopia" "Faeroe Islands" "Falkland Islands" "Federated States of Micronesia" "Fiji" "Finland" "France" "French Guiana" "French Polynesia" "Gabon" "Gambia" "Georgia" "Germany" "Ghana" "Gibraltar" "Greece" "Greenland" "Grenada" "Guadeloupe" "Guam" "Guatemala" "Guernsey" "Guinea" "Guinea-Bissau" "Guyana" "Haiti" "Honduras" "Hong Kong" "Hungary" "Iceland" "India" "Indonesia" "Iran" "Iraq" "Ireland" "Isle of Man" "Israel" "Italy" "Ivory Coast (Côte d'Ivoire)" "Jamaica" "Japan" "Jersey" "Jordan" "Kazakhstan" "Kenya" "Kiribati " "Kosovo" "Kuwait" "Kyrgyzstan" "Laos" "Latvia" "Lebanon" "Lesotho" "Liberia" "Libya" "Liechtenstein" "Lithuania" "Luxembourg" "Macao" "Madagascar" "Malawi" "Malaysia" "Maldives" "Mali" "Malta" "Martinique" "Mauritania" "Mauritius" "Mexico" "Moldova" "Monaco" "Mongolia" "Montenegro" "Montserrat" "Morocco" "Mozambique" "Myanmar" "Namibia" "Nauru" "Nepal" "Netherlands" "Netherlands Antilles" "New Caledonia" "New Zealand" "Nicaragua" "Niger" "Nigeria" "North Korea" "Norway" "Oman" "Pakistan" "Panama" "Papua New Guinea" "Paraguay" "Peru" "Philippines" "Poland" "Portugal" "Puerto Rico" "Qatar" "Republic of Congo (Brazzaville)" "Republic of Macedonia" "Reunion Island" "Romania" "Russia" "Rwanda" "Saint Helena" "Saint Lucia " "Saint Vincent and the Grenadines" "San Marino" "Sao Tome And Principe" "Saudi Arabia" "Senegal" "Serbia" "Seychelles" "Sierra Leone" "Singapore" "Slovakia" "Slovenia" "Solomon Islands" "Somalia" "South Africa" "South Korea" "Spain" "Sri Lanka" "St Christopher-Nevis Islands" "Sudan" "Suriname" "Swaziland" "Sweden" "Switzerland" "Syria" "Taiwan" "Tajikistan" "Tanzania" "Thailand" "Togo" "Tonga" "Trinidad And Tobago" "Tunisia" "Turkey" "Turkmenistan" "Turks And Caicos Islands" "Tuvalu" "U.S. Virgin Islands" "Uganda" "Ukraine" "United Arab Emirates" "United Kingdom" "United States" "Uruguay" "Uzbekistan" "Vanuatu (Republic of Vanuatu; New Hebrides) " "Venezuela" "Vietnam" "Western Sahara" "Western Samoa" "Yemen" "Zambia" "Zimbabwe"
df, a data frame of localities
## Not run: df <-localities_list_country ("Norway") ## End(Not run)
## Not run: df <-localities_list_country ("Norway") ## End(Not run)
: Queries the list of localities that contain the given description.
localities_list_description(desc,...)
localities_list_description(desc,...)
desc |
string, |
... |
Further named parameters.Other optional arguments. |
This function releated to all the field "description" of localities. retrieve the localities that contain the given description
df, a data frame of localities
## Not run: df <-localities_list_description("volcano") ## End(Not run)
## Not run: df <-localities_list_description("volcano") ## End(Not run)
Queries the list of localities that do not contain the given elements.
localities_list_elems_exc(exc_elems_list, ...)
localities_list_elems_exc(exc_elems_list, ...)
exc_elems_list |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_exc" of localities. This function queries the list of localities that do contain the specified elements.
df, a data frame of localities
## Not run: df <-localities_list_elems_exc(c("H", "O", "Si", "Al","Fe", "Ca", "Na", "K", "P", "C", "Mn", "F", "Mg", "S")) ## End(Not run)
## Not run: df <-localities_list_elems_exc(c("H", "O", "Si", "Al","Fe", "Ca", "Na", "K", "P", "C", "Mn", "F", "Mg", "S")) ## End(Not run)
Queries the list of localities that contain the given elements.
localities_list_elems_inc(inc_elems_list, ...)
localities_list_elems_inc(inc_elems_list, ...)
inc_elems_list |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the field "elements_inc" of localities. This function queries the list of localities that contain the given elements.
df, a data frame of localities
## Not run: df <-localities_list_elems_inc(c("Dy")) ## End(Not run)
## Not run: df <-localities_list_elems_inc(c("Dy")) ## End(Not run)
Queries the list of localities that contain the given elements,but not contain some other given elements.
localities_list_elems_inc_exc(inc_elems_list,exc_elems_list, ...)
localities_list_elems_inc_exc(inc_elems_list,exc_elems_list, ...)
inc_elems_list |
vector of elements. |
exc_elems_list |
vector of elements. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the fields "elements_inc" and "elements_exc" of localities. This function queries the list of localities that contain the given elements,but not contain some other given elements.
df, a data frame of localities
## Not run: df <-localities_list_elems_inc_exc(c("Dy"), c("Li")) ## End(Not run)
## Not run: df <-localities_list_elems_inc_exc(c("Dy"), c("Li")) ## End(Not run)
Queries the list of localities that contain the given expands.
localities_list_expand(expands,...)
localities_list_expand(expands,...)
expands |
vector of expands. |
... |
Further named parameters.Other optional arguments-Additional arguments. |
This function releated to the fields "expand" of localities. Items Enum: "geomaterials" "~all" "*" This function queries the list of localities that contain the given expands.
df, a data frame of localities
## Not run: df <-localities_list_expand("~all") ## End(Not run)
## Not run: df <-localities_list_expand("~all") ## End(Not run)
Queries the list of localities that contain the given txt name.
localities_list_txt(txt,...)
localities_list_txt(txt,...)
txt |
string. |
... |
Further named parameters.Other optional arguments. |
This function releated to the fields "txt" of localities. This function queries the list of localities that contain the given txt name.
df, a data frame of localities
## Not run: df <-localities_list_txt("lava") ## End(Not run)
## Not run: df <-localities_list_txt("lava") ## End(Not run)
: Queries the list of localities that have the given time
localities_list_updated_at(updateDate,...)
localities_list_updated_at(updateDate,...)
updateDate |
string |
... |
Further named parameters.Other optional arguments. |
This function releated to all the fields "updated_at" of localities. retrieve the localities that have the latest updated at the given time.
df, a data frame of localities
## Not run: df <-localities_list_updated_at("lava") ## End(Not run)
## Not run: df <-localities_list_updated_at("lava") ## End(Not run)
: Queries the localitiy by given id.
localities_retrieve_id(id,...)
localities_retrieve_id(id,...)
id |
integer. the mindat localitiy id. |
... |
Further named parameters.Other optional arguments. |
This function releated to all the fields "id" of localities. retrieve the localities by a given id.
df, a data frame of localities
## Not run: df <-localities_retrieve_id(3337) ## End(Not run)
## Not run: df <-localities_retrieve_id(3337) ## End(Not run)
retrieve all locality status list.
localities_status_list (...)
localities_status_list (...)
... |
Further named parameters. |
This function is to retrieve all the locality_status list.
df, data frame of locality status
## Not run: df <-localities_status_list() ## End(Not run)
## Not run: df <-localities_status_list() ## End(Not run)
retrieve locality status by its id.
localities_status_retrieve (id,...)
localities_status_retrieve (id,...)
id |
the mindat localitiy status id |
... |
Further named parameters. |
This function is to retrieve the locality_status by an given id of locality.
df, data frame of locality status.
## Not run: df <-localities_status_retrieve(10) ## End(Not run)
## Not run: df <-localities_status_retrieve(10) ## End(Not run)
retrieve locality type by an given id of locality.
localitiy_type_retrieve (id,...)
localitiy_type_retrieve (id,...)
id |
the mindat localitiy id |
... |
Further named parameters. |
This function is to retrieve the locality types by an given id of locality. @export
df, data frame of locality status.
## Not run: df <-localitiy_type_retrieve(50) ## End(Not run)
## Not run: df <-localitiy_type_retrieve(50) ## End(Not run)
retrieve locality age by its id
locality_age (id,...)
locality_age (id,...)
id |
the mindat localitiy age id. |
... |
Further named parameters. |
This function releated to the fields "id" of locality_age and locality.
df, data frame of locality age.
## Not run: df <-locality_age(3337) ## End(Not run)
## Not run: df <-locality_age(3337) ## End(Not run)
retrieve all locality age list or by its conditions
locality_age_list (...)
locality_age_list (...)
... |
Further named parameters. |
This function is to retrieve all the locality_age list.
df, data frame of locality age.
## Not run: df <-locality_age_list() ## End(Not run)
## Not run: df <-locality_age_list() ## End(Not run)
retrieve all locality type list.
locality_type_list (...)
locality_type_list (...)
... |
Further named parameters. |
This function is to retrieve the locality types list.
df, data frame of locality type.
## Not run: df <-locality_type_list() ## End(Not run)
## Not run: df <-locality_type_list() ## End(Not run)
Build query string based on the query conditions.
mindat_build_querystring (args)
mindat_build_querystring (args)
args |
query args. |
qs. generated query string.
## Not run: mindat_cache_set('page_size',800) ids<-c("") hardness_min<- 9.3 fields<- c("name,hardness") args<- list(ids,hardness_min,fields) querystring<-mindat_build_querystring(args) ## End(Not run)
## Not run: mindat_cache_set('page_size',800) ids<-c("") hardness_min<- 9.3 fields<- c("name,hardness") args<- list(ids,hardness_min,fields) querystring<-mindat_build_querystring(args) ## End(Not run)
Remove (clear) the cache named varname in current environment.
mindat_cache_delete(varname)
mindat_cache_delete(varname)
varname |
string input a cached name.Set a cached value empty by the given varname. A string, list or other objects. |
mindat_cache_delete('api_token')
mindat_cache_delete('api_token')
Clear all current cached values. Set current environment cache empty.
mindat_cache_empty()
mindat_cache_empty()
mindat_cache_empty()
mindat_cache_empty()
Retrieve the value of the cache named varname in current environment.
mindat_cache_get(varname)
mindat_cache_get(varname)
varname |
string |
cached value. A string, list or other objects.
token<- mindat_cache_get('api_token')
token<- mindat_cache_get('api_token')
Check whether or not the current environment has the cache named varname.
mindat_cache_has(varname)
mindat_cache_has(varname)
varname |
string. |
Boolean value. if the varname is found in current environment cache, return True otherwise return False.
b_has <- mindat_cache_has('api_token')
b_has <- mindat_cache_has('api_token')
Check whether the current environment has the cached function named varname,if has, return it. if not, setup up a new cache function named varname.
mindat_cache_return_or_setup(varname,setupfun)
mindat_cache_return_or_setup(varname,setupfun)
varname |
string. |
setupfun |
boolean, if the cached is a setup function. |
If the varname is found in current environment cache, return cached function. If not, eval the function and return cached function.
aep<- api_end_points<-mindat_cache_return_or_setup('api_end_points', function(){return (list()) })
aep<- api_end_points<-mindat_cache_return_or_setup('api_end_points', function(){return (list()) })
Assigns the value to the cache named varname in current environment.
mindat_cache_set(varname, value)
mindat_cache_set(varname, value)
varname |
string. The cached varname. |
value |
string. |
mindat_cache_set('api_token',"9ce67655d74bcd981e937be80dcea9cb")
mindat_cache_set('api_token',"9ce67655d74bcd981e937be80dcea9cb")
Initializing API Call. Setup the base_url, token and format.
mindat_connection(token, base_url = "https://api.mindat.org",fmt ="json",page_size = 800)
mindat_connection(token, base_url = "https://api.mindat.org",fmt ="json",page_size = 800)
token |
string. You can apply a token from Mindat.org. |
base_url |
string.The base url of mindat API, default is "https://api.mindat.org". |
fmt |
string. The format of the request and response, default is json. |
page_size |
interger, setting the page size of responsed data from the API server. |
mindat_connection("9ce67655d74bcd981e937be80dcea9cb",page_size = 1500)
mindat_connection("9ce67655d74bcd981e937be80dcea9cb",page_size = 1500)
retrieve all countries list or the contries by given conditions.
mindat_countries (...)
mindat_countries (...)
... |
Further named parameters. |
df, data frame of countries list
## Not run: df<- mindat_countries() ## End(Not run)
## Not run: df<- mindat_countries() ## End(Not run)
retrieve the country by given its id.
mindat_country (id,...)
mindat_country (id,...)
id |
country id in mindat. |
... |
Further named parameters. |
df, a data frame of country
## Not run: df<- mindat_country(1) ## End(Not run)
## Not run: df<- mindat_country(1) ## End(Not run)
.
mindat_extract_response_body (response)
mindat_extract_response_body (response)
response |
response json |
if status of the response is sucess (200),return the all_data_text(the content of response). Otherwise,report the errors.
## Not run: library(httr) uri<- "https://api.mindat.org/geomaterials/?id__in=&hardness_min=9.3&fields=name,+ hardness&page_size=1500" api_token<- "9ce67655d74bcd981e937be80dcea9cb" response <- GET(uri,add_headers('Authorization'= paste('Token ',api_token,sep = ""))) raw_data <- mindat_extract_response_body(response) ## End(Not run)
## Not run: library(httr) uri<- "https://api.mindat.org/geomaterials/?id__in=&hardness_min=9.3&fields=name,+ hardness&page_size=1500" api_token<- "9ce67655d74bcd981e937be80dcea9cb" response <- GET(uri,add_headers('Authorization'= paste('Token ',api_token,sep = ""))) raw_data <- mindat_extract_response_body(response) ## End(Not run)
retrieve geomaterial by its id
mindat_geomaterial (id,...)
mindat_geomaterial (id,...)
id |
geomaterial id |
... |
Further named parameters. |
df, data frame of locality type list
## Not run: df<- mindat_geomaterial(3337) ## End(Not run)
## Not run: df<- mindat_geomaterial(3337) ## End(Not run)
retrieve all the geomaterial list or the geomaterial by given conditions.
mindat_geomaterial_list(...)
mindat_geomaterial_list(...)
... |
Further named parameters. |
df, data frame of locality type list
## Not run: df<- mindat_geomaterial_list() ## End(Not run)
## Not run: df<- mindat_geomaterial_list() ## End(Not run)
retrieve all the geomaterial list or the geomaterial by given conditions.
mindat_geomaterial_search (...)
mindat_geomaterial_search (...)
... |
Further named parameters. |
df, data frame of geomaterials mathch the search
## Not run: df<- mindat_geomaterial_search(q="Quartz") ## End(Not run)
## Not run: df<- mindat_geomaterial_search(q="Quartz") ## End(Not run)
retrieve the geomaterial varieties by the id of geomaterial.
mindat_geomaterial_varieties (id,...)
mindat_geomaterial_varieties (id,...)
id |
geomaterial id |
... |
Further named parameters. |
df, data frame of locality type list
## Not run: df<- mindat_geomaterial_varieties(3337) ## End(Not run)
## Not run: df<- mindat_geomaterial_varieties(3337) ## End(Not run)
retrieve data from the uri.
mindat_get_data_from_uri (uri)
mindat_get_data_from_uri (uri)
uri |
request uri |
df. R data frame of the request uri.
## Not run: library(httr) uri <- "https://api.mindat.org/geomaterials/?id__in=&hardness_min=9.3&fields=name,+ hardness&page_size=1500" mindat_cache_set('api_token',"9ce67655d74bcd981e937be80dcea9cb") df <- mindat_get_data_from_uri(uri) ## End(Not run)
## Not run: library(httr) uri <- "https://api.mindat.org/geomaterials/?id__in=&hardness_min=9.3&fields=name,+ hardness&page_size=1500" mindat_cache_set('api_token',"9ce67655d74bcd981e937be80dcea9cb") df <- mindat_get_data_from_uri(uri) ## End(Not run)
retrieve localities list
mindat_localities_list (...)
mindat_localities_list (...)
... |
Further named parameters. |
df. data frame of localities list.
## Not run: df<- mindat_localities_list() ## End(Not run)
## Not run: df<- mindat_localities_list() ## End(Not run)
retrieve locality by its id
mindat_localitiy (id,...)
mindat_localitiy (id,...)
id |
the mindat localitiy id |
... |
Further named parameters. |
df, data frame of locality
## Not run: df<- mindat_localitiy(3337) ## End(Not run)
## Not run: df<- mindat_localitiy(3337) ## End(Not run)
retrieve all locality status by its id
mindat_locality_status (id,...)
mindat_locality_status (id,...)
id |
the mindat localitiy status id. |
... |
Further named parameters. |
df, data frame of locality status
## Not run: df<- mindat_locality_status(10) ## End(Not run)
## Not run: df<- mindat_locality_status(10) ## End(Not run)
retrieve all locality status list
mindat_locality_status_list (...)
mindat_locality_status_list (...)
... |
Further named parameters. |
df, data frame of locality status list
## Not run: df<- mindat_locality_status_list() ## End(Not run)
## Not run: df<- mindat_locality_status_list() ## End(Not run)
retrieve locality type by its id
mindat_locality_type (id,...)
mindat_locality_type (id,...)
id |
locality type id |
... |
Further named parameters. |
df, data frame of locality type list
## Not run: df<- mindat_locality_type(50) ## End(Not run)
## Not run: df<- mindat_locality_type(50) ## End(Not run)
retrieve all locality type list
mindat_locality_type_list (...)
mindat_locality_type_list (...)
... |
Further named parameters. |
df, data frame of locality type list
## Not run: df<- mindat_locality_type_list() ## End(Not run)
## Not run: df<- mindat_locality_type_list() ## End(Not run)
convert the response json to dataframe of R
mindat_make_data_frame (reg_list)
mindat_make_data_frame (reg_list)
reg_list |
response json data to list format obj. |
df_out, R data frame
## Not run: id<- c('42155','9300','11282','48322') name<- c('Cuarzo opalescente', 'Cupromagnesite', 'Cuprozippeite', 'Quartz-anorthosite') ima_status <- c(0,0,0,0) synid <- c(42133, 9281, 0, 0) list_cvt <- list(id=id, name=name, ima_status=ima_status, synid=synid) df<- mindat_make_data_frame(list_cvt) ## End(Not run)
## Not run: id<- c('42155','9300','11282','48322') name<- c('Cuarzo opalescente', 'Cupromagnesite', 'Cuprozippeite', 'Quartz-anorthosite') ima_status <- c(0,0,0,0) synid <- c(42133, 9281, 0, 0) list_cvt <- list(id=id, name=name, ima_status=ima_status, synid=synid) df<- mindat_make_data_frame(list_cvt) ## End(Not run)
retrieve ima mineral by its id.
mindat_mineral_ima (id,...)
mindat_mineral_ima (id,...)
id |
mindat id |
... |
Further parameters. |
df. query resutls in data frame format.
## Not run: df<- mindat_mineral_ima(3337) ## End(Not run)
## Not run: df<- mindat_mineral_ima(3337) ## End(Not run)
retrieve ima mineral list
mindat_mineral_ima_list (...)
mindat_mineral_ima_list (...)
... |
, Further named parameters. |
df, data frame of mineral list.
## Not run: df<- mindat_mineral_ima_list() ## End(Not run)
## Not run: df<- mindat_mineral_ima_list() ## End(Not run)
parse the raw response of json to dataframe of R. If the raw_data obtained from the response is paged, request all the pages and then add them into the df_out data frame.
mindat_parse_raw_data (raw_data)
mindat_parse_raw_data (raw_data)
raw_data |
content of the response body |
df_out, R data frame
## Not run: rd<-"{\"count\":5,\"next\":null,\"previous\":null,+ \"results\":[{\"name\":\"Diamond\"},{\"name\":\"Khamrabaevite\"},+ {\"name\":\"Moissanite\"},{\"name\":\"Qingsongite\"},{\"name\":\"Uakitite\"}]}" df<- mindat_parse_raw_data(rd) ## End(Not run)
## Not run: rd<-"{\"count\":5,\"next\":null,\"previous\":null,+ \"results\":[{\"name\":\"Diamond\"},{\"name\":\"Khamrabaevite\"},+ {\"name\":\"Moissanite\"},{\"name\":\"Qingsongite\"},{\"name\":\"Uakitite\"}]}" df<- mindat_parse_raw_data(rd) ## End(Not run)
Basic function for query dataset at a specified endpoit.
mindat_query (endpoint, query = list())
mindat_query (endpoint, query = list())
endpoint |
query endpoint, e.g.'minerals_ima'. |
query |
list for query conditions. |
df query resutls in data frame format.
## Not run: df <-mindat_query("geomaterials_list",list(ids="",hardness_min=9)) ## End(Not run)
## Not run: df <-mindat_query("geomaterials_list",list(ids="",hardness_min=9)) ## End(Not run)
set up of the mindat basic uri, endpoints, and cache
mindat_setup(base_uri = 'https://api.mindat.org',page_size = 800)
mindat_setup(base_uri = 'https://api.mindat.org',page_size = 800)
base_uri |
base uri of mindat API. |
page_size |
interger,setting the page size of responsed data from the API server. |
## Not run: mindat_setup() ## End(Not run)
## Not run: mindat_setup() ## End(Not run)
retrieve all mineral ima list.
minerals_ima_list (...)
minerals_ima_list (...)
... |
Further named parameters. |
This function is to retrieve the IMA minerals list.
df, data frame of minerals.
## Not run: df <-minerals_ima_list() ## End(Not run)
## Not run: df <-minerals_ima_list() ## End(Not run)
retrieve mineral ima list with the given expand.
minerals_ima_list_expand (expand,...)
minerals_ima_list_expand (expand,...)
expand |
description |
... |
Further named parameters. |
This function is related to the filed "expand" of ima mineral. Items Enum: "~all" "*"
df, data frame of ima minerals with expanded fields.
## Not run: df <-minerals_ima_list_expand("~all") ## End(Not run)
## Not run: df <-minerals_ima_list_expand("~all") ## End(Not run)
retrieve mineral ima list with the given intValue.
minerals_ima_list_ima (intValue,...)
minerals_ima_list_ima (intValue,...)
intValue |
Integer |
... |
Further named parameters. |
This function is related to the filed "ima" of ima minerals. Integer. 0: "PENDING_PUBLICATION" 1: "APPROVED"
df, data frame of locality type.
## Not run: df <-minerals_ima_list_ima(1) ## End(Not run)
## Not run: df <-minerals_ima_list_ima(1) ## End(Not run)
retrieve mineral ima by its id.
minerals_ima_retrieve (id,...)
minerals_ima_retrieve (id,...)
id |
the mindat ima id |
... |
Further named parameters. |
This function is related to the filed "id" of ima minerals.
df, data frame of ima mineral by a given id.
## Not run: df <-minerals_ima_retrieve(3337) ## End(Not run)
## Not run: df <-minerals_ima_retrieve(3337) ## End(Not run)
: Queries the list of mineral_ima that have the given time
minerals_ima_updated_at(updateDate,...)
minerals_ima_updated_at(updateDate,...)
updateDate |
string |
... |
Further named parameters.Other optional arguments. |
This function is related to the filed "updated_at" of ima minerals. retrieve the localities that have the latest updated at the given time.
df, a data frame of localities
## Not run: df <-minerals_ima_updated_at("2020-11-10 10:12:20") ## End(Not run)
## Not run: df <-minerals_ima_updated_at("2020-11-10 10:12:20") ## End(Not run)
Prase params to string,so that the query function can deal with the other exteranl condition set by the users.
params_to_string (params)
params_to_string (params)
params |
convert params to string,which is used by the mindat query function. |
str .
## Not run: params_to_string("") ## End(Not run)
## Not run: params_to_string("") ## End(Not run)
Save the mindat R dataframe to a specify format
saveMindatDataAs (inputdata,outputfname)
saveMindatDataAs (inputdata,outputfname)
inputdata |
R dataframe of retrieived data from Mindat database. |
outputfname |
string. the output file name. |
## Not run: df <-geomaterials_search_name("Quartz") saveMindatDataAs(df,"test.jsonld") ## End(Not run)
## Not run: df <-geomaterials_search_name("Quartz") saveMindatDataAs(df,"test.jsonld") ## End(Not run)
set base uri of current environment
set_api_base (api_base)
set_api_base (api_base)
api_base |
string. The base uri of mindat api. |
set_api_base("9ce67655d74bcd981e937be80dcea9cb")
set_api_base("9ce67655d74bcd981e937be80dcea9cb")
set the token of current environment
set_api_token (api_token)
set_api_token (api_token)
api_token |
string. The token of mindat api. |
set_api_token("9ce67655d74bcd981e937be80dcea9cb")
set_api_token("9ce67655d74bcd981e937be80dcea9cb")
set the page_size of response records.
set_page_size (page_size)
set_page_size (page_size)
page_size |
string. The token of mindat api. |
set_page_size(800)
set_page_size(800)