Re: [R] keep the centre fixed in K-means clustering

2013-05-22 Thread HJ YAN
))) Best, Uwe Ligges On 21.05.2013 13:19, HJ YAN wrote: Dear R users I have the matrix of the centres of some clusters, e.g. 20 clusters each with 100 dimentions, so this matrix contains 20 rows * 100 columns numeric values. I have collected new data (each with 100 numeric values

[R] keep the centre fixed in K-means clustering

2013-05-21 Thread HJ YAN
Dear R users I have the matrix of the centres of some clusters, e.g. 20 clusters each with 100 dimentions, so this matrix contains 20 rows * 100 columns numeric values. I have collected new data (each with 100 numeric values) and would like to keep the above 20 centres fixed/'unmoved' whilst

[R] Calculating distance matrix for large dataset

2013-05-02 Thread HJ YAN
Dear R users I wondered if any of you ever tried to calculate distance matrix with very large data set, and if anyone out there can confirm this error message I got actually mean that my data is too large for this task. negative length vectors are not allowed My data size and code used

Re: [R] How to combine conditional argument and logical argument in R to create subset of data...

2013-03-06 Thread HJ YAN
! HJ On Wed, Mar 6, 2013 at 4:36 AM, arun smartpink...@yahoo.com wrote: Hi, b[b[,4]15 (b[,1]4|is.na(b[,1])) (b[,2]4|is.na(b[,2])),] #[,1] [,2] [,3] [,4] [,5] #[1,]6 NA NA 16 20 #[2,] NA5 NA 17 21 A.K. - Original Message - From: HJ YAN

Re: [R] How to combine conditional argument and logical argument in R to create subset of data...

2013-03-06 Thread HJ YAN
: Tem1[Tem1[,2]%in%setdiff(Tem1[,2],Tem2[,2]),] A.K. - Original Message - From: arun smartpink...@yahoo.com To: HJ YAN yhj...@googlemail.com Cc: R help r-help@r-project.org Sent: Wednesday, March 6, 2013 11:06 AM Subject: Re: [R] How to combine conditional argument and logical argument

Re: [R] How to combine conditional argument and logical argument in R to create subset of data...

2013-03-06 Thread HJ YAN
. From: HJ YAN yhj...@googlemail.com To: arun smartpink...@yahoo.com Cc: r-help@r-project.org Sent: Wednesday, March 6, 2013 4:09 PM Subject: Re: [R] How to combine conditional argument and logical argument in R to create subset of data... Dear Arun Thanks a million for your prompt

[R] How to combine conditional argument and logical argument in R to create subset of data...

2013-03-05 Thread HJ YAN
Dear R user I have data created using code below b-matrix(2:21,nrow=4) b[,1:3]=NA b[4,2]=5 b[3,1]=6 Now the data is b [,1] [,2] [,3] [,4] [,5] [1,] NA NA NA 14 18 [2,] NA NA NA 15 19 [3,] 6 NA NA 16 20 [4,] NA5 NA17 21 I want to

[R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread HJ YAN
Dear R users I tried an example earlier to check the results using two different methods of clustering with same data set, and for both methods, say method A and method B. Also I decided to have same number of groups/clusters (here 8 was chosen). I found a good graphical tool in R to compare

Re: [R] Summarizing data containing data/time information (as factor)

2012-09-06 Thread HJ YAN
this is clear now. Many thanks again. Best wishes, HJ On Thu, Sep 6, 2012 at 2:08 AM, arun smartpink...@yahoo.com wrote: Hi, I couldn't find any attached data. Could you dput() the data? A.K. - Original Message - From: HJ YAN

[R] Summarizing data containing data/time information (as factor)

2012-09-05 Thread HJ YAN
Dear R user I want to create a table (as below) to summarize the attached data (Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)' ), to indicate the day that there are any data available, e.g.value=1 if there are any data available for that day, otherwise value=0.

[R] How to convert data to 'normal' if they are in the form of standard scientific notations?

2012-08-06 Thread HJ YAN
Dear R users I read two csv data files into R and called them Tem1 and Tem5. For the first column, data in Tem1 has 13 digits where in Tem5 there are 14 digits for each observation. Originally there are 'numerical' as can be seen in my code below. But how can I display/convert them using

Re: [R] How to convert data to 'normal' if they are in the form of standard scientific notations?

2012-08-06 Thread HJ YAN
with scientific notation using the digits argument to the print() function. print(dat, digits=3) ax y 1 a 2.01e+13 2.1e+12 2 b 2.01e+13 2.1e+12 3 c 2.01e+13 2.1e+12 4 d 2.01e+13 2.1e+12 5 e 2.01e+13 2.1e+12 What is your default number of digits? getOption(digits) Jean HJ YAN

[R] Read vector as multi-dimensional data in R by row

2012-07-09 Thread HJ YAN
Dear R users Say I wanted to read a vector into R as multi-dimensional array by row, e.g. a-c(1:20) b-array(a,dim=c(2,5,2)) b , , 1 [,1] [,2] [,3] [,4] [,5] [1,]13579 [2,]2468 10 , , 2 [,1] [,2] [,3] [,4] [,5] [1,] 11 13 15 17 19

[R] Resolution issue with exporting plots from R and write tables in Latex code for producing pdf document

2012-06-08 Thread HJ YAN
Dear R users I am trying to exporting plots from R to an external folder, or to the working directory, but the resolution of plots (pdf file) largely reduced. Any way I can get same quality as my original plots?? e.g. I tested the plotting part using one example and obtained pretty good

Re: [R] Resolution issue with exporting plots from R and write tables in Latex code for producing pdf document

2012-06-08 Thread HJ YAN
...@googlemail.com Cc: r-help@r-project.orgr-help@r-**project.org r-help@r-project.org Subject: Re: [R] Resolution issue with exporting plots from R and write tables in Latex code for producing pdf document On 12-06-07 10:08 PM, HJ YAN wrote: Dear R users I am trying to exporting plots from R

Re: [R] Reading a bunch of csv files into R

2012-05-28 Thread HJ YAN
-help-boun...@r-project.org [mailto:r-help-bounces@r-**project.orgr-help-boun...@r-project.org] On Behalf Of Kevin Wright Sent: Friday, May 25, 2012 2:55 PM To: HJ YAN Cc: r-help@r-project.org Subject: Re: [R] Reading a bunch of csv files into R See ?dir Assign the value to a vector

Re: [R] Reading a bunch of csv files into R

2012-05-28 Thread HJ YAN
) Data1[[1]] *** this one works (2) Data1[[Data.512180_20120523150757]] *** this one doesn't work (3) Data1$Data.512180_20120523150757 *** this one doesn't work Hope I have made myself clear here. Thanks! HJ Bryan On May 28, 2012, at 11:20 AM, HJ YAN wrote: Dear Rui, Kevin

[R] Reading a bunch of csv files into R

2012-05-25 Thread HJ YAN
Dear R users I am struggling from a data importing issue: I have some hundreds of csv files needed to be read into R for futher analysis. All those csv files are named in one of the three formats: (1) strings: e.g. London_Oxford street (2) Integer: e.g. 1234_5678 (3) combined: e.g. London_1234

[R] Data indexing issue...

2012-03-27 Thread HJ YAN
Dear R-help, My dataset (which is a data frame, called 'Calender' here) includes 365 rows representing 365 days for a year. One column ('Season')contains factor data representing seasons, e.g. spring, summer, autumn and winter. Another column (called 'Day') contains data representing wether the

[R] Supperscript, subscript and double lines in the main/sub title and using greek letters

2012-03-27 Thread HJ YAN
Dear R-help, I am trying to express myself as best as I can here. If you also use Latex to edit math reports or other languages with similar editing method, you'll see what I'm talking about. My sincere appologies if my question is not clear enough to some extend, as also I'm not able to provide

Re: [R] Data indexing issue...

2012-03-27 Thread HJ YAN
-bourgogne.fr/calandra Le 27/03/12 12:32, HJ YAN a écrit : Dear R-help, My dataset (which is a data frame, called 'Calender' here) includes 365 rows representing 365 days for a year. One column ('Season')contains factor data representing seasons, e.g. spring, summer, autumn

Re: [R] Supperscript, subscript and double lines in the main/subtitle and using greekletters

2012-03-27 Thread HJ YAN
Sorry last message was not completed before sending Please below On Tue, Mar 27, 2012 at 5:36 PM, HJ YAN yhj...@googlemail.com wrote: Thank you very much Gerrit, for the nice hints! Just done some more googling and reaserches on this and trying to answering it myself... Below

[R] Check results between two data.frame

2012-03-21 Thread HJ YAN
Dear R-user, I'm trying to compare two sets of results and wanted to find out which element in the two data frame/matrix are different. I wrote the following function and it works ok, and gives me a long list of good as outcomes. CHECK- function (x = file1, y = file2) { for (i in

[R] 'Unexpected numeric constant'

2012-03-19 Thread HJ YAN
Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns. I would like to name the first column `DATE` and

[R] Importing multiple worksheets from one Excle/ csv file into R

2012-03-15 Thread HJ YAN
Dear R experts, I am trying to import some data from some Excle files into R. My Excle file contains about 50 sheets. One solution I can think about is to convert my Excle file into csv file first and then load data into R using 'read.csv'. But it seems to me that 'read.csv' only supports