Dear Areti, this dcast data.frame presents the same info as Jim's barplot
reshape2::dcast(data=scrounging, formula=behav~substr, fun.aggregate=length) yielding behav air ground tree vine 1 active 5 4 3 3 2 foraging 2 1 3 4 3 inactive 0 4 4 5 4 snoozing 3 5 1 3 I tried to use likert by the example in the example in ?likert::likert library(likert) data(pisaitems) items29 <- pisaitems[,substr(names(pisaitems), 1,5) == 'ST25Q'] names(items29) <- c("Magazines", "Comic books", "Fiction", "Non-fiction books", "Newspapers") l29 <- likert(items29) l29 lapply(items29, levels) like this u <- unique(scrounging$behav) levels.behav <- c("inactive", u[u!="inactive"]) scrounging$behav <- factor(x=scrounging$behav, levels=levels.behav) u <- unique(scrounging$substr) levels.substr <- c("ground", u[u!="ground"]) scrounging$substr <- factor(x=scrounging$substr, levels=levels.substr) likert::likert(scrounging) yielding Item inactive active foraging snoozing 1 behav 36 20 20 24 2 substr 20 28 30 22 but I doubt this is meaningful ... Best, Rasmus
signature.asc
Description: PGP signature
______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.