Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
packages
onlineforecast
Commits
6a13d75e
Commit
6a13d75e
authored
Oct 11, 2020
by
Bubbi12
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in_range function updated. Now it is possible to specify timezone for the ct function
parent
93f0ccae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
R/in_range.R
R/in_range.R
+7
-2
testfile.txt
testfile.txt
+0
-1
No files found.
R/in_range.R
View file @
6a13d75e
...
...
@@ -19,6 +19,7 @@
#' @param tstart The start of the period.
#' @param time The timestamps as POSIX.
#' @param tend The end of the period. If not given then the period will have no end.
#' @param timezone The timezone of the timestamps, time.
#' @return A logical vector indicating the selected period with TRUE
#' @name in_range
#' @examples
...
...
@@ -46,12 +47,16 @@
#'
#' @export
in_range
<-
function
(
tstart
,
time
,
tend
=
NA
)
{
in_range
<-
function
(
tstart
,
time
,
tend
=
NA
,
timezone
=
NA
)
{
if
(
class
(
tstart
)[
1
]
==
"character"
)
tstart
<-
ct
(
tstart
)
if
(
is.na
(
tend
))
tend
<-
time
[
length
(
time
)]
if
(
class
(
tend
)[
1
]
==
"character"
)
tend
<-
ct
(
tend
)
ct
(
tstart
)
<
time
&
time
<=
ct
(
tend
)
if
(
is.na
(
timezone
)){
timezone
<-
attr
(
D
$
t
,
"tzone"
)
}
ct
(
tstart
,
tz
=
timezone
)
<
time
&
time
<=
ct
(
tend
,
tz
=
timezone
)
}
testfile.txt
deleted
100644 → 0
View file @
93f0ccae
Testing
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment