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 t
did not work...??
Many thanks in advance!
HJ
On Wed, Mar 6, 2013 at 4:36 AM, arun 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,] NA 5
t to add:
>
> Tem1[Tem1[,2]%in%setdiff(Tem1[,2],Tem2[,2]),]
> A.K.
>
> - Original Message -
> From: arun
> To: HJ YAN
> Cc: R help
> Sent: Wednesday, March 6, 2013 11:06 AM
> Subject: Re: [R] How to combine conditional argument and logical argument
> in R to
10,] 333 3
> #[11,] 333 4
> #[12,] 333 5
> #[13,] 333 6
> #[14,] 333 7
>
>
> A.K.
>
> From: HJ YAN
> To: arun
> Cc: r-help@r-project.org
> Sent: Wednesday, March 6, 2013 4:09 PM
> Subject: Re: [R] How to combine conditional argument and log
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(m
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 jus
ize the runtime for huge data and get:
>
> tNewData <- t(NewData)
> clust <- max.col(-apply(Centre, 1, function(x) colSums((x - tNewData)^2)))
>
>
> Best,
> Uwe Ligges
>
>
>
>
>
> On 21.05.2013 13:19, HJ YAN wrote:
>
>> Dear R users
>>
>>
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
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
t got same problem, so I hushed it out.
>>>
>>
>> That's not the right place to put the pdf() call, it should appear before
>> any of the graphing calls. To keep the pdf resolution, you need to plot to
>> the pdf device.
>>
>> Duncan Murdoch
>>
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 1
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
> 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 wrote on 08/06/2012 1
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.
.03, 0.04, 0.04, 0.04, 0.04, 0.03,
0.04, 0.04, 0.03, 0.04, 0.03, 0.04, 0.04, 0.03, 0.03, 0.04, 0.04,
0.04, 0.04, 0.03, 0.03, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,
0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04,
0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.
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 readin
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 t
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:n
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
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
> > Université de Bourgogne
> > UMR CNRS/uB 6282 Biogéosciences
> > 6 Boulevard Gabriel
> > 21000 Dijon, FRANCE
> > +33(0)3.80.39.63.06
> > ivan.calan...@u-bourgogne.fr
> > http://biogeosciences.u-bourgogne.fr/calandra
> >
> >
> > Le 27/03/12 12:3
Sorry last message was not completed before sending
Please below
On Tue, Mar 27, 2012 at 5:36 PM, HJ YAN 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...
>
> Belo
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
; For example:
>>
>> myDir<- "some file path"
>> filenames<- list.files(myDir)
>> filenames<- filenames[grep("[.]csv", filenames)]
>>
>> data_names<- gsub("[.]csv", "", filenames)
>>
>> for(i in 1:leng
[i])}
But when I tried to access the components in this list 'Data1', only the
first method of the three (shown below) works, and I think the other two
are more useful for me. Any ideas??
(1) Data1[[1]]
*** this one works
(2) Data1[["Data.512180_20120523150757"]]
***
25 matches
Mail list logo