Skip to content

Instantly share code, notes, and snippets.

@geofis
Last active March 31, 2019 01:48
Show Gist options
  • Save geofis/50fe0b23629c4d3931cbe5b1fd3bff80 to your computer and use it in GitHub Desktop.
Save geofis/50fe0b23629c4d3931cbe5b1fd3bff80 to your computer and use it in GitHub Desktop.
Script de Carolaine: control de version
setwd(tempdir())
getwd()
urldatos <- 'http://www.geografiafisica.org/sem201901/geo112/datos_campo_201901/'
clastosatr <- read.csv(
paste0(
urldatos,
'clastosatr_carolaine.csv'
),
encoding = "UTF-8",
check.names = F
)
clastosatr2 <-clastosatr
clastosatr2$flatness <- with(clastosatr2,(`largo (a)`+`ancho (b)`)/(2*`espesor (c)`))
View(clastosatr2)
colnames(clastosatr2) #PARA VERIFICAR POSICIONES DE COLUMNAS
colnames(clastosatr2)[5] <- 'width'
colnames(clastosatr2)[6] <- 'thick'
colnames(clastosatr2)[4] <- 'large'
colnames(clastosatr2)[9] <- 'sample'
colnames(clastosatr2)[15] <- 'flatness' #"ia" ESTÁ EN LA POSICIÓN 15 NO 14
dev.new()
par(mfrow=c(1,4))
boxplot(large~sample, clastosatr2, las = 2, main = 'Large', cex.main = 2, ylim = c(0,200))
boxplot(width~sample, clastosatr2, las = 2, main = 'Width', cex.main = 2, ylim = c(0,200))
boxplot(thick~sample, clastosatr2, las = 2, main = 'Thick', cex.main = 2, ylim = c(0,200))
boxplot(flatness~sample, clastosatr2, las = 2, main = 'Flatness', cex.main = 2, ylim = c(0,6))
cpu1 <- subset(clastosatr2, sample=='CPU1')
dev.new()
par(mfrow=c(1,4))
#Si ya fueron cambiados los nombres de columna para clastosatr2, que es el origen de cpu1, se deben usar los nombres nuevos
hist(cpu1$large, xlim = c(0,200), main = 'Large, CPU1', xlab = 'Large (in mm)', cex.main = 2)
hist(cpu1$width, xlim = c(0,200), main = 'Width, CPU1', xlab = 'Width (in mm)', cex.main = 2)
hist(cpu1$thick, xlim = c(0,200), main = 'Thick, CPU1', xlab = 'Thick (in mm)', cex.main = 2)
hist(cpu1$flatness, xlim = c(0,6), main = 'Flatness, CPU1', xlab = 'Flatness, dimensionless', cex.main = 2)
#CPU2
cpu2 <- subset(clastosatr2, sample=='CPU2')
dev.new()
par(mfrow=c(1,4))
#Si ya fueron cambiados los nombres de columna para clastosatr2, que es el origen de cpu1, se deben usar los nombres nuevos
hist(cpu2$large, xlim = c(0,200), main = 'Large, CPU2', xlab = 'Large (in mm)', cex.main = 2)
hist(cpu2$width, xlim = c(0,200), main = 'Width, CPU2', xlab = 'Width (in mm)', cex.main = 2)
hist(cpu2$thick, xlim = c(0,200), main = 'Thick, CPU2', xlab = 'Thick (in mm)', cex.main = 2)
hist(cpu2$flatness, xlim = c(0,6), main = 'Flatness, CPU2', xlab = 'Flatness, dimensionless', cex.main = 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment