Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

R studio error : Error in x[[jj]][iseq]

$
0
0

@anniek wrote:

Hi guys,
I got asked to try to put missing values, but I don’t really understand it.
when I run this code:

c.ID <- c( NutSur2014[is.na(NutSur2014$Birthweight), “ID”],
NutSur2014[which(NutSur2014$Birthweight%in%c(777, 7777, 888, 8888)), “ID”])
c.Ward <- unique(NutSur2014[which(NutSur2014$ID%in%c.ID& NutSur2014$Ward != “2707”), “Ward”])

for (c in c.Ward)
{
repvalue <- as.numeric(names(which.max(table(NutSur2014[which((!NutSur2014$ID%in%c.ID) & NutSur2014$Ward == c),
“Birthweight”]))))
NutSur2014[which(NutSur2014$ID%in%c.ID & NutSur2014$Ward == c), “Birthweight”] <- repvalue
}

I get an error namely: Error in x[[jj]][iseq] <- vjj : replacement has length zero

What does “Error in x[[jj]][iseq] <- vjj : replacement has length zero” mean and how can I solve this?

thanks a lot!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles