How to use ggTS with ggplot?

Asked

Viewed 32 times

0

Hello, anyone know, have you used ggTS function to make Temperature/Salinity graphs with ggplot? I’m not sure how to install to make it work together with ggplot.

https://github.com/Davidatlarge/ggTS

Thank you,

1 answer

5


To install just clone the repository or download the . zip file. ggTS is not a package is a function R, which depends on the following CRAN packages:

pacotes <- c('gsw', 'dplyr', 'purrr', 'tidyr', 'isoband')
install.packages(pacotes)

Then, to run the first example of the question link:

old_dir <- getwd()
setwd('~/R/ggTS-master')
example <- read.csv('example_data/example_data.csv')
setwd(old_dir)

ggTS(sal = example$salinity, 
     pot.temp = example$potential.temperature, 
     reference.p = 0,
     col.par = example$depth, 
     col.name = "depth [m]")

inserir a descrição da imagem aqui

  • Thank you @Rui Barradas.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.