My goal is to visualize the outcome of the pearson test on the dataframe called Width_Dens in the snapshot below. I could not copy the dataframe because it is too big, so hopefullly this picture makes it clear. In order to visualize the outcome of the pearson test for my data, the following script is used:
ggscatter(Width_dens, x = "Width", y = "Density",
add = c("reg.line"), conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson")
xlab = "Canal Width (m)", ylab = "Plastic density ( m^-2)")
It gives the following error:
Don't know how to automatically pick scale for object of type units. Defaulting to continuous.
Error in Ops.units(x, range[1]) :
both operands of the expression should be "units" objects
Does anybody have a clue what is wrong with this code? Or maybe another way to plot a similar graph?