You can create a function in R to print numbers 1 to 10 using a loop. Here's an example:
main.r86 chars8 lines
In this code, the print_numbers
function uses a for
loop to iterate over numbers 1 to 10. Inside the loop, each number is printed using the print
function. Finally, you can call the print_numbers
function to execute the loop and print the numbers 1 to 10.
gistlibby LogSnag