R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(dplyr)
## Warning: package 'dplyr' was built under R version 4.0.3
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
## Warning: package 'tidyr' was built under R version 4.0.3
library(ggplot2)
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.5
#shell("cd c:/Users/Saman/Onedrive/Desktop/Mast467/Data/", translate=TRUE)
#shell("dir")
shell("c:/Users/Saman/OneDrive/Desktop/Mast467/Data/nasa.cmd",translate=TRUE)
Omg<- read.csv("c:/Users/Saman/Onedrive/Desktop/Mast467/Data/output.dat",sep=" ")
## Plot sal vs. depth for range
library(ggplot2)
ggplot(Omg, mapping=aes (x=dep, y=sal, group=cast)) +
  geom_path() +
  ylim(c(30,35)) +
  xlim(c(500,0)) +
  ylab("Salinity, psu") +
  xlab("Depth, m") +
  coord_flip(expand=FALSE) + 
  facet_wrap(~cast)
## Warning: Removed 6174 row(s) containing missing values (geom_path).

## Plot temp vs. depth for range
library(ggplot2)
ggplot(Omg, mapping=aes (x=dep, y=temp, group=cast)) +
  geom_path() +
  ylim(c(-3.0,6.5)) +
  xlim(c(500,0)) +
  ylab("Temperature, C") +
  xlab("Depth, m") +
  coord_flip(expand=FALSE) + 
  facet_wrap(~cast)
## Warning: Removed 3918 row(s) containing missing values (geom_path).

ggplot(Omg,mapping=aes(x=sal,y=temp,group=cast,color=dep)) +
  geom_point() +
  xlim(c(30,35)) +
  ylim(c(-3.5,5.5)) +
  xlab("Salinity, psu") +
  ylab("Temperature, C") +
  scale_color_viridis_c(guide=guide_colorbar(barheight=15,reverse=TRUE)) +
  facet_wrap(~cast)
## Warning: Removed 2269 rows containing missing values (geom_point).