R Markdown

1). Business Intelligence (BI) can be an umbrella term that combines architectures, tools, databases, analytical tools, applications and methodologies. Its major objective is to enable interactive access to data, to enable manipulation of data, and to give ability to conduct appropriate analyses. Specifically, we approach BI by analyzing historical and current data, situations, and performances, and get valuable insights that enable them to make more informed and better decisions.

True

2). Match the description with the corresponding data structure

See answer in Blackboard

3). When calling the function, you could either match the arguments by their positions, or by their names. Note that some arguments may have default values if you not specify their values in the function call.

True

4) Which of the following code would be correct to extract the bike sharing datasets in R?

bike1 <- read.table("bike_sharing_data.csv", sep=",", header=TRUE)
bike2 <- read.table("bike_sharing_data.txt", sep="\t", header=TRUE)
bike3 <- read.csv("bike_sharing_data.csv")
bike4 <- read.delim("bike_sharing_data.txt")

5). What is the total number of observations and variables for the bike sharing dataset?

bike_data <- read.csv("bike_sharing_data.csv")  
dim(bike_data)  
## [1] 17379    13

6). If you import the bike sharing dataset in R using the above selected code option(s) (base R approaches) in Q4, what is data type of humidity perceived by R?

str(bike_data$humidity)
##  chr [1:17379] "81" "80" "80" "75" "75" "75" "80" "86" "75" "76" "76" "81" ...

7. What is the value of season in row 6251?

bike_data[6251, "season"]
## [1] 4
    1. How many observations have the season as winter?
table(bike_data$season)[4]
##    4 
## 4232

9. If you need to add multiple conditions to obtain a subset of a data frame (e.g., observations in winter season and/or have high wind speed), you can use the logical operators such as & or I between the conditions. And within a condition, %in% could be used to denote a choice in a vector.

True

10. How many observations having “High” wind thread condition or above during winter or spring?

# Subset the data for windspeed > 40 and season is winter or spring
high_wind <- subset(bike_data, windspeed > 40 & season %in% c(1, 2))

# Count the number of matching observations
nrow(high_wind)
## [1] 48