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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!