@@ -116,7 +116,7 @@ plot.vpi <- function(x, quantity = "mtr", xlab = "time",
116
116
117
117
# plot the data
118
118
plot(x $ datetime , x [quantity ][[1 ]],
119
- type = " l" , xlab = " time " , ylab = ylab ,
119
+ type = " l" , xlab = xlab , ylab = ylab ,
120
120
ylim = ylim , main = main , xaxs = " i" , yaxs = " i" , ...
121
121
)
122
122
@@ -145,8 +145,8 @@ plot.vpi <- function(x, quantity = "mtr", xlab = "time",
145
145
# determine the plot range of the night time shading
146
146
if (missing(ylim )) {
147
147
pol.range <- c(
148
- min(c(0 , 2 * min(x [quantity ][[1 ]]))),
149
- 2 * max(x [quantity ][[1 ]])
148
+ min(c(0 , 2 * min(x [quantity ][[1 ]], na.rm = TRUE ))),
149
+ 2 * max(x [quantity ][[1 ]], na.rm = TRUE )
150
150
)
151
151
} else {
152
152
pol.range <- ylim
@@ -167,7 +167,7 @@ plot.vpi <- function(x, quantity = "mtr", xlab = "time",
167
167
# plot the data again on top of the shading
168
168
graphics :: points(x $ datetime , x [quantity ][[1 ]],
169
169
type = " l" ,
170
- xlab = " time " , ylab = ylab , ylim = ylim , main = main , ...
170
+ xlab = xlab , ylab = ylab , ylim = ylim , main = main , ...
171
171
)
172
172
}
173
173
}
0 commit comments