New in the Rstudio

#How could i do this:
#Generate a new column of type factor, named grade and classify the

entities as follows:

high: Colima and Tepic;

low: Morelia and Puebla;

middle: Morelos and Guerrero;

very high: Tabasco.

Is this a homework question?

yes, i try this:
df_lab3$grado <- factor(df_lab3$edo_nac_fac,
lavels = c( "alto", "bajo", "medio", "muy alto"),
labels = c(("Colima", "Tepic"), ("Morelia", "Puebla"),
("Morelos", "Guerrero"), "Tabasco")
but doesnt run doesnt

You need to use c() to join two strings into a vector, like this:

c("Colima", "Tepic")

Please read the community homework policy linked above.

thanks
im going to read it

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.