Add a geom_vline in ggplot, x-scale is a time series in hours, minutes and seconds

Hello everybody!

I have problems by adding a vertical line in ggplot, basically because my x-axis represents a time serie in hours, minutes (intercept 5 min).

First I tried to convert the data in the right format with:
sunset$Sunset_Sunrise <- format(sunset, format = "%H:%M:%S")

I tried to add a vline with different methods....
First I got an error message when trying to filter or subset the correct value directly in the geom_vline function out of the data frame sunset.... So I tried next to enter the value manually, where I would like to plot a vline.... but doesn't work. The code now looks like follows:

A + geom_vline(aes(xintercept = as.Date(sunset$Sunset_Sunrise["06:18:25"])), linetype = 4, colour = "black")

But this code also gives me an error massage, although I defined the value as Date....:
undefined columns selected

Can you help me? I never worked with timesereis in R before. Doesn't matter if I can select the correct time out of the data frame sunset or have to fill it manually, at least I can add this vline to the ggplot!

TX a lot

Please post a small sample of your data, or all of the data if it is not too large. You can post the output of the dput function. For example, if your data are named DF, post the output of

dput(head(DF, 20))

which will provide the first 20 rows of DF. Paste the output between lines with three back ticks, like this
```
Your output here
```

@FJCC

Tx for your answer! Thats the output:


> dput(head(times,20))
structure(list(Plot = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L), .Label = c("ALP", 
"BEA", "BET", "CEL", "CHI", "DAV", "ISO", "JUS", "LAE", "LAU", 
"LEN", "NAT", "NEU", "NOV", "OTH", "SCH", "VIS", "VOR"), class = "factor"), 
    Date = structure(c(88L, 60L, 9L, 2L, 49L, 50L, 75L, 61L, 
    35L, 90L, 54L, 87L, 3L, 94L, 30L, 13L, 47L, 14L, 79L, 86L
    ), .Label = c("01.07.21", "01.08.11", "02.07.01", "02.08.11", 
    "02.08.21", "02.09.11", "03.05.96", "03.08.01", "03.08.04", 
    "03.08.21", "04.06.96", "04.07.01", "04.07.11", "04.08.97", 
    "05.07.21", "05.08.96", "06.07.01", "06.08.04", "06.08.21", 
    "07.03.11", "08.04.97", "08.05.96", "08.07.11", "08.07.19", 
    "08.07.97", "08.08.19", "09.07.13", "09.07.21", "09.07.97", 
    "09.08.04", "09.08.11", "09.08.21", "10.03.11", "10.07.01", 
    "10.07.21", "10.08.11", "10.08.21", "11.06.96", "11.07.04", 
    "11.07.11", "11.07.21", "11.08.08", "11.08.11", "11.08.21", 
    "12.07.04", "12.07.11", "12.07.21", "12.08.01", "12.08.11", 
    "12.08.21", "13.07.04", "13.08.11", "13.08.19", "14.05.96", 
    "14.08.21", "15.07.97", "15.08.01", "15.08.04", "15.08.96", 
    "16.08.01", "16.08.11", "16.12.21", "17.08.04", "17.08.11", 
    "18.08.11", "18.08.21", "19.08.21", "20.07.11", "21.07.01", 
    "21.07.04", "21.07.97", "22.07.01", "22.07.04", "22.07.97", 
    "22.08.01", "22.08.11", "23.07.96", "23.08.01", "24.07.01", 
    "24.07.96", "25.06.21", "26.07.01", "27.06.11", "27.07.01", 
    "28.06.11", "28.07.04", "28.07.97", "29.05.96", "29.07.04", 
    "29.07.21", "29.08.11", "30.06.04", "30.08.04", "31.07.01", 
    "31.07.21"), class = "factor"), Sunset_Sunrise = structure(c(64L, 
    35L, 49L, 7L, 41L, 13L, 30L, 36L, 77L, 57L, 54L, 62L, 1L, 
    8L, 47L, 88L, 3L, 45L, 4L, 52L), .Label = c("", "05:33:52", 
    "05:45:00", "05:51:51", "06:00:00", "06:00:14", "06:05:00", 
    "06:07:35", "06:09:00", "06:16:17", "06:17:09", "06:17:58", 
    "06:18:25", "06:18:48", "06:19:03", "06:22:03", "06:23:00", 
    "06:35:00", "06:36:00", "06:59:00", "16:49:23", "18:22:00", 
    "19:57:00", "20:09:00", "20:10:52", "20:12:44", "20:15:17", 
    "20:23:00", "20:24:00", "20:27:02", "20:29:10", "20:29:37", 
    "20:34:00", "20:34:03", "20:34:31", "20:37:00", "20:38:00", 
    "20:40:00", "20:40:03", "20:40:07", "20:41:00", "20:42:42", 
    "20:43:00", "20:45:00", "20:47:22", "20:48:05", "20:51:17", 
    "20:52:09", "20:54:00", "20:54:14", "20:54:15", "20:56:18", 
    "20:57:00", "20:58:46", "21:01:49", "21:03:08", "21:04:00", 
    "21:05:02", "21:07:00", "21:07:36", "21:08:51", "21:08:56", 
    "21:09:50", "21:09:57", "21:10:06", "21:10:35", "21:11:39", 
    "21:13:56", "21:14:44", "21:18:00", "21:18:32", "21:19:38", 
    "21:19:55", "21:20:00", "21:20:05", "21:20:45", "21:22:00", 
    "21:23:00", "21:23:13", "21:24:30", "21:24:40", "21:25:00", 
    "21:25:06", "21:25:40", "21:25:50", "21:26:00", "21:26:30", 
    "21:27:00", "21:27:05", "21:27:37", "21:28:00", "21:30:00"
    ), class = "factor"), Sky = structure(c(1L, 1L, 1L, 1L, 4L, 
    3L, 1L, 3L, 8L, 3L, 1L, 1L, 1L, 1L, 1L, 8L, 6L, 1L, 1L, 1L
    ), .Label = c("", "almost cloudless", "cloudless", "cloudy", 
    "cloudy (check time sunset)", "first cloudless, then partly cloudy", 
    "overcast", "partly cloudy", "partly cloudy horizon ", "very cloudy"
    ), class = "factor")), row.names = c(NA, 20L), class = "data.frame")

Looks strange to me :sweat_smile: , hope this output is what you are looking for?

Kind regards

What quantities do you want to plot and what kind plot do you want to make?

When you have a look at the dataframe I displayed above, you can See I have 4 columns named: Plot, Date, Sunset_Sunrise, Sky. Plot describes the place where all the data was collected, Date the date when the measurements were made, sunset_sunrise the timepoint when the sun rises or set for this day, sky includes information about the weather conditions.

I already made for each Plot (Place) and Year a ggplot out of another data frame. As described in the title I would like to add a geom_vline to this ggplots. The ggplot already has a x-axis scale in hours and minutes (intercept 5 min.)
Let`s assume the ggplot is named A, shows for the plot (place) ALP for 2021 specific values between 05:00 until 09:00, now I would like to add a geom_vline at 06:18:25. This information is stored in the data frame "times" (have a look above).

But it seems my data or example makes everything much more complicate, so I would like to ask my question more precise again. My question is basically: How can I add a geom_vline in ggplot, when the x-axis scale is specified in hours and minutes. We assume I would like to enter this value (06:18:25, in H:M:S) manually in the geom_vline function to keep it simple.

TX a lot!!!

I made a plot with the data you posted where the x axis is in H:M:S and I added a red vertical line. I used the hms package to change your Sunset_Sunrise column from a factor to a numeric difftime value which is easier to handle in plots. I also added a Dummy column for y values since none of the available columns was convenient for plotting a line plot. I hope this gets you started. If you are still stuck, please provide the specific ggplot code and data.

library(ggplot2)
library(hms)
DF <- structure(list(Plot = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 
                                  2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L), 
                                  .Label = c("ALP","BEA", "BET", "CEL", "CHI", "DAV", "ISO", 
                                             "JUS", "LAE", "LAU", "LEN", "NAT", "NEU", "NOV", 
                                             "OTH", "SCH", "VIS", "VOR"), class = "factor"), 
               Date = structure(c(88L, 60L, 9L, 2L, 49L, 50L, 75L, 61L, 
                                  35L, 90L, 54L, 87L, 3L, 94L, 30L, 13L, 47L, 14L, 79L, 86L
               ), .Label = c("01.07.21", "01.08.11", "02.07.01", "02.08.11", 
                             "02.08.21", "02.09.11", "03.05.96", "03.08.01", "03.08.04", 
                             "03.08.21", "04.06.96", "04.07.01", "04.07.11", "04.08.97", 
                             "05.07.21", "05.08.96", "06.07.01", "06.08.04", "06.08.21", 
                             "07.03.11", "08.04.97", "08.05.96", "08.07.11", "08.07.19", 
                             "08.07.97", "08.08.19", "09.07.13", "09.07.21", "09.07.97", 
                             "09.08.04", "09.08.11", "09.08.21", "10.03.11", "10.07.01", 
                             "10.07.21", "10.08.11", "10.08.21", "11.06.96", "11.07.04", 
                             "11.07.11", "11.07.21", "11.08.08", "11.08.11", "11.08.21", 
                             "12.07.04", "12.07.11", "12.07.21", "12.08.01", "12.08.11", 
                             "12.08.21", "13.07.04", "13.08.11", "13.08.19", "14.05.96", 
                             "14.08.21", "15.07.97", "15.08.01", "15.08.04", "15.08.96", 
                             "16.08.01", "16.08.11", "16.12.21", "17.08.04", "17.08.11", 
                             "18.08.11", "18.08.21", "19.08.21", "20.07.11", "21.07.01", 
                             "21.07.04", "21.07.97", "22.07.01", "22.07.04", "22.07.97", 
                             "22.08.01", "22.08.11", "23.07.96", "23.08.01", "24.07.01", 
                             "24.07.96", "25.06.21", "26.07.01", "27.06.11", "27.07.01", 
                             "28.06.11", "28.07.04", "28.07.97", "29.05.96", "29.07.04", 
                             "29.07.21", "29.08.11", "30.06.04", "30.08.04", "31.07.01", 
                             "31.07.21"), class = "factor"), 
               Sunset_Sunrise = structure(c(64L,35L, 49L, 7L, 41L, 13L, 30L, 36L, 77L, 57L, 54L, 62L, 1L, 
                                            8L, 47L, 88L, 3L, 45L, 4L, 52L), 
                                          .Label = c("", "05:33:52","05:45:00", "05:51:51", "06:00:00", "06:00:14", "06:05:00", 
                                                      "06:07:35", "06:09:00", "06:16:17", "06:17:09", "06:17:58", 
                                                      "06:18:25", "06:18:48", "06:19:03", "06:22:03", "06:23:00", 
                                                      "06:35:00", "06:36:00", "06:59:00", "16:49:23", "18:22:00", 
                                                      "19:57:00", "20:09:00", "20:10:52", "20:12:44", "20:15:17", 
                                                      "20:23:00", "20:24:00", "20:27:02", "20:29:10", "20:29:37", 
                                                      "20:34:00", "20:34:03", "20:34:31", "20:37:00", "20:38:00", 
                                                      "20:40:00", "20:40:03", "20:40:07", "20:41:00", "20:42:42", 
                                                      "20:43:00", "20:45:00", "20:47:22", "20:48:05", "20:51:17", 
                                                      "20:52:09", "20:54:00", "20:54:14", "20:54:15", "20:56:18", 
                                                      "20:57:00", "20:58:46", "21:01:49", "21:03:08", "21:04:00", 
                                                      "21:05:02", "21:07:00", "21:07:36", "21:08:51", "21:08:56", 
                                                      "21:09:50", "21:09:57", "21:10:06", "21:10:35", "21:11:39", 
                                                      "21:13:56", "21:14:44", "21:18:00", "21:18:32", "21:19:38", 
                                                      "21:19:55", "21:20:00", "21:20:05", "21:20:45", "21:22:00", 
                                                      "21:23:00", "21:23:13", "21:24:30", "21:24:40", "21:25:00", 
                                                      "21:25:06", "21:25:40", "21:25:50", "21:26:00", "21:26:30", 
                                                      "21:27:00", "21:27:05", "21:27:37", "21:28:00", "21:30:00"), 
                                          class = "factor"), 
               Sky = structure(c(1L, 1L, 1L, 1L, 4L,3L, 1L, 3L, 8L, 3L, 1L, 1L, 1L, 1L, 1L, 8L, 6L, 1L, 1L, 1L), 
                               .Label = c("", "almost cloudless", "cloudless", "cloudy", "cloudy (check time sunset)", 
                                          "first cloudless, then partly cloudy", 
                                        "overcast", "partly cloudy", "partly cloudy horizon ", "very cloudy"
                                        ), class = "factor")), row.names = c(NA, 20L), class = "data.frame")

#next 3 lines change Sunset_Sunrise to a numeric value
DF$Sunset_Sunrise <- as.character(DF$Sunset_Sunrise)

#as_hms does not like the row with the empty string, substitute with NA
DF$Sunset_Sunrise <- ifelse(DF$Sunset_Sunrise=="",NA,DF$Sunset_Sunrise)
DF$Sunset_Sunrise <- as_hms(DF$Sunset_Sunrise)
DF$Dummy <- 1:20 #added a column to use as the y axis values
ggplot(DF,aes(x=Sunset_Sunrise,y=Dummy)) + geom_line()+
  geom_vline(xintercept=as_hms("06:31:23"),color="red")
#> Warning: Removed 1 row(s) containing missing values (geom_path).

Created on 2022-01-09 by the reprex package (v2.0.1)

tx a lot so far! Now I got it, I should have changed the Sunset_Sunrise values into numeric values instead of date.

But I still get an error message, I guess it is because I use now as.POSIXct and as_hms for the same plot.... (Because the data is not public, I changed all the values)


#read in data with a specific value for the light conditions, we just need the row RawStart (timepoints of observation) and the V4 as our plotted Value on the second y-axis
df <- read.delim("210812_R.DAT", comment.char = "#", header = TRUE)
df <- df[-(1:6), ]
df <- subset(df, FILE == "A")
colnames(df) <- c("V1","V2","RawStart","V4","V5","V6","V7","V8")

# read in data with the plotted values on the left y-axis (LAI) also  RawStart gives us the correct timepoints 
DF <- read.delim("lai-ALP-2021.txt", comment.char = "#", header = TRUE)
DF <- DF[grep("4", DF$Records), ]
colnames(DF) <- c("LAI File","DATE","RawStart","RawStop","Resp1","Vegetationsquadrat","Records","TransComp","LAI","SEL","DIFN", "MTA", "EllipLAI", "EllipMTA")

#my bad solution to get along with date values..... 
DF$RawStart <- as.POSIXct(paste0("2021-12-16 ", DF$RawStart), tz = "GMT")
df$RawStart <- as.POSIXct(paste0("2021-12-16 ", df$RawStart), tz = "GMT")
df$V4 <- as.numeric(as.character(df$V4)) 


A <- ggplot(data = DF, aes(x= RawStart, y= LAI, group = Vegetationsquadrat, color = Vegetationsquadrat))+
  geom_line()+ geom_point()+ geom_text(label=DF$Vegetationsquadrat)+
  theme(axis.text.x = element_text(angle = 90, hjust = 1))+
  scale_x_datetime(date_labels = "%H:%M", date_breaks = "5 min")+
  xlab("Time")+
  theme(legend.position="bottom", legend.box = "horizontal")+
  ggtitle("ALP 2021")+theme(plot.title = element_text(hjust = 0.5))

A <- A + geom_line(data = df, aes(x=RawStart, y=V4/2, group=1), color = "black")+
  scale_y_continuous("LAI", limits = c(0,10), breaks = c(0,1,2,3,4,5,6,7,8,9,10), sec.axis = sec_axis(~ . * 2, name = "light"))

A + geom_vline(xintercept=as_hms("05:31:23"),color="red")

Sorry don't know how to upload the data so I post some lines

210812_R.DAT

FILE	DATE	TIME	WHAT   	WHERE  	LAI   	SEL	DIFN	MTA	SEM	SMP
2	20210812	04:41:29	REF ALP	ALP    	0.00	0.00	0.000	0.	0.	0

ANGLES	7.000	23.00	38.00	53.00	68.00
CNTCT#	0.000	0.000	0.000	0.000	0.000
STDDEV	0.000	0.000	0.000	0.000	0.000
DISTS 	1.008	1.087	1.270	1.662	2.670
GAPS  	0.000	0.000	0.000	0.000	0.000

A	  1	05:00:01	0.048	0.019	0.015	0.014	0.020
1	  2	05:00:01	0.000
A	  3	05:00:32	0.050	0.019	0.015	0.014	0.019
1	  4	05:00:32	5.0e-006
A	  5	05:01:02	0.050	0.020	0.015	0.014	0.020
1	  6	05:01:02	0.000
A	  7	05:01:35	0.043	0.018	0.014	0.013	0.384
1	  8	05:01:35	-5.0e-006
A	  9	05:02:01	0.048	0.018	0.014	0.014	0.018
1	 10	05:02:01	0.000
A	 11	05:02:32	0.048	0.019	0.014	0.014	0.019
1	 12	05:02:32	-5.0e-006
A	 13	05:03:02	0.045	0.019	0.014	0.014	0.019
1	 14	05:03:02	-5.0e-006
A	 15	05:03:32	0.048	0.019	0.014	0.014	0.018
1	 16	05:03:32	0.000
A	 17	05:04:02	0.045	0.019	0.014	0.014	0.018
1	 18	05:04:02	0.000
A	 19	05:04:32	0.048	0.019	0.014	0.013	0.019
1	 20	05:04:32	-5.0e-006
A	 21	05:05:02	0.048	0.019	0.014	0.014	0.019
1	 22	05:05:02	-5.0e-006
A	 23	05:05:32	0.045	0.018	0.014	0.014	0.018
1	 24	05:05:32	-5.0e-006
A	 25	05:06:02	0.048	0.018	0.014	0.014	0.018
1	 26	05:06:02	-5.0e-006
A	 27	05:06:32	0.045	0.018	0.014	0.013	0.018
1	 28	05:06:32	0.000
A	 29	05:07:01	0.045	0.018	0.014	0.013	0.019
1	 30	05:07:01	0.000
A	 31	05:07:32	0.048	0.018	0.014	0.014	0.019
1	 32	05:07:32	0.000
A	 33	05:08:02	0.048	0.020	0.014	0.014	0.019
1	 34	05:08:02	0.000
A	 35	05:08:32	0.048	0.019	0.014	0.014	0.019
1	 36	05:08:32	0.000
A	 37	05:09:02	0.045	0.019	0.015	0.014	0.018
1	 38	05:09:02	5.0e-006
A	 39	05:09:32	0.048	0.019	0.014	0.014	0.020
1	 40	05:09:32	5.0e-006
A	 41	05:10:02	0.048	0.019	0.014	0.014	0.019
1	 42	05:10:02	0.000
A	 43	05:10:32	0.048	0.019	0.014	0.013	0.019
1	 44	05:10:32	5.0e-006
A	 45	05:11:02	0.045	0.018	0.014	0.014	0.019
1	 46	05:11:02	5.0e-006
A	 47	05:11:32	0.048	0.019	0.015	0.013	0.019
1	 48	05:11:32	5.0e-006
A	 49	05:12:01	0.048	0.019	0.014	0.014	0.019
1	 50	05:12:01	-5.0e-006
A	 51	05:12:33	0.045	0.019	0.014	0.014	0.019
1	 52	05:12:33	-5.0e-006
A	 53	05:13:01	0.045	0.019	0.015	0.014	0.019
1	 54	05:13:01	0.000
A	 55	05:13:32	0.045	0.019	0.015	0.014	0.019
1	 56	05:13:32	-5.0e-006
A	 57	05:14:02	0.045	0.020	0.015	0.014	0.019
1	 58	05:14:02	0.000
A	 59	05:14:32	0.045	0.019	0.014	0.014	0.020
1	 60	05:14:32	-5.0e-006
A	 61	05:15:02	0.045	0.019	0.014	0.014	0.019
1	 62	05:15:02	-5.0e-006
A	 63	05:15:32	0.048	0.019	0.014	0.014	0.019
1	 64	05:15:32	0.000
A	 65	05:16:02	0.048	0.019	0.015	0.014	0.019
1	 66	05:16:02	0.000
A	 67	05:16:32	0.045	0.019	0.015	0.014	0.019
1	 68	05:16:32	-5.0e-006
A	 69	05:17:03	0.045	0.019	0.015	0.014	0.019
1	 70	05:17:03	-5.0e-006
A	 71	05:17:31	0.048	0.019	0.015	0.014	0.019
1	 72	05:17:31	0.000
A	 73	05:18:02	0.048	0.018	0.014	0.014	0.019
1	 74	05:18:02	0.000
A	 75	05:18:32	0.048	0.019	0.015	0.014	0.019
1	 76	05:18:32	-5.0e-006
A	 77	05:19:02	0.045	0.019	0.015	0.014	0.019
1	 78	05:19:02	0.000
A	 79	05:19:32	0.048	0.020	0.015	0.014	0.020
1	 80	05:19:32	0.000
A	 81	05:20:02	0.048	0.019	0.015	0.014	0.019
1	 82	05:20:02	0.000
A	 83	05:20:32	0.045	0.019	0.015	0.014	0.020
1	 84	05:20:32	0.000
A	 85	05:21:02	0.048	0.019	0.014	0.014	0.019
1	 86	05:21:02	-5.0e-006
A	 87	05:21:32	0.048	0.019	0.015	0.014	0.019
1	 88	05:21:32	0.000
A	 89	05:22:02	0.048	0.018	0.015	0.014	0.019
1	 90	05:22:02	0.000
A	 91	05:22:32	0.045	0.019	0.015	0.014	0.020
1	 92	05:22:32	0.000
A	 93	05:23:02	0.048	0.019	0.015	0.014	0.019
1	 94	05:23:02	-5.0e-006
A	 95	05:23:32	0.045	0.019	0.015	0.014	0.019
1	 96	05:23:32	0.000
A	 97	05:24:02	0.048	0.019	0.015	0.014	0.019
1	 98	05:24:02	0.000
A	 99	05:24:32	0.048	0.019	0.015	0.014	0.020
1	100	05:24:32	-5.0e-006
A	101	05:25:02	0.045	0.019	0.015	0.014	0.019
1	102	05:25:02	0.000
A	103	05:25:32	0.045	0.020	0.015	0.014	0.020
1	104	05:25:32	0.000
A	105	05:26:02	0.045	0.020	0.015	0.014	0.020
1	106	05:26:02	0.000
A	107	05:26:32	0.048	0.020	0.015	0.015	0.019
1	108	05:26:32	0.000
A	109	05:27:01	0.048	0.019	0.015	0.015	0.019
1	110	05:27:01	0.000
A	111	05:27:32	0.048	0.019	0.015	0.015	0.020
1	112	05:27:32	-5.0e-006
A	113	05:28:02	0.048	0.020	0.015	0.015	0.020
1	114	05:28:02	0.000
A	115	05:28:32	0.048	0.021	0.015	0.014	0.020
1	116	05:28:32	-5.0e-006
A	117	05:29:02	0.048	0.021	0.015	0.015	0.021
1	118	05:29:02	-5.0e-006
A	119	05:29:32	0.048	0.020	0.015	0.016	0.021
1	120	05:29:32	0.000
A	121	05:30:02	0.050	0.020	0.015	0.015	0.020
1	122	05:30:02	0.000
A	123	05:30:32	0.045	0.021	0.015	0.016	0.019
1	124	05:30:32	-5.0e-006
A	125	05:31:02	0.045	0.021	0.017	0.016	0.022
1	126	05:31:02	-5.0e-006
A	127	05:31:32	0.050	0.019	0.014	0.016	0.021
1	128	05:31:32	-5.0e-006
A	129	05:32:01	0.055	0.024	0.017	0.018	0.025
1	130	05:32:01	0.000
A	131	05:32:32	0.058	0.024	0.018	0.017	0.024
1	132	05:32:32	-5.0e-006
A	133	05:33:02	0.058	0.023	0.018	0.018	0.024
1	134	05:33:02	-5.0e-006
A	135	05:33:32	0.055	0.024	0.018	0.019	0.023
1	136	05:33:32	0.000
A	137	05:34:02	0.058	0.022	0.018	0.019	0.024
1	138	05:34:02	-5.0e-006
A	139	05:34:32	0.055	0.024	0.018	0.019	0.023
1	140	05:34:32	-5.0e-006
A	141	05:35:02	0.055	0.025	0.018	0.020	0.023
1	142	05:35:02	-5.0e-006
A	143	05:35:32	0.058	0.024	0.020	0.020	0.024
1	144	05:35:32	-5.0e-006
A	145	05:36:02	0.055	0.025	0.020	0.020	0.024
1	146	05:36:02	-5.0e-006
A	147	05:36:32	0.058	0.025	0.020	0.020	0.025
1	148	05:36:32	0.000
A	149	05:37:01	0.050	0.022	0.018	0.020	0.023
1	150	05:37:01	0.000
A	151	05:37:32	0.050	0.023	0.018	0.019	0.023
1	152	05:37:32	-5.0e-006
A	153	05:38:02	0.053	0.023	0.020	0.020	0.023
1	154	05:38:02	0.000
A	155	05:38:32	0.050	0.024	0.020	0.020	0.023
1	156	05:38:32	0.000
A	157	05:39:02	0.053	0.024	0.020	0.021	0.024
1	158	05:39:02	0.000
A	159	05:39:32	0.050	0.024	0.020	0.022	0.023
1	160	05:39:32	-5.0e-006
A	161	05:40:02	0.053	0.025	0.022	0.023	0.024
1	162	05:40:02	0.000
A	163	05:40:32	0.053	0.025	0.022	0.024	0.025
1	164	05:40:32	-5.0e-006
A	165	05:41:02	0.053	0.026	0.023	0.024	0.026
1	166	05:41:02	-5.0e-006
A	167	05:41:32	0.053	0.027	0.024	0.025	0.026
1	168	05:41:32	0.000
A	169	05:42:03	0.058	0.029	0.026	0.027	0.027
1	170	05:42:03	0.000
A	171	05:42:32	0.060	0.030	0.026	0.028	0.027
1	172	05:42:32	-5.0e-006
A	173	05:43:02	0.058	0.030	0.028	0.029	0.029
1	174	05:43:02	-5.0e-006
A	175	05:43:32	0.060	0.031	0.029	0.031	0.030
1	176	05:43:32	-5.0e-006
A	177	05:44:02	0.060	0.032	0.030	0.032	0.031
1	178	05:44:02	-5.0e-006
A	179	05:44:32	0.063	0.034	0.031	0.034	0.031
1	180	05:44:32	-5.0e-006
A	181	05:45:02	0.063	0.034	0.033	0.036	0.033
1	182	05:45:02	0.000
A	183	05:45:32	0.063	0.036	0.035	0.038	0.033
1	184	05:45:32	-5.0e-006
A	185	05:46:02	0.065	0.038	0.036	0.040	0.035
1	186	05:46:02	0.000

lai-ALP-2021.txt

LAI_File	Date	RawStart	RawStop	Resp1	Resp2	Records	TransComp	LAI	SEL	DIFN	MTA	EllipLAI	EllipMTA
47	20210812 05:30:47	05:31:02	05:31:07	VEG ALP	A1	4A 4B 	a-c-s	2	1	1	1	1	1
48	20210812 05:36:33	05:36:32	05:36:46	VEG ALP	A2	4A 4B 	a-c-s	3	1	1	1	1	1
49	20210812 05:39:53	05:40:02	05:40:07	VEG ALP	A3	4A 4B 	a-c-s	2	1	1	1	1	1
50	20210812 05:43:26	05:43:32	05:43:43	Veg  ALP	A4	4A 4B 	a-c-s	2	1	1	1	1	1
51	20210812 05:45:26	05:45:32	05:46:02	Veg ALP	B4	4A 4B 	a-c-s	3	1	1	1	1	1
52	20210812 05:48:18	05:48:28	05:48:33	Veg ALP	B3	4A 4B 	a-c-s	3	1	1	1	1	1    

Again tx a lot!!!

If your x axis has POSIXct values, then it is not in units of time-of-day but in seconds since 1970-01-01 00:00:00. To place a vertical line on that axis, you have to define both the day and the time. You can do this with as.POSIXct().


A + geom_vline(xintercept=as.POSIXct("2021-12-16 05:31:23", tz = "GMT"),color="red")

@FJCC Ufff you are right!!! I am soo stupid, I tried as.POSIXct but forgot about the year :sweat_smile: :sweat_smile:

You are my hero :raised_hand: Tx a lot

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.