Changing factor data Front Page › Forums › Clustering and finding patterns › Changing factor data This topic has 2 replies, 2 voices, and was last updated 6 years, 5 months ago by Barbara Pavliakova Walters. Viewing 3 posts - 1 through 3 (of 3 total) Author Posts November 10, 2015 at 9:37 pm EST #9671 Barbara Pavliakova WaltersParticipant So I did as.numeric(as.factor(data)) on my data, but it didn’t come out right – help! November 15, 2015 at 10:23 pm EST #9712 siddhu25Participant Hi Barbara, Could you please try below and let me know this is working for you. indx <- sapply(data, is.factor) data[indx] <- ldply(data[indx], function(x) as.numeric(as.character(x))) December 15, 2015 at 6:40 am EST #10052 Barbara Pavliakova WaltersParticipant Thank you! That works 🙂 Author Posts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Click an icon to connect with: Log In