Please I need help with this, I keep getting errors.
Will be glad to have another way of doing it too. Thank you.
data<-data[, -c(6,14,17,19,20)]
clean_data <- data[complete.cases(data),]
#View (clean_data)
clean_data <- within(clean_data, {
WHO <- NA
WHO[clean_data$Pango lineage
== B.1.1.7] <- "ALPHA" WHO[clean_data$Pango lineage
== B.1.427] <- "EPSILON"
WHO[clean_data$Pango lineage
== B.1.525] <- "ETA"
WHO[clean_data$Pango lineage
== P.3] <- "THETA"
WHO[clean_data$Pango lineage
== B.1.617.1] <- "KAPPA"
WHO[clean_data$Pango lineage
== B.1.526] <- "IOTA"
WHO[clean_data$Pango lineage
== P.2] <- "ZETA"
WHO[clean_data$Pango lineage
== B.1.621] <- "MU" WHO[clean_data$Pango lineage
== C.37] <- "LAMBDA"
WHO[clean_data$Pango lineage
==B.1.351]<-"BETA"
WHO[clean_data$Pango lineage
==P.1]<-"GAMMA"
})
We don't have the data, and you didn't tell us what the errors are, so it's hard to help. Could you provide a minimal reproducible example, as described here:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
system
Closed
May 12, 2022, 3:14am
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.