1
Good morning everyone, I need to do a barbadinha script in R where I have to read a typed number and give his predecessor (like, if I write 10 the predecessor is 9).
But I have a problem that I don’t know how to get started...
print("Digite um numero")
//O QUE VAI AQUI PARA LER O NUMERO DIGITADO
nAntecessor= numero-1
print("O antecessor é:", nAntecessor)
I’m using the R Project program...
Maybe
numero <- scan()
.– Rui Barradas
and what goes inside the parentheses of the scan?
– Carlos Winter
Nothing! Try and see. To finish entering numerical data, type <Enter> without entering a new number.
– Rui Barradas
@Noisy, put your solution in the answers, so it helps to see that the question has already been solved.
– Rafael Toledo
Okay, I think it’s a little too much, but it might actually be better.
– Rui Barradas