I need to add 2 notes typed to find the final average in R (Nota1 + 2*Nota2)/3
but I do not know how to do the final calculation for the script to work without error
print("Escreva seu nome")
W<-scan(what="character",nmax=1)
print("Qual a nota1?")
X<-scan(what="character",nmax=1)
X<-as.numeric(X)
print("Qual a nota2?")
Y<-scan(what="character",nmax=1)
Y<-as.numeric(Y)
Line of code I do not know.
if (Z<6) {print("Faça a G3.")} else {print("Aprovado.")}
RGui