Skip to content

Dar roberd10, Separating scct (earth reference) LIBS from normal LIBS #176

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions StudentData/v1_Data_Introduction.md
Expand Up @@ -19,6 +19,9 @@ There is both meta data and feature data included in LIBS, since their are no ot

Main change made to the LIBS data set is that the elemental compounds originally had "o" (lowercase letter o) to represent "Oxygen" has been changed to "O" (uppercase letter O).

## Libs Earth References
Same exact columns as the normal LIBS data frame, but only the "scct" targets. That is, only the earth references. Note that none of these earth references are in the normal LIBS data frame.

# Sample data
Sample data is the data for the, currently 16, samples. There are four data frames for this.

Expand Down
23 changes: 18 additions & 5 deletions StudentData/v1_consistent_data_naming.Rmd
Expand Up @@ -53,11 +53,13 @@ colnames(pixl.df) <- c("Lat","Lon","Sol","Sample",
"Na2O","MgO","Al2O3","SiO2","P2O5","SO3","Cl","K2O","CaO","TiO2","Cr2O3","MnO","FeOT",
"Name","Type","Campaign","Location","Abrasion")
# Renaming LIBS
libs.df <- cbind(libs.df,libs_type.df$"type",libs_type.df$"earthsample?")
libs.df <- cbind(libs.df,libs_type.df$"type")
colnames(libs.df) <- c("Sol","Lat","Lon","Target","Point",
"SiO2","SiO2_stdev","TiO2","TiO2_stdev","Al2O3","Al2O3-stdev","FeOT","FeOT_stdev","MgO","MgO_stdev","CaO","CaO_stdev","Na2O","Na2O_stdev","K2O","K2O_stdev",
"Total","distance_mm","Tot.Em.",
"Type","Earth_Sample")
"Type")
libs_type.df <- libs_type.df$"earthsample?"

# Renaming Lithology
colnames(lithology.df) <- c("Sample","Name","SampleType","Campaign","Abrasion",
"Feldspar","Plagioclase","Pyroxene","Olivine","Quartz",
Expand Down Expand Up @@ -103,11 +105,11 @@ pixl.df <- pixl.df[,c("Sample",
"P2O5","SO3","Cl","Cr2O3","MnO" #These ones don't show up in LIBS
)]
# Resorting LIBS columns
libs.df <- libs.df[,c("Target","Point","Sol","Lat","Lon","Type","Earth_Sample",
libs.df <- libs.df[,c("Target","Point","Sol","Lat","Lon","Type",
"SiO2","SiO2_stdev","TiO2","TiO2_stdev","Al2O3","Al2O3-stdev","FeOT","FeOT_stdev","MgO","MgO_stdev","CaO","CaO_stdev","Na2O","Na2O_stdev","K2O","K2O_stdev",
"Total","distance_mm","Tot.Em.")]
# Resorting Lithology columns
lithology.df <- lithology.df[,c("Sample",
lithology.df <- lithology.df[1:16,c("Sample",
"Plagioclase","Sulfate","Ca-sulfate","Hydrated Ca-sulfate",
"Mg-sulfate","Hydrated Sulfates","Hydrated Mg-Fe sulfate","Perchlorates",
"Na-perchlorate","Amorphous Silicate","Phosphate","Pyroxene",
Expand Down Expand Up @@ -135,15 +137,16 @@ pixl_libs.df <- pixl_libs.df[,c("Target.libs","Point.libs","Sol.libs","Lat.libs"

```

Check types and fix them (ex Sample, Sol, Lat, Lon -> numeric, Name -> character, Abrasion, Campaign, Type, SampleType -> Factor)
# Fixing data types
Check types and fix them (ex Sample, Sol, Lat, Lon -> numeric, Name -> character, Abrasion, Campaign, Type, SampleType -> Factor)
```{r}
# Pixl
## Already good!
## Sample is integer and concentrations are numeric!

# Libs
libs.df$Point <- as.factor(libs.df$Point) # Was originally "character"
libs_type.df <- as.logical(libs_type.df) # Was originally "numeric"

# Lithology
lithology.df[,2:36] <- lapply(lithology.df[,2:36],as.factor) # Was originally "character"
Expand All @@ -169,11 +172,21 @@ sample_meta.df$SampleType <- as.factor(sample_meta.df$SampleType)

```

# Seperating Libs
Separating out earth reference Libs from normal Libs
```{r}
# Creating a data frame with only the Scct Libs data
libs_earth_references.df <- libs.df[libs_type.df,]

# Removing the Scct Libs data from Libs.df
libs.df <- libs.df[!libs_type.df,]
```

# Saving New data frames
```{r}
saveRDS(sample_meta.df, "v1_sample_meta.Rds")
saveRDS(libs.df, "v1_libs.Rds")
saveRDS(libs_earth_references.df, "v1_libs_earth_references.Rds")
saveRDS(lithology.df, "v1_lithology.Rds")
saveRDS(sherloc.df, "v1_sherloc.Rds")
saveRDS(pixl.df, "v1_pixl.Rds")
Expand Down
Binary file modified StudentData/v1_libs.Rds
Binary file not shown.
Binary file added StudentData/v1_libs_earth_references.Rds
Binary file not shown.
Binary file modified StudentData/v1_lithology.Rds
Binary file not shown.