[R] Problem in executing R-script

2012-05-07 Thread Suhaila Haji Mohd Hussin
Hello. I'm a newbie here. In my script (I name it readData.R), I wrote the followings: readData <-function(){ med = read.csv("medicalData.csv");} Then I tested the script by 'Source R Code' then on the command I typed 'readData()' then I typed 'med' to check if the variable contains the medical

Re: [R] Problem in executing R-script

2012-05-07 Thread Suhaila Haji Mohd Hussin
a > function don't persist in the global environment. > > Sarah > > On Mon, May 7, 2012 at 1:41 PM, Suhaila Haji Mohd Hussin > wrote: > > > > Hello. I'm a newbie here. > > In my script (I name it readData.R), I wrote the followings: > > readDa

[R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to compute median for a filtered column based on other column but there was something wrong. I'll show how I did step by step. Here's the data: a b c class 1 12 0 90 A-B2 3 9711 A-B3 78 NA123 A-C4 NA NA12A-C5

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
gt; Subject: Re: [R] Problem with Median > From: sarah.gos...@gmail.com > To: bell_beaut...@hotmail.com > CC: r-help@r-project.org > > Please use dput() to give us your data (eg dput(data) ) rather than > simply pasting it in. > > Sarah > > On Mon, May 7, 2012 at 2

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
ct = a) > > # same error > > median(a.AC) > Error in median.default(a.AC) : need numeric data > > > # now look a the structure of a.AC (its a dataframe) > > str(a.AC) > 'data.frame': 2 obs. of 1 variable: > $ a: int 78 NA > > # now do it righ

Re: [R] Problem with Median

2012-05-07 Thread Suhaila Haji Mohd Hussin
AC) > Error in median.default(a.AC) : need numeric data > > > # now look a the structure of a.AC (its a dataframe) > > str(a.AC) > 'data.frame': 2 obs. of 1 variable: > $ a: int 78 NA > > # now do it right > > median(a.AC$a) > [1] NA > >

Re: [R] Problem with Median

2012-05-08 Thread Suhaila Haji Mohd Hussin
ect.org > From: dwinsem...@comcast.net > To: bell_beaut...@hotmail.com > Subject: Re: [R] Problem with Median > Date: Mon, 7 May 2012 20:25:24 -0400 > > > On May 7, 2012, at 5:16 PM, Suhaila Haji Mohd Hussin wrote: > > > > > Hello. > > Now the median is so

Re: [R] Problem with Median

2012-05-08 Thread Suhaila Haji Mohd Hussin
Hello. Thanks for the help and your reasonable explanation. I'll definitely start using 'dput' next time. Apologies for the trouble to all who helped me. Suhaila. > On 05/08/2012 06:35 PM, Suhaila Haji Mohd Hussin wrote: > > > > Hello. > > Sorry if tha

[R] Transform Data using Sigmoid Function

2012-05-12 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to scaling these attribute values using sigmoid and I created a function as followed: mySigmoid <-function(){ medGen = read.csv("medB1.csv"); data(medGen); medGen.signorm=rangenorm(medGen,method="signorm"); op=par(mfrow=c(2,3)) plot(medGen.signorm[,1])par(op)

Re: [R] Transform Data using Sigmoid Function

2012-05-12 Thread Suhaila Haji Mohd Hussin
Please nevermind as I have just solved this. Suhaila From: bell_beaut...@hotmail.com To: r-help@r-project.org Date: Sat, 12 May 2012 20:44:16 +1200 Subject: [R] Transform Data using Sigmoid Function Hello. I'm trying to scaling these attribute values using sigmoid and I created a function as

[R] plot.ts error: cannot plot more than 10 series

2012-05-13 Thread Suhaila Haji Mohd Hussin
Hello. I'm doing Principal Component Analysis. So I'm trying to plot the new data as time series like this: plot.ts(pr2$x) But it gives me error: Error in plotts(x = x, y = y, plot.type = plot.type, xy.labels = xy.labels, : cannot plot more than 10 series as

Re: [R] plot.ts error: cannot plot more than 10 series

2012-05-13 Thread Suhaila Haji Mohd Hussin
Thank you! Suhaila > From: ggrothendi...@gmail.com > Date: Sun, 13 May 2012 07:58:19 -0400 > Subject: Re: [R] plot.ts error: cannot plot more than 10 series > To: bell_beaut...@hotmail.com > CC: r-help@r-project.org > > On Sun, May 13, 2012 at 5:02 AM, Suhaila Haji

[R] Couldn't plot all PCA new attributes on K-Means Clustering

2012-05-13 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to plot clusters for all possible combination of attributes. So I typed in plot(pr2NewMedicalData, col = kmpr2NewMedicalData$cluster) The problem is it only plots PC2 axis against PC1 axis. There should be PC1 to PC10. I tried it on normal data (not PCA) and it plots all possib

Re: [R] Couldn't plot all PCA new attributes on K-Means Clustering

2012-05-13 Thread Suhaila Haji Mohd Hussin
Please nevermind as I've just solved this by using scatterplot matrices. Suhaila > From: bell_beaut...@hotmail.com > To: r-help@r-project.org > Date: Mon, 14 May 2012 06:28:06 +1200 > Subject: [R] Couldn't plot all PCA new attributes on K-Means Clustering > > > Hello. > I'm trying to plot clust

[R] Error using rect.hclust

2012-05-14 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to see clusters into a certain number of classes as seeing they are too many of them see entirely on dendrogram. So I did the following: > d <- dist(as.matrix(medData))> hc <- hclust(d, method="average")> plot(hc)> > plot(hc, hang = -1) But when it came to this:> rect.hclust(hc