Maria Wolters
2000-Apr-28 10:23 UTC
[R] converting numerical parts of factors into numeric vectors
Dear list, Problem: Given a factor that contains both numerical values and category codes, how can I extract the numerical values and store them in a numeric vector while preserving the exact values? as.numeric() replaces the numerical values by their factor levels. But since the values represent an interval-scaled distance measure, this is not exactly what is called for. Current workaround: replace category codes by arbitrary numbers to be filtered out later. In this case, negative numbers. More elegant solution: ? I checked CRAN, V&R, and the online help, but to no avail. Thanks in advance for your help. (The problem is not urgent, see "Current Workaround" ;) Maria Wolters -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._