[R] merge small clusters in R

2016-03-19 Thread Sheila the angel
In R, I have cut a dendrogram into clusters. However some of the clusters have only few samples. How can I merge the small clusters with nearest big cuter. hc <- hclust(dist(USArrests)) plot(hc, cex = 0.6) rect.hclust(hc, k = 4, border = 2:5) It gives one cluster with only 2 samples. How can I me

Re: [R] (no subject)

2016-03-19 Thread Sheila the angel
Have you tried install.packages("pbkrtest") On 13 March 2016 at 17:56, Sudhansu Senapati wrote: > I have loaded "caret" package to my R successfully with dependencies=TRUE. > But when I go to library(caret), some namespaces are not loaded. > > library(caret) > Loading required package: lattic

[R] processing time line by line

2015-10-15 Thread Sheila the angel
Hello All, I am looking for any package/function which can give processing time for each line of a given function. I came through the package "profr" but don't know how to find line number. Any help will be appreciated. Thanks -- Sheila [[alternative HTML version deleted]] __

[R] ggplot, Plot title at the bottom of plot

2015-05-04 Thread Sheila the angel
Hello All, I am looking for the answer to simple question: In ggplot, how to put plot title at the bottom of plot ? This code : qplot(rnorm(100)) + ggtitle("My Title") puts the title at middle and top of plot while I want it to be at middle and *Bottom* of the plot. Using +theme(plot.title =

[R] glmnet, Error in apply(nz, 1, median) : dim(X) must have a positive length

2014-08-08 Thread Sheila the angel
Hello all, In glmnet package, cv.glmnet is giving error >data(iris) >df<-data.frame(iris$Sepal.Length, iris$Sepal.Width, iris$Petal.Length, iris$Petal.Width) >x<- as.matrix(df) >y<- as.numeric(iris$Species) >fit = glmnet(x, y, family = "multinomial", type.multinomial = "grouped") >plot(fit, xvar =