# In some European countries the delimiter in a .csv is a semicolon ";". 
# Use read.csv2() as above instead of read.csv

data <- read.csv("input.csv")

print(is.data.frame(data))
print(ncol(data))
print(nrow(data))

#print(data)

# Get the max salary from data frame:
sal <- max(data$salary)
print(sal)

# the person with the max salary:
retval <- subset(data, salary == max(salary))
print(retval)

# the in the IT department:
retval <- subset( data, dept == "IT")
print(retval)

# people in IT dept with salary > 600:
info <- subset(data, salary > 600 & dept == "IT")
print(info)

# people who joined on or after 2014:
retval <- subset(data, as.Date(start_date) > as.Date("2014-01-01"))
print(retval)

