Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
onlineforecast
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
packages
onlineforecast
Commits
6a13d75e
Commit
6a13d75e
authored
4 years ago
by
Bubbi12
Browse files
Options
Downloads
Patches
Plain Diff
in_range function updated. Now it is possible to specify timezone for the ct function
parent
93f0ccae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/in_range.R
+7
-2
7 additions, 2 deletions
R/in_range.R
testfile.txt
+0
-1
0 additions, 1 deletion
testfile.txt
with
7 additions
and
3 deletions
R/in_range.R
+
7
−
2
View file @
6a13d75e
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#' @param tstart The start of the period.
#' @param tstart The start of the period.
#' @param time The timestamps as POSIX.
#' @param time The timestamps as POSIX.
#' @param tend The end of the period. If not given then the period will have no end.
#' @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
#' @return A logical vector indicating the selected period with TRUE
#' @name in_range
#' @name in_range
#' @examples
#' @examples
...
@@ -46,12 +47,16 @@
...
@@ -46,12 +47,16 @@
#'
#'
#' @export
#' @export
in_range
<-
function
(
tstart
,
time
,
tend
=
NA
)
{
in_range
<-
function
(
tstart
,
time
,
tend
=
NA
,
timezone
=
NA
)
{
if
(
class
(
tstart
)[
1
]
==
"character"
)
if
(
class
(
tstart
)[
1
]
==
"character"
)
tstart
<-
ct
(
tstart
)
tstart
<-
ct
(
tstart
)
if
(
is.na
(
tend
))
if
(
is.na
(
tend
))
tend
<-
time
[
length
(
time
)]
tend
<-
time
[
length
(
time
)]
if
(
class
(
tend
)[
1
]
==
"character"
)
if
(
class
(
tend
)[
1
]
==
"character"
)
tend
<-
ct
(
tend
)
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
)
}
}
This diff is collapsed.
Click to expand it.
testfile.txt
deleted
100644 → 0
+
0
−
1
View file @
93f0ccae
Testing
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment