Dipwell Log

Dipwell log - Craig-y-Fan Ddu

Dipwell log taken at Craig-y-Fan Ddu. Let’s have a quick view of the data.

options(repos = c(CRAN = "https://cran.r-project.org"))
# state required library
library(readxl)
library(dplyr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
# View dataset
print(craig_y_fan_ddu_combined)
# A tibble: 114,510 × 4
   `Date-Time`         Seconds `Temperature (C)` `Depth (cm)`
   <dttm>                <dbl>             <dbl>        <dbl>
 1 2023-01-16 09:00:00       0             15.0         0.023
 2 2023-01-16 10:00:00    3600             14.5        -0.147
 3 2023-01-16 11:00:00    7200              9.03      -20.3  
 4 2023-01-16 12:00:00   10800              8.13      -47.9  
 5 2023-01-16 13:00:00   14400              6.95      -47.9  
 6 2023-01-16 14:00:00   18000              5.98      -47.5  
 7 2023-01-16 15:00:00   21600              5.33      -47.2  
 8 2023-01-16 16:00:00   25200              4.67      -47.8  
 9 2023-01-16 17:00:00   28800              4.51        2.50 
10 2023-01-16 18:00:00   32400              5.71        1.90 
# ℹ 114,500 more rows

We can have a look at a ‘plot’ of ‘Temperature (C)’ alone to view distribution.

# state required library
library(readxl)
library(dplyr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
# let's see a 'histogram' of temperature.
hist(craig_y_fan_ddu_combined$`Temperature (C)`)

We can have a look at a ‘plot’ of ‘Depth (cm)’ alone to view distribution.

library(readxl)
library(dplyr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
# let's see a 'histogram' of temperature.
hist(craig_y_fan_ddu_combined$`Depth (cm)`)

We can have a look at a ‘plot’ of ‘Temperature (C)’ against ‘Depth (cm)’ to view distribution.

library(readxl)
library(dplyr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
plot(craig_y_fan_ddu_combined$`Temperature (C)` ~ craig_y_fan_ddu_combined$`Depth (cm)`)

library(readxl)
library(dplyr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
cor.test(craig_y_fan_ddu_combined$`Temperature (C)` , craig_y_fan_ddu_combined$`Depth (cm)`)

    Pearson's product-moment correlation

data:  craig_y_fan_ddu_combined$`Temperature (C)` and craig_y_fan_ddu_combined$`Depth (cm)`
t = -13.253, df = 114508, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.04491794 -0.03335171
sample estimates:
        cor 
-0.03913614 

A correlation of -0.03913614 between two variables means:-

  • The relationship is very weak and negative.

  • The value is very close to zero (zero would mean no correlation at all).

  • Negative means that as one variable increases, the other tends to slightly decrease, but the effect is extremely small in this case.

  • Interpretation:-

  • There is almost no linear relationship between the two variables.

  • The variables are essentially uncorrelated.

Finally. Let’s see a ‘scatterplot’ to confirm the ‘negative’ correlation.

library(readxl)
library(dplyr)
library(ggpubr)
craig_y_fan_ddu_combined <- read_excel("Dipwell_data_logger/craig_y_fan_ddu_combined.xlsx")
# Rename variables `Temperature (C)` to "Temperature" and `Depth (cm)` to "Depth" to make life easier.
craig_y_fan_ddu_combined <- craig_y_fan_ddu_combined %>% rename(Temperature = `Temperature (C)`, Depth = `Depth (cm)`)
ggscatter(craig_y_fan_ddu_combined, x = "Temperature", y = "Depth",
          add = "reg.line", conf.int = TRUE, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Temperature (C)", ylab = "Depth (cm)")