for (i in 1:nrow(survey_clean)) { for(j in 1:ncol(survey_clean)) { survey_clean$invalid_answers[i] <- sum(survey_clean$old_col == survey_clean$ol
I am trying to create a variable using ifelse, and would like the column to be 0 when the condition is not true, but they are showing up as NA. Any tips? df$z &
I searched for an answer to how to exchange NAs with the mean of the previous and next values in a DataFrame for specifically one column. But I didn't find an a
I have one quest (pretty short). I shoud recode variebles with function(). I tried some, but it doesn't work still. It should work with this: recode.numeric(x =
I am trying to get predictions of a multiple variables model, its eplt, its made of 7 scores and one final exam score moy_exam2, I want to predict the later usi
penguins %>% map(~replace_na(list(.=0))) Why the code above didnt work to replace na in the dataset penguins? The result is below # A tibble: 8 x 1 .
Is there any way to replace all the "-95" that can possibly exist in a dataframe with NA across all the columns?
I have a problem where I have to predict the sales of 4000 products in 3 months for a certain store. Within the 4000 time series I have many null values and esp
I made a prediction model for land use change using the lulcc package in R. Prediction was done using glm. When I did the glm.pred (the last line), there was an
I have the following data stored as zoo object: A B C 2017-05-31 NA NA 3.1 2017-06-30 2.5 2.4 3.2 2017-07-
I am trying to calculate the risk ratio for coinfection using the code: *NET_post4['VCandShig']<-NA NET_post4$VCandShig <- ifelse(NET_post4$VC=="Negative
I have a function that uses matplot to plot some data. Data structure is like this: test = data.frame(x = 1:10, a = 1:10, b = 11:20) matplot(test[,-1]) matlin
I have this data frame atac.v1.pbmc.5k.possorted.bam.bam possorted.bam.bam chr1.9941.10736 NA
I have two variables and I want to know if they are correlated, I have them distributed like this: X = 14,15,16,18,12,13,14,15 Y = NA, 13,12, NA, NA, 16,16, NA
I am doing a regression analysis with 70 countries. My dependent variable is 'Inequality' and my independent variable is 'Sanction'. My original columns look as
The image shows the database, it starts with day 0 and ends with day 14. In between these, there are empty values for what I am plotting. I am unable to correc
#This is my model linearMod <- lm( Housing_Training$SalePrice ~ Housing_Training$MSSubClass + Housing_Training$LotFrontage + Housing_Training$LotArea + Hous
I did a questionnaire research where some of the answers were "I don't know" and "I don't want to answer". Now I need to change those answering options to "N/A"
I have applied the following code on airquality dataset available in R, which has some missing values. I want to omit the rows which has NAs library(SparkR) Sys
I have a similar problem to Q: Connecting across missing values with geom_line, but found the answers provided only connect the lines when there is one missing