try

check.names = FALSE

in the read.table to see if this helps.


Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Wed, Nov 27, 2013 at 7:21 AM, Gitte Brinch Andersen <
gitt...@hum-gen.au.dk> wrote:

> Hi
>
> I am doing a cluster analysis and I have some troubles with the label
> names.
>
> In the text file I have my data in, the first row contains the names of
> the samples. They are called "FFPE Tumor 2", "Fresh Frozen Tumor 2" etc.
>
> But when the cluster is made the label names contains periods instead of
> space in the name.
> I can't figure out how to change this, so I get spaces in the label names.
> I hope someone can help?
>
> The code I have used is:
>
> #Set where you want to save your images/clusters
> setwd("/Users/gban/Desktop/Lung Cancer/PAXgene article figures/PAXgene
> cluster + Venn analysis")
>
> #Read in data
> data<-read.table("/Users/gban/Desktop/Lung Cancer/PAXgene article
> figures/PAXgene cluster + Venn
> analysis/BetaValue_ALL_tumo1_dup2_Codename.txt",sep="\t",dec=",",header=TRUE)
>
> # Throw out rows with missing values.
> data = na.omit(data)
>
> #Turn the data into a matrix
> Data_matrix<-as.matrix(data)
>
> #Calculate the distance
> Data_dist<-dist(t(data))
>
> #Make the cluster
> hc = hclust(Data_dist,method="ward")
>
> # reduced label size
> par(cex=0.7, mar=c(5, 8, 4, 1))
> plot(hc, xlab="", ylab="", main="", sub="", axes=FALSE)
> par(cex=1)
> title(xlab="", ylab="", main="Cluster analysis")
> axis(2)
>
> The cluster output:
> [cid:D57BB82B-3ACF-4681-BCA8-D8202EA34294@eduroam.net.au.dk]
> Kind regards
>
> Gitte Brinch Andersen
>
> Ph.d student
> Department of Biomedicine
> Wilhelm Meyers Allé 4
> Aarhus Universitet
> DK-8000 Aarhus C
>
> E-mail: gitt...@hum-gen.au.dk<mailto:gitt...@hum-gen.au.dk>
>
>
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to