I want to classify my variables and save the output, but the "test" is null. how can I fix the problem?
x<-sample(10)
npz<-function(x)
{
for(x in x)
if (x < 0) {
print("Negative number")
} else if (x > 0) {
print("Positive number")
} else
print("Zero")
}
test<-npz(x)
test
Aucun commentaire:
Enregistrer un commentaire