Introduction

Now that we have LCPs and their metrics calculated, we need to explore values and generate some analyses.

This is a working document to be updated regularly, comments and suggestions are welcome.


Set the working directory, packages, and read in data

setwd(wd)
library(sf)
library(terra)
library(dplyr)
library(RColorBrewer)
library(viridis)
library(colorspace)
library(tidyr)
library(ggplot2)

The LCP generation script produces a .csv of attributes and calculated metrics, and a shapefile of all the lines generated with the .csv data as attributes per line. We will read in this data as well as the study area DTM for visualization.

lcps = read.csv(csv_data)
lcp_lines = read_sf(shp_data)
dtm = rast(dtm)

Let’s look at the data in our table…

#looking at the first couple lines of the table
head(lcps)
##   X     pt1x    pt1y     pt2x    pt2y v0 k  w1 pathLength startEndDistance
## 1 1 421076.6 4456800 419828.2 4451804  0 0 0.0   5517.767         5150.305
## 2 2 421076.6 4456800 419828.2 4451804  0 0 0.1   5517.767         5150.305
## 3 3 421076.6 4456800 419828.2 4451804  0 0 0.2   5517.767         5150.305
## 4 4 421076.6 4456800 419828.2 4451804  0 0 0.3   5588.478         5150.305
## 5 5 421076.6 4456800 419828.2 4451804  0 0 0.4   5588.478         5150.305
## 6 6 421076.6 4456800 419828.2 4451804  0 0 0.5   5594.335         5150.305
##   sinuosity     avgRgh     avgVeg     avgVis percentVisT5 percentVisT10
## 1  1.071348 0.03515378 0.03515378 0.03515378   0.13578275   0.023961661
## 2  1.071348 0.02909795 0.02909795 0.02909795   0.06070288   0.007987220
## 3  1.071348 0.02862679 0.02862679 0.02862679   0.05591054   0.006389776
## 4  1.085077 0.02745826 0.02745826 0.02745826   0.06339144   0.007923930
## 5  1.085077 0.02745826 0.02745826 0.02745826   0.06339144   0.007923930
## 6  1.086214 0.02728773 0.02728773 0.02728773   0.05863708   0.004754358
##   percentVisT25 percentVisT50 traveltime
## 1   0.001597444             0   6589.882
## 2   0.000000000             0   5907.155
## 3   0.000000000             0   5901.509
## 4   0.000000000             0   5784.874
## 5   0.000000000             0   5784.874
## 6   0.000000000             0   5781.589

So we can see here that we have point locations, visibility rescaling values, path length, point distances, and travel time, metrics including sinuosity and average landscape values, and percent visibility at listed thresholds. Now let’s visualize the data.


Saving start and end points

Because start and end points weren’t created in our script but might be good for visualization and future analysis, we will create and save them as multipoint features.

startpts = st_as_sf(lcps, coords = c('pt1x','pt1y'), crs = 4326)
endpts = st_as_sf(lcps, coords = c('pt2x', 'pt2y'), crs = 4326)
#plot dtm as extent, and points
e = ext(dtm)
plot(e, main = 'Start and End Points')
plot(st_geometry(startpts), pch = 16, col = 'green', add=T)
plot(st_geometry(endpts), pch = 16, col = 'red', add=T)

We’ll also add the lines to our visualization.

plot(e, main = "9900 LCPs with Start/End Points")
lines(lcp_lines, col='lightblue', lwd = 0.5)
plot(st_geometry(startpts), pch = 16, col='green', add = T)
plot(st_geometry(endpts), pch = 16, col = 'red', add=T)



Visualizing Calculated Metrics

Now that we have seen tabulated data and a visualization of the summary of our data plotted in space, let’s look at the metrics we calculated in an easier-to-understand format. I’ll include a few visualizations in an attempt to figure out what “works best” for my thesis.


Sinuosity

Just exploring how to make graphs the data, let’s start with a graph of sinuosity.

Sinuosity is going to be shown as the relationship between straight line distance (x) and actual LCP distance (y).

plot(lcps$pathLength ~ lcps$startEndDistance)

Now I’ll make that graph a little cuter..

plot(lcps$pathLength ~ lcps$startEndDistance, pch = 16, cex = 0.5, main = "LCP Sinuosity", xlab = "Euclidean Distance (m)", ylab = "Measured LCP Distance (m)")

Let’s look at how the different variable values might affect sinuosity by coloring points in the plot by the variables.

Starting with visibility rescaling, we will color by rescaling method (v0):

colors_v0_0 = brewer.pal(3, "Set1")[1] 
colors_v0_05 = brewer.pal(3, "Set1")[2] 
colors_v0_1 = brewer.pal(3, "Set1")[3] 
colors = rep(colors_v0_0, nrow(lcps))
colors[lcps$v0 == "0.5"] = colors_v0_05
colors[lcps$v0 == "1"] = colors_v0_1
plot(lcps$pathLength ~ lcps$startEndDistance, col = colors, pch = 16, cex = 0.7, main = "LCP Sinuosity", xlab = "Euclidean Distance (m)", ylab = "Measured LCP Distance (m)")
legend("bottomright", legend=c("0, log","0.5, log growth", "1.0, exp"), col=c(colors_v0_0, colors_v0_05, colors_v0_1), pch=16, cex = 1, title='Rescaling Method', bty='n')

While we are working with grouping sinuosity values by rescaling method, let’s look at this data as a box plot:

boxplot(sinuosity ~ v0, data = lcps, frame=F)

Now to see how the rescaling factor (k) affects sinuosity by coloring accordingly:

colors_k_0 = brewer.pal(4, "Set1")[4]
colors_k_5 = brewer.pal(4, "Set1")[1] 
colors_k_10 = brewer.pal(4, "Set1")[2] 
colors_k_20 = brewer.pal(4, "Set1")[3] 
colors = rep(colors_k_5, nrow(lcps))
colors[lcps$k == "10"] = colors_k_10
colors[lcps$k == "20"] = colors_k_20
colors[lcps$k == "0"] = colors_k_0
plot(lcps$pathLength ~ lcps$startEndDistance, col = colors, pch = 16, cex = 0.7, main = "LCP Sinuosity", xlab = "Euclidean Distance (m)", ylab = "Measured LCP Distance (m)")
legend("bottomright", legend=c("0", "5","10", "20"), col=c(colors_k_0, colors_k_5, colors_k_10, colors_k_20), pch=16, cex = 1, title='Rescaling Factor', bty='n')

And now the box plot:

boxplot(sinuosity ~ k, data = lcps, frame=F)

We can do the same exercise for weights, but I don’t think it will be particularly fruitful, what with there being 11 values for weights. Instead, we will move on to plotting weights against sinuosity per rescaling method/factor.

Sinuosity per Rescaling Method + Weights

(To be continued…)

Coefficient of Variation

Coefficient of Variation (CV) aka Normalized Root-Mean-Square Deviation aka relative standard deviation, is a measure of variability of data in a sample in relation to the mean of the population. CV is calculated as the ratio of the standard deviation to the mean:

\[ CV = \sqrt{\frac{\sigma}{\mu}} \]

When looking at the results, the higher the value of a sample’s CV, the greater the level of dispersion around the mean. Fun facts:

  • allows you to compare variability between disparate groups and characteristics
  • often report CV as a percentage
  • higher values represent a greater degree of relative variability
  • good for comparisons of groups that have means of very different magnitudes
  • good for characteristics that use different units of measurement


Attempt 1

I am going to try to calculate a coefficient of variation (CV) of path length value for each point pair. This means that each point pair should have the same CV value for every LCP. I’ll be using tapply() to apply the CV function to each start/end point pair group, specified by pt1x.

First, define the CV function:

cv_fun = function(x){
  cv = (sd(x)/mean(x))*100
  return(cv)
}

Now use tapply to create and save the path length CV.

pathLength_cv = tapply(lcps$pathLength, lcps$pt1x, cv_fun)
cv_df = data.frame(pt_set = seq(1,100), 
                   pathLength = pathLength_cv)
head(cv_df)
##                  pt_set pathLength
## 418005.206885748      1   7.510115
## 418007.527829148      2   8.822033
## 418032.693301328      3  11.693910
## 418108.569656499      4   7.551579
## 418149.680749513      5   2.146076
## 418168.686009943      6   6.914482

The data frame I printed above has the pt1x in the first column as the identifier of the point pairs, the second column is acting as an ID, and the third column is the value of path length CV by point pair.

pathLength_count = tapply(lcps$pathLength, lcps$pt1x, length)
pathLength_repeated = rep(pathLength_cv, pathLength_count)
lcps$pathLength_cv = pathLength_repeated
plot(lcps$pathLength, lcps$pathLength_cv)

Looking at that plot again… I don’t think it’s plotting the right stuff. Let me try something else.

plot(cv_df$pt_set, cv_df$pathLength)

Okay, so the plot above is the cv value of path length for each point set. Success! (?)


Attempt 2

Plotting CV of different variables:

Path Length CV
# Path Length CV for all data, grouped by weights
pathlengthcv = lcps %>%
  group_by(w1) %>%
  summarize(pathLength_cv = sd(pathLength)/mean(pathLength))
ggplot(pathlengthcv, aes(group = w1, x = w1, y = pathLength_cv)) +
  geom_boxplot() +
  labs(title = "Path Length CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

#Path Length CV for non-rescaled data, grouped by weights
pathlengthcv_1 = lcps %>%
  group_by(w1) %>%
  filter(k == 0) %>%
  summarize(pathLength_cv1 = sd(lcps$pathLength)/mean(lcps$pathLength))
ggplot(pathlengthcv_1, aes(group = w1, x = w1, y = pathLength_cv1)) +
  geom_boxplot() +
  labs(title = "Path Length CV, Non-Rescaled Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Okay it certainly appears that I am doing something wrong here, or the grouping mechanism is “incorrect” … The idea is to find the variation of path length values for each weight. I’m not sure what’s going on there, so gonna move on.


Travel time CV

My hypothesis before even beginning is that travel time is going to be most similar to path length…. actually now that I’m thinking about it my guess is that they’re all going to be the same graph. Let’s hurry and look.

# Travel time CV for all data, grouped by weights
traveltimecv = lcps %>%
  group_by(w1) %>%
  summarize(traveltime_cv = sd(traveltime)/mean(traveltime))
ggplot(traveltimecv, aes(group = w1, x = w1, y = traveltime_cv)) +
  geom_boxplot() +
  labs(title = "Travel Time CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

is immediately wrong about hypothesis
Alright moving on…


Average Vegetation Density CV
# Average Vegetation CV for all data, grouped by weights
avgvegcv = lcps %>%
  group_by(w1) %>%
  summarize(avgveg_cv = sd(avgVeg)/mean(avgVeg))
ggplot(avgvegcv, aes(group = w1, x = w1, y = avgveg_cv)) +
  geom_boxplot() +
  labs(title = "Average Vegetation CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Okay, the pattern we’re seeing with travel time and vegetation roughness is such that as speed is more important, variability of values decreases. The opposite of that statement would be that as visibility is more important, both of those two characteristics are more variable.

Let’s move on to more CV evaluations…


Average Terrain Roughness CV
# Average Roughness CV for all data, grouped by weights
avgrghcv = lcps %>%
  group_by(w1) %>%
  summarize(avgrgh_cv = sd(avgRgh)/mean(avgRgh))
ggplot(avgrghcv, aes(group = w1, x = w1, y = avgrgh_cv)) +
  geom_boxplot() +
  labs(title = "Average Roughness CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()


Visibility Metrics CV

Average Visibility:

# Average Visibility CV for all data, grouped by weights
avgviscv = lcps %>%
  group_by(w1) %>%
  summarize(avgvis_cv = sd(avgVis)/mean(avgVis))
ggplot(avgviscv, aes(group = w1, x = w1, y = avgvis_cv)) +
  geom_boxplot() +
  labs(title = "Average Visibility CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Okay pause… strange trend here with the “averages” all having the same curve shape/values of CV. I’m not sure why exactly the speed weight of 0.1 would have a higher CV than 0.0.


Percent Visibility, threshold 5:

# Percent Visibility (T5) CV for all data, grouped by weights
vist5cv = lcps %>%
  group_by(w1) %>%
  summarize(vist5_cv = sd(percentVisT5)/mean(percentVisT5))
ggplot(vist5cv, aes(group = w1, x = w1, y = vist5_cv)) +
  geom_boxplot() +
  labs(title = "Percent Visibility (T=5) CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Percent Visibility, threshold 10:

# Percent Visibility (T10) CV for all data, grouped by weights
vist10cv = lcps %>%
  group_by(w1) %>%
  summarize(vist10_cv = sd(percentVisT10)/mean(percentVisT10))
ggplot(vist10cv, aes(group = w1, x = w1, y = vist10_cv)) +
  geom_boxplot() +
  labs(title = "Percent Visibility (T=10) CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Percent Visibility, threshold 25:

# Percent Visibility (T25) CV for all data, grouped by weights
vist25cv = lcps %>%
  group_by(w1) %>%
  summarize(vist25_cv = sd(percentVisT25)/mean(percentVisT25))
ggplot(vist25cv, aes(group = w1, x = w1, y = vist25_cv)) +
  geom_boxplot() +
  labs(title = "Percent Visibility (T=25) CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Percent Visibility, threshold 50:

# Percent Visibility (T50) CV for all data, grouped by weights
vist50cv = lcps %>%
  group_by(w1) %>%
  summarize(vist50_cv = sd(percentVisT50)/mean(percentVisT50))
ggplot(vist50cv, aes(group = w1, x = w1, y = vist50_cv)) +
  geom_boxplot() +
  labs(title = "Percent Visibility (T=50) CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()
## Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).

All different trends for different visibility thresholds! Interesting and strange… can’t say I know what conclusions I can draw from that.


Sinuosity CV
# Sinuosity CV for all data, grouped by weights
sincv = lcps %>%
  group_by(w1) %>%
  summarize(sin_cv = sd(sinuosity)/mean(sinuosity))
ggplot(sincv, aes(group = w1, x = w1, y = sin_cv)) +
  geom_boxplot() +
  labs(title = "Sinuosity CV, All Data", 
       x = "Speed Weights", 
       y = "Coefficient of Variation") +
  theme_minimal()

Hmm… same trend as path length. Okay, well that was CV. Moving on…




Rescaled Visibility

Let’s look at the distribution of VI values for our rescaled and non-rescaled visibility rasters.

Non-rescaled visibility –

vis = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/visibility.tif")
plot(vis)
hist(vis,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, non-rescaled",
     xlab = "VI", ylab = "Frequency")

Rescale logarithmically, factor 5 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_k_5 = log.fun(vis, 0, 1, 5)
writeRaster(vis_v0_0_k_5, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_5.tif", overwrite=T)
vis_rs_log_5 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_5.tif")
plot(vis_rs_log_5)
hist(vis_rs_log_5,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logarithmic Rescale, k = 5",
     xlab = "VI", ylab = "Frequency")

Rescale logarithmically, factor 10 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_k_10 = log.fun(vis, 0, 1, 10)
writeRaster(vis_v0_0_k_10, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_10.tif", overwrite=T)
vis_rs_log_10 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_10.tif")
plot(vis_rs_log_10)
hist(vis_rs_log_10,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logarithmic Rescale, k = 10",
     xlab = "VI", ylab = "Frequency")

Rescale logarithmically, factor 20 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_k_20 = log.fun(vis, 0, 1, 20)
writeRaster(vis_v0_0_k_20, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_20.tif", overwrite=T)
vis_rs_log_20 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_log_20.tif")
plot(vis_rs_log_20)
hist(vis_rs_log_20,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logarithmic Rescale, k = 20",
     xlab = "VI", ylab = "Frequency")

Rescale logistically, factor 5 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_5_k_5 = log.fun(vis, 0.5, 1, 5)
writeRaster(vis_v0_0_5_k_5, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_5.tif", overwrite=T)
vis_rs_lgg_5 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_5.tif")
plot(vis_rs_lgg_5)
hist(vis_rs_lgg_5,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logistic Growth Rescale, k = 5",
     xlab = "VI", ylab = "Frequency")

Rescale logistically, factor 10 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_5_k_10 = log.fun(vis, 0.5, 1, 10)
writeRaster(vis_v0_0_5_k_10, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_10.tif", overwrite=T)
vis_rs_lgg_10 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_10.tif")
plot(vis_rs_lgg_10)
hist(vis_rs_lgg_10,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logistic Growth Rescale, k = 10",
     xlab = "VI", ylab = "Frequency")

Rescale logistically, factor 20 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_0_5_k_20 = log.fun(vis, 0.5, 1, 20)
writeRaster(vis_v0_0_5_k_20, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_20.tif", overwrite=T)
vis_rs_lgg_20 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_lgg_20.tif")
plot(vis_rs_lgg_20)
hist(vis_rs_lgg_20,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Logistic Growth Rescale, k = 20",
     xlab = "VI", ylab = "Frequency")

Rescale exponentially, factor 5 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_1_k_5 = log.fun(vis, 1, 1, 5)
writeRaster(vis_v0_1_k_5, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_5.tif", overwrite=T)
vis_rs_exp_5 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_5.tif")
plot(vis_rs_exp_5)
hist(vis_rs_exp_5,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Exponential Rescale, k = 5",
     xlab = "VI", ylab = "Frequency")

Rescale exponentially, factor 10 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_1_k_10 = log.fun(vis, 1, 1, 10)
writeRaster(vis_v0_1_k_10, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_10.tif", overwrite=T)
vis_rs_exp_10 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_10.tif")
plot(vis_rs_exp_10)
hist(vis_rs_exp_10,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Exponential Rescale, k = 10",
     xlab = "VI", ylab = "Frequency")

Rescale exponentially, factor 20 –

log.fun <- function(v, v0, L, k){
    vr <- L/ (1 + exp(-k * (v - v0)))
    return(vr)}

vis_v0_1_k_20 = log.fun(vis, 1, 1, 20)
writeRaster(vis_v0_1_k_20, "S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_20.tif", overwrite=T)
vis_rs_exp_20 = rast("S:/ursa2/smith/spring2024/sp24_analysis/lakemtns_rasters/lakemtns_vis/vis_rs_exp_20.tif")
plot(vis_rs_exp_20)
hist(vis_rs_exp_20,
     xlim = c(0,1),
     breaks = 20,
     main = "Distribution of Visibility Values, Exponential Rescale, k = 20",
     xlab = "VI", ylab = "Frequency")

Phew, that was a lot!! Okay, I think we can make a few observations/conclusions:

With logarithmic rescale, the values all shifted to about half-way up the VI scale (0 is now .5) at k = 5, and then we saw the emphasis high values that we expected in our hypothesis in k = 20. Logarithmic Rescale for k = 10 was unique because there is almost a reverse bell curve from the values from 0.5-1.0; showing what we are expecting from the logistic growth rescaling resulting in high and low values being emphasized, although values are still restricted to < 0.5.

In logistic growth and exponential rescaling, there is a significant emphasis on the low visibility values, especially in exponential rescaling. In logistic growth k = 10 and 20, there is still distribution of values to VI = 0.4, but a very low frequency. In exponential k = 5, the distribution of values appears as if the original histogram was shrunk vertically from 0-0.6 to 0-0.1. Exponential rescale for k = 10, 20 are simply a single line at 0.




Multivariable Plots

The goal here is to make one of those 2x2 plots where we compare two measurements/metrics for 4 different variables. I guess not exactly 2x2, but you know what I mean…


Visibility and Sinuosity

First we are looking at visibility weight (x) and sinuosity (y) for each rescaling method.

labs_v0 = as_labeller(c(`0` = "Logarithmic", 
                        `0.5` = "Logistic Growth", 
                        `1` = "Exponential"))
lcps %>%
  ggplot(aes(x = (1-w1), y = sinuosity)) + 
  geom_point() +
  facet_wrap(vars(v0), ncol = 3, labeller = labs_v0) +
  labs(x = "Visibility Weight", y = "Sinuosity", title = "Visibility and Sinuosity per Rescaling Method")

I can’t quite figure out how to add a plot for no rescaling, though that would be a good idea I think.

Looks like with logarithmic rescaling, sinuosity dips when visibility weight is around 0.6-0.9. Logistic Growth and Exponential rescaling show the same trend of sinuosity increasing significantly with visibility weight at 1.


Okay, yay! I made a plot with GGPLOT – that’s cool! Let’s make one for rescaling factor (k).

lcps %>%
  ggplot(aes(x = (1-w1), y = sinuosity)) +
  geom_point() +
  facet_wrap(vars(k), ncol = 2) +
  labs(x = "Visibility Weight", y = "Sinuosity", title = "Visibility and Sinuosity per Rescaling Factor")

In this analysis, it appears that we can make the conclusion that with the weight of visibility = 1, and a high rescaling factor, sinuosity significantly increases. Otherwise, it is relatively consistent. However, there is a strange, but maybe not statistically significant, trend in 0 rescaling where sinuosity decreases slowly as visibility weight increases.


Back to CV

Let’s look at CV as calculated above according to different variables (v0, k, weights)

First - V0:

lcps %>%
  ggplot(aes(x = pathLength, y = pathLength_cv)) +
  geom_point() +
  facet_wrap(vars(v0), ncol = 3, labeller = labs_v0) +
  labs(x = "Path Length (m)", y = "Coefficient of Variation (Path Length)")

Hmm… not completely confident on this one, but it looks like there are less points on the Logarithmic graph, meaning less values of CV… I think that might either be a plotting mistake, or a cv calculation mistake. I’ll have to readdress this one.


Now - k:

lcps %>%
  ggplot(aes(x = pathLength, y = pathLength_cv)) +
  geom_point() +
  facet_wrap(vars(k), ncol = 2) +
  labs(x = "Path Length (m)", y = "Coefficient of Variation (Path Length)")

I’m seeing a similar trend here as with the last figure, where there appears to be a different number of points in the plots, which could mean an error, or I guess clustering of points? Not too easy to draw conclusions.


And finally weights (using weight of visibility):

lcps %>%
  ggplot(aes(x = pathLength, y = pathLength_cv)) +
  geom_point() +
  facet_wrap(vars((1-w1)), ncol = 3) +
  labs(x = "Path Length (m)", y = "Coefficient of Variation (Path Length)")

Okay, judging by the above 3 figures which are the variables we change for each LCP point pair, it looks like with increasing rescaling factor and increasing weight of visibility, there is a wider distribution and higher frequency of this relationship between path length and path length’s CV… I just don’t know what this means for this analysis. I think I’m going to abandon this train of thought.