How to add a column containing the date of 2019 to a dataset?How to make a great R reproducible exampleHow to create a range of dates in RHow to sort a dataframe by multiple column(s)How to rename a single column in a data.frame?Subsetting dataset for weekday and weekend and calculating sum of columnsHow to customize axis when plot multiple time series data in 1 panel?how to transfer ts into data.frame?aggregate data in irregular groups in r (any better title?)Using an ordered list to control display control display of points in R's GGPLOT2, such as days of the weekpercentage plot when a column has specific valueHow do I change the english weekday abbreviation?Making barchart in R Programming using specific rows from csv file

What is the purpose of the rotating plate in front of the lock?

PDB file downloading: pymol automation vs. manual

Extra arrow heads appearing tikz

PWM on 5V GPIO pin

What can we do about our 9-month-old putting fingers down his throat?

Did "Dirty Harry" feel lucky?

The meaning of "offing" in "an agreement in the offing"

I multiply the source, you (probably) multiply the output!

I need to know information from an old German birth certificate

Dragons and gems

Proof for integral representation of Lambert W function

Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?

How to plot two curves with the same area under?

How do English-speaking kids loudly request something?

Why did Tony's Arc Reactor do this?

Owner keeps cutting corners and poaching workers for his other company

Could someone please explain what this inline #define assembly is doing?

Would scoring well on a non-required GRE Mathematics Subject Test make me more competitive?

Python implementation of atoi

Leaving the USA for 10 yrs when you have asylum

Electric shock from pedals and guitar. Jacks too long?

Why does 8 bit truecolor use only 2 bits for blue?

Is there a "right" way to interpret a novel, if not, how do we make sure our novel is interpreted correctly?

Why do the Brexit opposition parties not want a new election?



How to add a column containing the date of 2019 to a dataset?


How to make a great R reproducible exampleHow to create a range of dates in RHow to sort a dataframe by multiple column(s)How to rename a single column in a data.frame?Subsetting dataset for weekday and weekend and calculating sum of columnsHow to customize axis when plot multiple time series data in 1 panel?how to transfer ts into data.frame?aggregate data in irregular groups in r (any better title?)Using an ordered list to control display control display of points in R's GGPLOT2, such as days of the weekpercentage plot when a column has specific valueHow do I change the english weekday abbreviation?Making barchart in R Programming using specific rows from csv file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to predict the number of flights for 2019 per day. I already have a model to but I need to apply it for the 2019 data. So I may need to add a column contains the date for 2019 to the original data set.



I tried to create_series(), but it can't be mutated to the original data set.




Error in mutate_impl(.data, dots) :
Column "date_2019" is of unsupported class data.frame




f2019 <- create_series(~'2019', 'daily')
flight2019 <- daily %>%
mutate(date(f2019))


I also tried data$,



daily$date2019 <- create_series(~'2019', 'daily')


but the value is not normal.



date2019
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>


I think the problem is in create_series(), maybe I should use other function to create date variable. I except the daily has a column contains each date in 2019.
i.e,



2019-01-01
2019-01-02
...


or replace the date of daily with 2019's date. (Original date is 2013 in daily)



the data set is following:



# A tibble: 365 x 13
date n wday term residual_wday1 wday2 wday3
<date> <int> <ord> <fct> <dbl> <chr> <chr>
1 2013-01-01 842 Tue wint~ -56.3 Tue Tue
2 2013-01-02 943 Wed wint~ 25.7 Wed Wed
3 2013-01-03 914 Thu wint~ -23.7 Thu Thu
4 2013-01-04 915 Fri wint~ -17.2 Fri Fri
5 2013-01-05 720 Sat wint~ 18.6 Sat-~ Sat-~
6 2013-01-06 832 Sun wint~ 2 Sun Sun
7 2013-01-07 933 Mon wint~ -0.25 Mon Mon
8 2013-01-08 899 Tue wint~ 0.667 Tue Tue
9 2013-01-09 902 Wed wint~ -15.3 Wed Wed
10 2013-01-10 932 Thu wint~ -5.67 Thu Thu
# ... with 355 more rows, and 6 more variables:









share|improve this question


























  • Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

    – heck1
    Mar 28 at 6:53











  • Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

    – dayucpbx7
    Mar 28 at 7:02











  • OK, I add it in the post.

    – dayucpbx7
    Mar 28 at 7:16











  • please try adding the contents of dput(head(<yourData>)) to your question.

    – heck1
    Mar 28 at 7:19











  • I edited it, is that OK?

    – dayucpbx7
    Mar 28 at 7:21

















0















I need to predict the number of flights for 2019 per day. I already have a model to but I need to apply it for the 2019 data. So I may need to add a column contains the date for 2019 to the original data set.



I tried to create_series(), but it can't be mutated to the original data set.




Error in mutate_impl(.data, dots) :
Column "date_2019" is of unsupported class data.frame




f2019 <- create_series(~'2019', 'daily')
flight2019 <- daily %>%
mutate(date(f2019))


I also tried data$,



daily$date2019 <- create_series(~'2019', 'daily')


but the value is not normal.



date2019
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>


I think the problem is in create_series(), maybe I should use other function to create date variable. I except the daily has a column contains each date in 2019.
i.e,



2019-01-01
2019-01-02
...


or replace the date of daily with 2019's date. (Original date is 2013 in daily)



the data set is following:



# A tibble: 365 x 13
date n wday term residual_wday1 wday2 wday3
<date> <int> <ord> <fct> <dbl> <chr> <chr>
1 2013-01-01 842 Tue wint~ -56.3 Tue Tue
2 2013-01-02 943 Wed wint~ 25.7 Wed Wed
3 2013-01-03 914 Thu wint~ -23.7 Thu Thu
4 2013-01-04 915 Fri wint~ -17.2 Fri Fri
5 2013-01-05 720 Sat wint~ 18.6 Sat-~ Sat-~
6 2013-01-06 832 Sun wint~ 2 Sun Sun
7 2013-01-07 933 Mon wint~ -0.25 Mon Mon
8 2013-01-08 899 Tue wint~ 0.667 Tue Tue
9 2013-01-09 902 Wed wint~ -15.3 Wed Wed
10 2013-01-10 932 Thu wint~ -5.67 Thu Thu
# ... with 355 more rows, and 6 more variables:









share|improve this question


























  • Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

    – heck1
    Mar 28 at 6:53











  • Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

    – dayucpbx7
    Mar 28 at 7:02











  • OK, I add it in the post.

    – dayucpbx7
    Mar 28 at 7:16











  • please try adding the contents of dput(head(<yourData>)) to your question.

    – heck1
    Mar 28 at 7:19











  • I edited it, is that OK?

    – dayucpbx7
    Mar 28 at 7:21













0












0








0








I need to predict the number of flights for 2019 per day. I already have a model to but I need to apply it for the 2019 data. So I may need to add a column contains the date for 2019 to the original data set.



I tried to create_series(), but it can't be mutated to the original data set.




Error in mutate_impl(.data, dots) :
Column "date_2019" is of unsupported class data.frame




f2019 <- create_series(~'2019', 'daily')
flight2019 <- daily %>%
mutate(date(f2019))


I also tried data$,



daily$date2019 <- create_series(~'2019', 'daily')


but the value is not normal.



date2019
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>


I think the problem is in create_series(), maybe I should use other function to create date variable. I except the daily has a column contains each date in 2019.
i.e,



2019-01-01
2019-01-02
...


or replace the date of daily with 2019's date. (Original date is 2013 in daily)



the data set is following:



# A tibble: 365 x 13
date n wday term residual_wday1 wday2 wday3
<date> <int> <ord> <fct> <dbl> <chr> <chr>
1 2013-01-01 842 Tue wint~ -56.3 Tue Tue
2 2013-01-02 943 Wed wint~ 25.7 Wed Wed
3 2013-01-03 914 Thu wint~ -23.7 Thu Thu
4 2013-01-04 915 Fri wint~ -17.2 Fri Fri
5 2013-01-05 720 Sat wint~ 18.6 Sat-~ Sat-~
6 2013-01-06 832 Sun wint~ 2 Sun Sun
7 2013-01-07 933 Mon wint~ -0.25 Mon Mon
8 2013-01-08 899 Tue wint~ 0.667 Tue Tue
9 2013-01-09 902 Wed wint~ -15.3 Wed Wed
10 2013-01-10 932 Thu wint~ -5.67 Thu Thu
# ... with 355 more rows, and 6 more variables:









share|improve this question
















I need to predict the number of flights for 2019 per day. I already have a model to but I need to apply it for the 2019 data. So I may need to add a column contains the date for 2019 to the original data set.



I tried to create_series(), but it can't be mutated to the original data set.




Error in mutate_impl(.data, dots) :
Column "date_2019" is of unsupported class data.frame




f2019 <- create_series(~'2019', 'daily')
flight2019 <- daily %>%
mutate(date(f2019))


I also tried data$,



daily$date2019 <- create_series(~'2019', 'daily')


but the value is not normal.



date2019
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>
<S3: tbl_time>


I think the problem is in create_series(), maybe I should use other function to create date variable. I except the daily has a column contains each date in 2019.
i.e,



2019-01-01
2019-01-02
...


or replace the date of daily with 2019's date. (Original date is 2013 in daily)



the data set is following:



# A tibble: 365 x 13
date n wday term residual_wday1 wday2 wday3
<date> <int> <ord> <fct> <dbl> <chr> <chr>
1 2013-01-01 842 Tue wint~ -56.3 Tue Tue
2 2013-01-02 943 Wed wint~ 25.7 Wed Wed
3 2013-01-03 914 Thu wint~ -23.7 Thu Thu
4 2013-01-04 915 Fri wint~ -17.2 Fri Fri
5 2013-01-05 720 Sat wint~ 18.6 Sat-~ Sat-~
6 2013-01-06 832 Sun wint~ 2 Sun Sun
7 2013-01-07 933 Mon wint~ -0.25 Mon Mon
8 2013-01-08 899 Tue wint~ 0.667 Tue Tue
9 2013-01-09 902 Wed wint~ -15.3 Wed Wed
10 2013-01-10 932 Thu wint~ -5.67 Thu Thu
# ... with 355 more rows, and 6 more variables:






r






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 7:20







dayucpbx7

















asked Mar 28 at 6:50









dayucpbx7dayucpbx7

53 bronze badges




53 bronze badges















  • Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

    – heck1
    Mar 28 at 6:53











  • Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

    – dayucpbx7
    Mar 28 at 7:02











  • OK, I add it in the post.

    – dayucpbx7
    Mar 28 at 7:16











  • please try adding the contents of dput(head(<yourData>)) to your question.

    – heck1
    Mar 28 at 7:19











  • I edited it, is that OK?

    – dayucpbx7
    Mar 28 at 7:21

















  • Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

    – heck1
    Mar 28 at 6:53











  • Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

    – dayucpbx7
    Mar 28 at 7:02











  • OK, I add it in the post.

    – dayucpbx7
    Mar 28 at 7:16











  • please try adding the contents of dput(head(<yourData>)) to your question.

    – heck1
    Mar 28 at 7:19











  • I edited it, is that OK?

    – dayucpbx7
    Mar 28 at 7:21
















Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

– heck1
Mar 28 at 6:53





Welcome to Stack Overflow! Your question is precise, but in order for us to understand and solve it, it is necessary that you provide some sample data. There are several ways to provide data, probably adding the output of dput(<yourData>) or dput(head(<yourData>)) to your question is sufficient. Avoid adding code or alphanumeric output as images. Consider how to make a good example: stackoverflow.com/questions/5963269/… and see how you can change your question accordingly.

– heck1
Mar 28 at 6:53













Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

– dayucpbx7
Mar 28 at 7:02





Thank you so much! It's my first time to use stack overflow! I will pay attention to this in the future.

– dayucpbx7
Mar 28 at 7:02













OK, I add it in the post.

– dayucpbx7
Mar 28 at 7:16





OK, I add it in the post.

– dayucpbx7
Mar 28 at 7:16













please try adding the contents of dput(head(<yourData>)) to your question.

– heck1
Mar 28 at 7:19





please try adding the contents of dput(head(<yourData>)) to your question.

– heck1
Mar 28 at 7:19













I edited it, is that OK?

– dayucpbx7
Mar 28 at 7:21





I edited it, is that OK?

– dayucpbx7
Mar 28 at 7:21












1 Answer
1






active

oldest

votes


















0
















have you seen this post:
How to create a range of dates in R



and function: seq(as.Date("2014/09/04"), by = "day", length.out = 5)



then you can just add new rows with function rbind()






share|improve this answer
























    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/4.0/"u003ecc by-sa 4.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
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391685%2fhow-to-add-a-column-containing-the-date-of-2019-to-a-dataset%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0
















    have you seen this post:
    How to create a range of dates in R



    and function: seq(as.Date("2014/09/04"), by = "day", length.out = 5)



    then you can just add new rows with function rbind()






    share|improve this answer





























      0
















      have you seen this post:
      How to create a range of dates in R



      and function: seq(as.Date("2014/09/04"), by = "day", length.out = 5)



      then you can just add new rows with function rbind()






      share|improve this answer



























        0














        0










        0









        have you seen this post:
        How to create a range of dates in R



        and function: seq(as.Date("2014/09/04"), by = "day", length.out = 5)



        then you can just add new rows with function rbind()






        share|improve this answer













        have you seen this post:
        How to create a range of dates in R



        and function: seq(as.Date("2014/09/04"), by = "day", length.out = 5)



        then you can just add new rows with function rbind()







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 9:05









        Luke ChodzacyponiebieLuke Chodzacyponiebie

        162 bronze badges




        162 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391685%2fhow-to-add-a-column-containing-the-date-of-2019-to-a-dataset%23new-answer', 'question_page');

            );

            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현