I use the following code to scan a (limited) parameter space of clustering
strategies ...
data <- read.table(...
dataTranspose <- t(data)
distMeth <- c("euclidean",
"maximum",
"manhattan",
"canberra",
"binary"
)
clustMeth <- c("ward",
"single",
"complete",
"average",
"mcquitty",
"median",
"centroid"
)
par(ask=TRUE)
for (d in distMeth){
print(d)
dt <- dist(dataTranspose,method=d)
for (m in clustMeth){
print(m)
hc <- hclust(dt,method=m)
plot(hc,
main=paste(c(
"Distance Measure", d,
"Cluster Method", m),sep=" "),
xlab='',
sub=''
)
}
}
However, my plot title (main) has 4 lines, when I think it should only
have one line.
What am I doing wrong?
paste(c("a","b","c"),collapse="")
paste("a","b","c",sep="")
On Mon, 2004-10-11 at 13:40, Dan Bolser wrote:> I use the following code to scan a (limited) parameter space of clustering
> strategies ...
>
> data <- read.table(...
>
> dataTranspose <- t(data)
>
> distMeth <- c("euclidean",
> "maximum",
> "manhattan",
> "canberra",
> "binary"
> )
>
> clustMeth <- c("ward",
> "single",
> "complete",
> "average",
> "mcquitty",
> "median",
> "centroid"
> )
>
> par(ask=TRUE)
>
> for (d in distMeth){
> print(d)
> dt <- dist(dataTranspose,method=d)
> for (m in clustMeth){
> print(m)
> hc <- hclust(dt,method=m)
> plot(hc,
> main=paste(c(
> "Distance Measure", d,
> "Cluster Method", m),sep=" "),
> xlab='',
> sub=''
> )
> }
> }
>
>
> However, my plot title (main) has 4 lines, when I think it should only
> have one line.
>
> What am I doing wrong?
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:> main=paste(c( > "Distance Measure", d, > "Cluster Method", m),sep=" "), > xlab='', > sub='' > )....> However, my plot title (main) has 4 lines, when I think it should only > have one line. > > What am I doing wrong?Oops. Ignore previous post and just get rid of the c() construct. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907