R Create new column of values based on the factor levels of another column [duplicate]
问题 This question already has answers here : R ifelse to replace values in a column (3 answers) Closed 11 months ago . I am trying to create a new column of values based on the values of another column. If the values in column iucnStatus are "LC" or "NT" I want the value in the new column (threatened) to be "Not_Threatened". If the values in iucnStatus are "VU", "EN", "CR", "EW", or "EX" I want the value in the new column (threatened) to be "Threatened." I got this far in writing code to create