search for: col_no

Displaying 2 results from an estimated 2 matches for "col_no".

2010 Dec 14
3
Question about cut()
...make numerics to factors, the sample codes are as follows. However, the result is not what I want, since r[3] =?9 should be in the interval of "8-10%" rather than "2-4%". Maybe cut() is not the right function to use for my situation. Please help. > r <- c(1,1,9,1,1,1) > col_no <- as.factor(as.numeric(cut(r,c(0,2,4,6,8,10,100)))) > levels(col_no) <- c("<2%","2-4%","4-6%","6-8%","8-10%",">10%") > col_no [1] <2%? <2%? 2-4% <2%? <2%? <2% Levels: <2% 2-4% 4-6% 6-8% 8-10% >10%Th...
2013 Jun 06
1
Error invalid graphics state using text()
...shareub2012 <- read.csv("xxx.csv", header=TRUE, sep = ";", dec = ",",stringsAsFactors=F) mergeshareub2012 <- merge(shareub2012, NUTS2, by.x = "Bundesland", by.y = "NAME" ) sortmergeshare2012 <- mergeshareub2012[order(mergeshareub2012$ID),] col_no <- as.factor(as.numeric(cut(sortmergeshare2012$x, c(0, .075, .125, .25, .50)))) levels(col_no) <- c("< 7,5%", "7,5-12,5%", "12,5-25%","> 25%") sortmergeshare2012$col_no <- col_no NUTS2$col_no <- col_no myPalette<-brewer.pal(4,"Blues&...