I need to display the following:
Lastly, I need to add both these variables (number of total listings, percentage of listings) to one data frame and display.
What will be the most suitable R script code to use?
Creating a sample dataframe:
listings <- c("Listing_1", "Listing_2", "Listing_3", "Listing_4", "Listing_5")
reviews <- c("Good", "Very Good", "Bad", NA, "Very Bad")
df <- data.frame(listings, reviews)
Number of listings:
dim(df)[1]
Percentage of missing reviews:
sum(is.na(df["reviews"])) / dim(df)[1] * 100