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.
r seq
add a comment |
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.
r seq
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 frametemp
and thus the increments are unknown).
– nate.edwinton
Nov 19 at 15:40
add a comment |
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.
r seq
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
r seq
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 frametemp
and thus the increments are unknown).
– nate.edwinton
Nov 19 at 15:40
add a comment |
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 frametemp
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
add a comment |
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)
add a comment |
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)
add a comment |
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)
add a comment |
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)
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)
answered Nov 19 at 15:36
nate.edwinton
961314
961314
add a comment |
add a comment |
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.
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%2f53377183%2fseq-with-multiple-increments%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
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