as_tsibble(id(), index ()) setting Error in .f(.x[[i]], …) : object 'xxx' not found
I am learning using tsibble and fable to do forecasting.
first difficulty here is trying to reform my dataset into tsibble formate by using
as_tsibble(
key=id (product |cate, store), index= date)
(I am following the video called:tsibble: Tidy data structures to support exploration and modeling of temporal-context data, on youtube)
but, I got the error:
Error in .f(.x[[i]], ...) : object 'product' not found
I do have the product column in my dataset: here are my code for your info
safe_div <- function(upr, lwr) if_else(lwr == 0, 0, upr/lwr)
df_s <- df %>%
select(date=Datum, store=ButiN, cate=KategoriNM, product=PluId, quan=Styck, sales=Sales) %>%
mutate(price= round(safe_div(sales,quan), 2)) %>%
as_tibble()
df_s %>% as_tsibble(
key=id (product |cate, store), index= date)
not sure where I get wrong. any suggestion will be appriciated
here is the screeshot of df_s dataset for your info
r tidyverse
|
show 2 more comments
I am learning using tsibble and fable to do forecasting.
first difficulty here is trying to reform my dataset into tsibble formate by using
as_tsibble(
key=id (product |cate, store), index= date)
(I am following the video called:tsibble: Tidy data structures to support exploration and modeling of temporal-context data, on youtube)
but, I got the error:
Error in .f(.x[[i]], ...) : object 'product' not found
I do have the product column in my dataset: here are my code for your info
safe_div <- function(upr, lwr) if_else(lwr == 0, 0, upr/lwr)
df_s <- df %>%
select(date=Datum, store=ButiN, cate=KategoriNM, product=PluId, quan=Styck, sales=Sales) %>%
mutate(price= round(safe_div(sales,quan), 2)) %>%
as_tibble()
df_s %>% as_tsibble(
key=id (product |cate, store), index= date)
not sure where I get wrong. any suggestion will be appriciated
here is the screeshot of df_s dataset for your info
r tidyverse
Please show a small reproducible example withdput
– akrun
Jan 1 at 11:03
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
Do you know iftsibble
uses|
,,
to separate the variables. Check ifdf_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
1
Its okay. My doubt is with the usage ofas_tsibble
. I checked the documentation, couldn't find the way in which you used|
and,
– akrun
Jan 1 at 11:12
1
The nesting operator|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.
– Earo Wang
Jan 3 at 2:39
|
show 2 more comments
I am learning using tsibble and fable to do forecasting.
first difficulty here is trying to reform my dataset into tsibble formate by using
as_tsibble(
key=id (product |cate, store), index= date)
(I am following the video called:tsibble: Tidy data structures to support exploration and modeling of temporal-context data, on youtube)
but, I got the error:
Error in .f(.x[[i]], ...) : object 'product' not found
I do have the product column in my dataset: here are my code for your info
safe_div <- function(upr, lwr) if_else(lwr == 0, 0, upr/lwr)
df_s <- df %>%
select(date=Datum, store=ButiN, cate=KategoriNM, product=PluId, quan=Styck, sales=Sales) %>%
mutate(price= round(safe_div(sales,quan), 2)) %>%
as_tibble()
df_s %>% as_tsibble(
key=id (product |cate, store), index= date)
not sure where I get wrong. any suggestion will be appriciated
here is the screeshot of df_s dataset for your info
r tidyverse
I am learning using tsibble and fable to do forecasting.
first difficulty here is trying to reform my dataset into tsibble formate by using
as_tsibble(
key=id (product |cate, store), index= date)
(I am following the video called:tsibble: Tidy data structures to support exploration and modeling of temporal-context data, on youtube)
but, I got the error:
Error in .f(.x[[i]], ...) : object 'product' not found
I do have the product column in my dataset: here are my code for your info
safe_div <- function(upr, lwr) if_else(lwr == 0, 0, upr/lwr)
df_s <- df %>%
select(date=Datum, store=ButiN, cate=KategoriNM, product=PluId, quan=Styck, sales=Sales) %>%
mutate(price= round(safe_div(sales,quan), 2)) %>%
as_tibble()
df_s %>% as_tsibble(
key=id (product |cate, store), index= date)
not sure where I get wrong. any suggestion will be appriciated
here is the screeshot of df_s dataset for your info
r tidyverse
r tidyverse
edited Jan 1 at 12:22
NelsonGon
2,7803729
2,7803729
asked Jan 1 at 11:02
user7694774user7694774
514
514
Please show a small reproducible example withdput
– akrun
Jan 1 at 11:03
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
Do you know iftsibble
uses|
,,
to separate the variables. Check ifdf_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
1
Its okay. My doubt is with the usage ofas_tsibble
. I checked the documentation, couldn't find the way in which you used|
and,
– akrun
Jan 1 at 11:12
1
The nesting operator|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.
– Earo Wang
Jan 3 at 2:39
|
show 2 more comments
Please show a small reproducible example withdput
– akrun
Jan 1 at 11:03
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
Do you know iftsibble
uses|
,,
to separate the variables. Check ifdf_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
1
Its okay. My doubt is with the usage ofas_tsibble
. I checked the documentation, couldn't find the way in which you used|
and,
– akrun
Jan 1 at 11:12
1
The nesting operator|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.
– Earo Wang
Jan 3 at 2:39
Please show a small reproducible example with
dput
– akrun
Jan 1 at 11:03
Please show a small reproducible example with
dput
– akrun
Jan 1 at 11:03
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
Do you know if
tsibble
uses |
, ,
to separate the variables. Check if df_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
Do you know if
tsibble
uses |
, ,
to separate the variables. Check if df_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
1
1
Its okay. My doubt is with the usage of
as_tsibble
. I checked the documentation, couldn't find the way in which you used |
and ,
– akrun
Jan 1 at 11:12
Its okay. My doubt is with the usage of
as_tsibble
. I checked the documentation, couldn't find the way in which you used |
and ,
– akrun
Jan 1 at 11:12
1
1
The nesting operator
|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.– Earo Wang
Jan 3 at 2:39
The nesting operator
|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.– Earo Wang
Jan 3 at 2:39
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994923%2fas-tsibbleid-index-setting-error-in-f-xi-object-xxx-not%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994923%2fas-tsibbleid-index-setting-error-in-f-xi-object-xxx-not%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please show a small reproducible example with
dput
– akrun
Jan 1 at 11:03
if i run df_s %>% as_tsibble( key=id (product, store), index= date) . , seems work(which means I can not indicate the product under the category hierarchy )
– user7694774
Jan 1 at 11:04
Do you know if
tsibble
uses|
,,
to separate the variables. Check ifdf_s %>% as_tsibble(key = id(product), index = date)
– akrun
Jan 1 at 11:07
1
Its okay. My doubt is with the usage of
as_tsibble
. I checked the documentation, couldn't find the way in which you used|
and,
– akrun
Jan 1 at 11:12
1
The nesting operator
|
has been removed from the key specification since v0.6.0. We think that the nesting and crossing is more suitable for the forecasting reconciliation stage.– Earo Wang
Jan 3 at 2:39