-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retaining columns with track_resample #121
Comments
Not sure I fully understand the questions. See the example below, what am I missing? library(amt)
#>
#> Attaching package: 'amt'
#> The following object is masked from 'package:stats':
#>
#> filter
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
dat <- data.frame(x = runif(10), y = runif(10),
id = 1, id1 = 2, id3 = 3,
t = now() + hours(0:9))
tr <- make_track(dat, x, y, t, all_cols = TRUE)
tr |> track_resample(rate = hours(2), tolerance = minutes(5))
#> # A tibble: 5 × 7
#> x_ y_ t_ id id1 id3 burst_
#> * <dbl> <dbl> <dttm> <dbl> <dbl> <dbl> <dbl>
#> 1 0.201 0.843 2024-10-30 19:43:17 1 2 3 1
#> 2 0.394 0.0112 2024-10-30 21:43:17 1 2 3 1
#> 3 0.305 0.199 2024-10-30 23:43:17 1 2 3 1
#> 4 0.154 0.507 2024-10-31 01:43:17 1 2 3 1
#> 5 0.638 0.129 2024-10-31 03:43:17 1 2 3 1 Created on 2024-10-30 with reprex v2.1.0 |
Many thanks for your response and sorry about the confusion. Is there a way
to retain unique ID columns when using steps_by_burst? I need them for
subsequent steps.
…On Thu, 31 Oct 2024 at 05:44, Johannes Signer ***@***.***> wrote:
Not sure I fully understand the questions. See the example below, what am
I missing?
library(amt)#> #> Attaching package: 'amt'#> The following object is masked from 'package:stats':#> #> filter
library(lubridate)#> #> Attaching package: 'lubridate'#> The following objects are masked from 'package:base':#> #> date, intersect, setdiff, union
dat <- data.frame(x = runif(10), y = runif(10),
id = 1, id1 = 2, id3 = 3,
t = now() + hours(0:9))
tr <- make_track(dat, x, y, t, all_cols = TRUE)tr |> track_resample(rate = hours(2), tolerance = minutes(5))#> # A tibble: 5 × 7#> x_ y_ t_ id id1 id3 burst_#> * <dbl> <dbl> <dttm> <dbl> <dbl> <dbl> <dbl>#> 1 0.201 0.843 2024-10-30 19:43:17 1 2 3 1#> 2 0.394 0.0112 2024-10-30 21:43:17 1 2 3 1#> 3 0.305 0.199 2024-10-30 23:43:17 1 2 3 1#> 4 0.154 0.507 2024-10-31 01:43:17 1 2 3 1#> 5 0.638 0.129 2024-10-31 03:43:17 1 2 3 1
Created on 2024-10-30 with reprex v2.1.0 <https://reprex.tidyverse.org>
—
Reply to this email directly, view it on GitHub
<#121 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMRDVXFOTEMIAVU46S36JZTZ6ESI3AVCNFSM6AAAAABQ3L3UZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBYGA3TCMZXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You can use the argument
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a couple of ID columns in my track (from make_track) that I would like retain in the subsequent step, i.e., track_resample. I want to use the ID columns to join some covariate information to the matched/random steps layer at a later stage. But track_resample removes those columns. How can I transfer these columns to my resampled track?
The text was updated successfully, but these errors were encountered: