search for: yhj204

Displaying 15 results from an estimated 15 matches for "yhj204".

2012 Jul 09
2
Read vector as multi-dimensional data in R by row
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,] 1 3 5 7 9 [2,] 2 4 6 8 10 , , 2 [,1] [,2] [,3] [,4] [,5] [1,] 11 13 15 17 19 [2,] 12 14 16 18 20 But actually I wanted... [,1] [,2] [,3] [,4] [,5]
2012 Mar 13
4
Converting factor data into Date-time format
Dear R-user, I have read a dataset from .csv file into R. This dataset includes one column containing some data in 'date and time' format, e.g. 'dd/mm/yyyy hh:mm'. These data were automatically read and saved as 'factor' in R. When I was trying to produce some plots (such as time series) with the above 'date and time' on x-axis, it caused some disodering problem,
2013 Mar 06
2
How to combine conditional argument and logical argument in R to create subset of data...
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,] NA 5 NA 17 21 I want to keep data in column 4 greater than 15 and the value in column 1 & 2 either greater than 4
2012 Mar 21
2
Check results between two data.frame
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 1:nrow(x)) { for (j in 1:ncol(x)) { if (x[i, j]
2012 Mar 15
2
Importing multiple worksheets from one Excle/ csv file into R
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 reading one sheet (or 'one file') each time, so that seems I have to create 50 csv
2012 May 25
4
Reading a bunch of csv files into R
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 I intend to use read.csv("xxxx_xxx.csv") but I only dealt with sigle documents before and
2012 Aug 06
1
How to convert data to 'normal' if they are in the form of standard scientific notations?
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 other form rather than scientific notations which seems a standard/default? I want them to be in
2012 Jun 08
3
Resolution issue with exporting plots from R and write tables in Latex code for producing pdf document
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 (/readable) quality for each plot in the (4*4) multiple graph. But when I did the loop and tried to export
2012 Sep 05
4
Summarizing data containing data/time information (as factor)
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. 28/04 29/04 30/04 01/05 02/05 532703 0 1 1
2013 May 02
2
Calculating distance matrix for large dataset
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 dim(mydata_nor)[1] 365000 144> d <- dist(mydata_nor, method = "euclidean") Here my
2012 Mar 27
2
Supperscript, subscript and double lines in the main/sub title and using greek letters
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 my code here because I don`t know which one I can use... When editing the title in R
2012 Mar 27
1
Data indexing issue...
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 day is a working day (I use 'Wd' for short here)or weekend (I use
2012 Nov 13
3
Can't remember which package I used. Anyone can help please?
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 the distribution of the number in each group/cluster created by method A and method B, e.g. how many of
2012 Mar 19
2
'Unexpected numeric constant'
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 the others T0.5, T1, T1.5,...,T24 (as this is a set of data collected every half hour for a
2013 May 21
1
keep the centre fixed in K-means clustering
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 just see how my new data fit in this grouping system, e.g. if the data is close to cluster 1