Question
R coding Hello! How can I code this in R? Many advertising values are missing. The missing code in R is `NA`. but after running
R coding
Hello! How can I code this in R?
Many advertising values are missing. The missing code in R is `NA`. but after running a code to get the number of missing values: ( sum(is.na(d2$xad)) ) the results said : [1] 0
Q4 A common (but incorrect) practice is to assume that the missing advertising is 0. We will use this adjustment to `xad` and generate the new variable `adv` and save it in a new object `d3`. Print The first six values of `d3` when `xad` is NA. How can I code this?
This is the code I used to create the data frame:
d2 = read.csv("tech_financials.csv", header=TRUE)
d2 <- d2 %>% select(conm, sale, oibdp, xrd) %>% filter(conm == "APPLE INC" | conm == "META PLATFORMS INC" | conm == "TESLA INC") as.data.frame(summarize(group_by(d2, conm), sale_mean = mean(sale), oibdp_mean = mean(oibdp), xrd_mean = mean(xrd)))
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started