I'm trying to write some code to give me an output that looks like:
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
Given my limited r experience the closest I got was:
for(i in 1:5) {
print(strrep("*", i))
}
for(i in 4:1) {
print(strrep("*", i))
}
which gives me:
# *
# **
# ***
# ****
# *****
and
# ****
# ***
# **
# *
Any guidance would be really helpful.
Thanks in advance!