Hi I'm trying to plot my data using ggplot2 but I'm getting this error I've never seen before... I was searching online and couldn't find anything useful.
This is my code:
##PACKAGES
library(ggplot2)
library(viridis)
library(hrbrthemes)
##IMPORT DATA
library(readxl)
TOC_LANG <- read_excel("PHD/LAB/LAB RESULTS/Jul-2021- TOC/TOC- LAN and GROVE AV/vario016_TOC_MOD.xlsx",
sheet = "R", range = "B3:E55")
#IMPORT DATA
library(readxl)
TOC_PORTGA <- read_excel("PHD/LAB/LAB RESULTS/Jul-2021- TOC/TOC- LAN and GROVE AV/vario016_TOC_MOD.xlsx",
sheet = "R", range = "A59:E105")
View(TOC_LANG)
########NUMERIC
TOC_LANG$TOC = as.numeric(TOC_LANG$TOC)
is.numeric(TOC_LANG$TOC)
TOC_LANG$Macroalgae = as.numeric(TOC_LANG$Macroalgae)
is.numeric(TOC_LANG$Macroalgae)
FIRST CODE
ggplot(TOC_LANG,aes(x=Depth,y=TOC, group=Macroalgae)) +
geom_line(aes(color=Macroalgae),size=.5, linetype=1) +
geom_point() +
scale_x_reverse() +
scale_y_continuous( position="right") +
labs(title ="TOC_LANG (%C)", x= "Depth (cm)", y="TOC (%C)") +
coord_flip()
thank you!