setwd("H:/data/User/Classes/stats01_13/Week05/Class05_2020/R.Week05")

### Read the data
# Read a csv file

ufov <- read.csv("ufov.csv")

#there are missing values in the data, so we need to remove them with na.omit; we store the results
#in a new data frame (ufov2).

#the code below also demonstrates how to select only some variables ("keep") for the new data frame, and
#not others ("drop"). In the data frame below, we retain only columns 3, 4, 5 and 8 from the original data frame.

ufov2<-na.omit(ufov[,c(3:5,8)])

#Save the file

write.csv(ufov2, file="ufov2.csv")