for (i in seq(6000,6100,by=10 ))
{
for (j in seq(206,216,by=1)
{
if (i/j <=29.25)
print(c(sprintf("%.3f",i/j),'---',i,j))
{
break
}
}
}
are you asking how to assign your calculated values to a name ?
you can make an empty list and append to it.
You have some issues to address first
- lack of a closing brace on the for condition of the j loop (i..e your code as presented does not run)
- is the break in the right place / set up correctly.? as it is it makes the j loop redundant as only the first j value would be assessed, did you miss an else condition ?
2 .Only the first j are asseded
1] "29.126" "---" "6000" "206"
[1] "29.175" "---" "6010" "206"
[1] "29.223" "---" "6020" "206"
Because your break
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.