C1 Chondrite, Sun, McDonough, 1989 + Oceanic, Sun, McDonough, 1989

C1 Chondrite + E-MORB, N-MORB, OIB

Details

Reference Sun, S-S, McDonough, WF Chemical and isotopic systematics of oceanic basalts: implications for mantle composition and processes, 1989 [ref]
Data bulk
Input ppm

Использовать Проверить

  • заголовок
  • краткое описание
  • статья
  • ссылка
  • карточка
  • подробное описание
  • код
  • тест

Source

  1. require('ggplot2');
  2.  
  3. cmp <- read.csv("constants_oceanic_basalts_compositions.csv", sep=";", stringsAsFactors=F);
  4. ocean <- read.csv("constants_oceanic_basalts_compositions.csv", sep=";", stringsAsFactors=F);
  5.  
  6. spdgrams.lan_c1_chondrite_sun_wm_sun <- function(ppm_data, el_order = NULL)
  7. {
  8.  
  9. ns <- el_order;
  10.  
  11. if (is.null(el_order)) {
  12. ns <- c('La','Ce','Pr','Nd','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu');
  13. }
  14.  
  15. pmsc <- c();
  16.  
  17. for (n in ns)
  18. pmsc <- c(pmsc, subset(cmp, element == n)$c1_chondrite);
  19.  
  20. nmorb <- c();
  21. emorb <- c();
  22. oib <- c();
  23.  
  24. for (n in ns) {
  25. if(n %in% ocean$element)
  26. {
  27. nmorb <- c(nmorb, subset(ocean, element == n)$N_MORB);
  28. emorb <- c(emorb, subset(ocean, element == n)$E_MORB);
  29. oib <- c(oib, subset(ocean, element == n)$OIB);
  30. }
  31. else
  32. {
  33. nmorb <- c(nmorb,0.0);
  34. emorb <- c(emorb,0.0);
  35. oib <- c(oib,0.0);
  36. }
  37. }
  38.  
  39. cr <- data.frame(rbind(nmorb,emorb,oib));
  40.  
  41. names(cr) <- c(paste0(ns,'_ppm'));
  42.  
  43. print(cr);
  44.  
  45. ds <- selectNames(ppm_data,c(paste0(ns,'_ppm')));
  46.  
  47. print(ds);
  48.  
  49. ds <-rbind(ds,cr);
  50.  
  51. names(ds) <- ns;
  52.  
  53. print(ds);
  54.  
  55. ret <- c();
  56.  
  57. values <- cbind(c(ppm_data$Name, "N-MORB", "E-MORB", "OBI"), rowApply(`/`,ds,pmsc));
  58. names(values)[1] <- 'Name';
  59.  
  60. print(values);
  61.  
  62. ret$values <- values;
  63. ret$grades <- ns;
  64. ret$labels <- c('REE', 'Sample/C1 Chondrite');
  65.  
  66. return(ret);
  67. }
  68.  
  69. spdgrams.lan_c1_chondrite_sun_wm_sun.test <- function()
  70. {
  71. spdgrams.lan_c1_chondrite_sun_wm_sun(data.frame(Name=c('Test'),Eu_ppm=c(34.5)));
  72. }
  73.  
  • spdgrams/lan_c1_chondrite_sun_wm_sun.txt
  • Последние изменения: 2018/11/12 15:07
  • (внешнее изменение)