seq() with multiple increments











up vote
0
down vote

favorite












I'd like to create a sequence with three different increements. From 6 to 15 for example an increment of 0.7 . The folowing sequence should start with the last number of previous sequence (in this case 14.4).
By this I want to model the diameter increment of a tree dependant on the diameter-class (small 6-14.99; medium 15 - 29.99; big >30).



    dbh <- c(seq(from = 6, to = 15, by = temp$DBH_growth[temp$dbh_class == "sma"]),
seq(from = 15, to = 30, by = temp$DBH_growth[temp$dbh_class == "med"]),
seq(from = 30, to = 300, by = temp$DBH_growth[temp$dbh_class == "big"]))


Like this code, but starting with the last number of the sequence before.










share|improve this question






















  • Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
    – nate.edwinton
    Nov 19 at 15:40

















up vote
0
down vote

favorite












I'd like to create a sequence with three different increements. From 6 to 15 for example an increment of 0.7 . The folowing sequence should start with the last number of previous sequence (in this case 14.4).
By this I want to model the diameter increment of a tree dependant on the diameter-class (small 6-14.99; medium 15 - 29.99; big >30).



    dbh <- c(seq(from = 6, to = 15, by = temp$DBH_growth[temp$dbh_class == "sma"]),
seq(from = 15, to = 30, by = temp$DBH_growth[temp$dbh_class == "med"]),
seq(from = 30, to = 300, by = temp$DBH_growth[temp$dbh_class == "big"]))


Like this code, but starting with the last number of the sequence before.










share|improve this question






















  • Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
    – nate.edwinton
    Nov 19 at 15:40















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'd like to create a sequence with three different increements. From 6 to 15 for example an increment of 0.7 . The folowing sequence should start with the last number of previous sequence (in this case 14.4).
By this I want to model the diameter increment of a tree dependant on the diameter-class (small 6-14.99; medium 15 - 29.99; big >30).



    dbh <- c(seq(from = 6, to = 15, by = temp$DBH_growth[temp$dbh_class == "sma"]),
seq(from = 15, to = 30, by = temp$DBH_growth[temp$dbh_class == "med"]),
seq(from = 30, to = 300, by = temp$DBH_growth[temp$dbh_class == "big"]))


Like this code, but starting with the last number of the sequence before.










share|improve this question













I'd like to create a sequence with three different increements. From 6 to 15 for example an increment of 0.7 . The folowing sequence should start with the last number of previous sequence (in this case 14.4).
By this I want to model the diameter increment of a tree dependant on the diameter-class (small 6-14.99; medium 15 - 29.99; big >30).



    dbh <- c(seq(from = 6, to = 15, by = temp$DBH_growth[temp$dbh_class == "sma"]),
seq(from = 15, to = 30, by = temp$DBH_growth[temp$dbh_class == "med"]),
seq(from = 30, to = 300, by = temp$DBH_growth[temp$dbh_class == "big"]))


Like this code, but starting with the last number of the sequence before.







r seq






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 at 14:53









fritz

1




1












  • Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
    – nate.edwinton
    Nov 19 at 15:40




















  • Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
    – nate.edwinton
    Nov 19 at 15:40


















Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
– nate.edwinton
Nov 19 at 15:40






Hi @fritz, welcome to SO! For better reproducibility make sure to provide some sample data for others to be able to help you out (the data frame temp and thus the increments are unknown).
– nate.edwinton
Nov 19 at 15:40














1 Answer
1






active

oldest

votes

















up vote
0
down vote













Something like this



sma <- seq(6, 15, .7)
med <- seq(max(sma), 30, 1)
lar <- seq(max(med), 300, 1.4)
dbh <- c(sma, med, lar)


supposing that .7,1,1.4 are the increments for small, medium, large respectively, or in your case



sma <- seq(6, 15, temp$DBH_growth[temp$dbh_class == "sma"])
med <- seq(max(sma), 30, temp$DBH_growth[temp$dbh_class == "med"])
lar <- seq(max(med), 300, temp$DBH_growth[temp$dbh_class == "big"])

dbh <- c(sma, med, lar)





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',
    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377183%2fseq-with-multiple-increments%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








    up vote
    0
    down vote













    Something like this



    sma <- seq(6, 15, .7)
    med <- seq(max(sma), 30, 1)
    lar <- seq(max(med), 300, 1.4)
    dbh <- c(sma, med, lar)


    supposing that .7,1,1.4 are the increments for small, medium, large respectively, or in your case



    sma <- seq(6, 15, temp$DBH_growth[temp$dbh_class == "sma"])
    med <- seq(max(sma), 30, temp$DBH_growth[temp$dbh_class == "med"])
    lar <- seq(max(med), 300, temp$DBH_growth[temp$dbh_class == "big"])

    dbh <- c(sma, med, lar)





    share|improve this answer

























      up vote
      0
      down vote













      Something like this



      sma <- seq(6, 15, .7)
      med <- seq(max(sma), 30, 1)
      lar <- seq(max(med), 300, 1.4)
      dbh <- c(sma, med, lar)


      supposing that .7,1,1.4 are the increments for small, medium, large respectively, or in your case



      sma <- seq(6, 15, temp$DBH_growth[temp$dbh_class == "sma"])
      med <- seq(max(sma), 30, temp$DBH_growth[temp$dbh_class == "med"])
      lar <- seq(max(med), 300, temp$DBH_growth[temp$dbh_class == "big"])

      dbh <- c(sma, med, lar)





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Something like this



        sma <- seq(6, 15, .7)
        med <- seq(max(sma), 30, 1)
        lar <- seq(max(med), 300, 1.4)
        dbh <- c(sma, med, lar)


        supposing that .7,1,1.4 are the increments for small, medium, large respectively, or in your case



        sma <- seq(6, 15, temp$DBH_growth[temp$dbh_class == "sma"])
        med <- seq(max(sma), 30, temp$DBH_growth[temp$dbh_class == "med"])
        lar <- seq(max(med), 300, temp$DBH_growth[temp$dbh_class == "big"])

        dbh <- c(sma, med, lar)





        share|improve this answer












        Something like this



        sma <- seq(6, 15, .7)
        med <- seq(max(sma), 30, 1)
        lar <- seq(max(med), 300, 1.4)
        dbh <- c(sma, med, lar)


        supposing that .7,1,1.4 are the increments for small, medium, large respectively, or in your case



        sma <- seq(6, 15, temp$DBH_growth[temp$dbh_class == "sma"])
        med <- seq(max(sma), 30, temp$DBH_growth[temp$dbh_class == "med"])
        lar <- seq(max(med), 300, temp$DBH_growth[temp$dbh_class == "big"])

        dbh <- c(sma, med, lar)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 15:36









        nate.edwinton

        961314




        961314






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53377183%2fseq-with-multiple-increments%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

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy