Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
spdgrams:ree_primitive_mantle [2016/03/11 10:10]
admin
spdgrams:ree_primitive_mantle [2018/11/12 15:07] (текущий)
Строка 1: Строка 1:
-====== Primitive Mantle ======+====== Primitive Mantle, Sun-McDonough,​ 1989 ======
  
  
 === Details === === Details ===
  
-<data plot+| Reference | <ref:sun1989| 
-Reference [wiki]:  +Data bulk | 
-Databulk +Input ppm 
-Inputppm + 
-</data>+<use:​spdgrams.ree_primitive_mantle>​ 
 +<​test:​spdgrams.ree_primitive_mantle>
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
-  * заголовок+  * <del>заголовок</​del>​
   * краткое описание   * краткое описание
-  * статья +  * <del>статья</​del>​ 
-  * ссылка+  * <del>ссылка</​del>​
   * <​del>​карточка</​del>​   * <​del>​карточка</​del>​
   * подробное описание   * подробное описание
-  * код+  * <del>код</​del>​
   * тест   * тест
 </​WRAP>​ </​WRAP>​
 +
  
  
Строка 25: Строка 27:
  
 <Code linenums lang-r> <Code linenums lang-r>
-require('​ggplot');+require('​ggplot2');
  
-spdgrams.ree_primitive_mantle <- function(ppm_data)+cmp <- read.csv("​constants_oceanic_basalts_compositions.csv",​ sep=";",​ stringsAsFactors=F);​ 
 + 
 +spdgrams.ree_primitive_mantle <- function(ppm_data, el_order = NULL)
 { {
-primitive_mantle = data.frame(Cs = c(0.032), Rb = c(0.635), Ba = c(6.989), Th = c(0.085), +ns <- el_order; 
-                              ​= c(0.021), Nb = c(0.713), Ta = c(0.041), La = c(0.687), +  
-                              ​Ce = c(1.775), Pb = c(0.185), Pr = c(0.276), Sr = c(21.1), +if (is.null(el_order)) 
-                              ​Nd = c(1.354), Zr = c(11.2), Hf = c(0.309), Sm = c(0.444), +
-                              ​Eu = c(0.168), Gd = c(0.596), Tb = c(0.108), Dy = c(0.737), +ns <- c('​Cs'​'Rb''Ba''Th''U''Nb''Ta''La''Ce''Pb''Pr', 
-                              ​= c(4.55), Ho = c(0.164), Er = c(0.48), Tm = c(0.074), +        'Sr''Nd''Zr''Hf''Sm''Eu''Gd''Tb''Dy''Y''Ho', 
-                              ​Yb = c(0.493), Lu = c(0.074));+        'Er''Tm''Yb''Lu'); 
 +}
  
-ns <- names(primitive_mantle);​+pmsc <- c(); 
 + 
 +for (n in ns
 +  pmsc <- c(pmsc, subset(cmp, element == n)$primitive_mantle);​
  
 ds <- selectNames(ppm_data,​c(paste0(ns,'​_ppm'​)));​ ds <- selectNames(ppm_data,​c(paste0(ns,'​_ppm'​)));​
Строка 45: Строка 53:
 ret <- c(); ret <- c();
  
-values <- cbind(ppm_data$Name,​ rowApply(`/​`,​ds,​primitive_mantle[1,​]));+values <- cbind(ppm_data$Name,​ rowApply(`/​`,​ds,​pmsc));
 names(values)[1] <- '​Name';​ names(values)[1] <- '​Name';​
  
 ret$values <- values; ret$values <- values;
 ret$grades <- ns; ret$grades <- ns;
 +ret$labels <- c('​REE',​ '​Sample/​Primitive mantle'​);​
  
 return(ret);​ return(ret);​
 } }
 </​Code>​ </​Code>​
 +
 +{{tag>​spdgrams mantle}}
  • spdgrams/ree_primitive_mantle.1457691006.txt.gz
  • Последние изменения: 2018/11/12 15:08
  • (внешнее изменение)