0 votes
41 views
in Technology by (228k points)

When should you apply “next” statement in R? When is it appropriate to use the “next” statement in R?

1 Answer

0 votes
by (228k points)

A data scientist will use next to skip an iteration in a loop. As an example:

> val1 <- 1:30
> for(val in val1){
+ if(val == 25){
+ next
+ }
+ print(val<span style="border:0px; color:#777777; font-family:inherit; font-size:1.1em; font-stretch:inherit; font-style:inherit; font-variant:inherit; font-weight:inherit; line-height:inherit; margin:0px; padding:0px; vertical-align:baseline" class="enlighter

Related questions

0 votes
1 answer 37 views
+1 vote
1 answer 38 views
+1 vote
1 answer 24 views
0 votes
1 answer 22 views
0 votes
1 answer 58 views
+1 vote
1 answer 21 views
0 votes
1 answer 30 views
...