R Basics
R Basics
Create a vector variable with the values "yes", "no", "yes", "maybe
# Enter your code here. Read input from STDIN. Print output to STDO
UT
V <-factor(c("yes","no","yes","maybe"))
levels(V)
3. Coding-Vector Operations
V1 <- c(1:5)
V2 <- c(10,20,30,40,50)
print(V1 + V2)
x[!(is.na(x) | x %% 2 == 1)]
V <- 80:100
sum <- 0
y = V[which(V %% 2 == 0)]
for(i in y){sum=sum + i}
print(sum)
10.