So where is the final correlation map
Can we write it:
to.write =
file(paste(C:\\Users\\aalyaari\\desktop\\corr1.bin,sep=),wb)
writeBin(as.double(results[[.f]]), to.write, size = 4)
--
View this message in context:
Hi Nico,
please let me know the details of sessionInfo() in R. Also, what version of
Java are you running? If you could post the output of java -version from
the command line that would be great. Note that XLConnect requires at least
Java 1.6.
Best regards,
Martin
--
View this message in
Hi,
I have the following data:
0 12
1 10
1 4
1 6
1 7
1 13
2 21
2 23
2 20
3 18
3 17
3 16
3 27
3 33
4 11
4 8
4 19
4 16
4 9
In this data file I would like to sum the numbers of second column which
belong to the same number in the first column.
So the output
Hi,
You can follow this example:
test - structure(list(V1 = c(0L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L), V2 = c(12L, 10L, 4L, 6L,
7L, 13L, 21L, 23L, 20L, 18L, 17L, 16L, 27L, 33L, 11L, 8L, 19L,
16L, 9L)), .Names = c(V1, V2), class = data.frame, row.names =
Hi
I have a data.frame with 371,718 obs. of 12 variables (see below for
an str). My problem is with V1, a Factor w/ 93144 levels, there should
actually be 93994 levels. Each entry looks like:
comp[number]_c[number]_seq[number]
for example
comp215489_c0_seq40
R is grouping as though the last
Le mardi 04 décembre 2012 à 00:34 -0800, Jeremy.Shearman a écrit :
Hi
I have a data.frame with 371,718 obs. of 12 variables (see below for
an str). My problem is with V1, a Factor w/ 93144 levels, there should
actually be 93994 levels. Each entry looks like:
Hi, T. Bal,
homework? Take a look at
?tapply
Regards -- Gerrit
On Tue, 4 Dec 2012, T Bal wrote:
Hi,
I have the following data:
0 12
1 10
1 4
1 6
1 7
1 13
2 21
2 23
2 20
3 18
3 17
3 16
3 27
3 33
4 11
4 8
4 19
4 16
4 9
In this data file I would
Dear list members
I want to analyze separately the months of a time series. In other words, I
want to plot and fit models for each month separately.
Taking the example of
http://a-little-book-of-r-for-time-series.readthedocs.org/en/latest/src/timeseries.html
births -
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Jeremy.Shearman
Sent: Tuesday, December 04, 2012 9:35 AM
To: r-help@r-project.org
Subject: [R] problem with factor levels
Hi
I have a data.frame with 371,718 obs.
Oh, your skepticism was spot on!
I was using excel to check the output (silly, but I am still in the process
of moving from excel to R) and there was a discrepancy in the number of
output from R and excel. Turns out the problem was with excel and not with R
at all. That's a relief.
SOLVED
--
Hello all,
I have what feels like a simple problem, but I can't find an simple
answer. Consider this data frame:
x - data.frame(sample1=c(35,176,182,193,124),
sample2=c(198,176,190,23,15), sample3=c(12,154,21,191,156),
class=c('a','a','c','b','c'))
x
sample1 sample2 sample3 class
1 35
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Antonio Silva
Sent: Tuesday, December 04, 2012 10:26 AM
To: R-help@r-project.org
Subject: [R] partial analisys of a time series
Dear list members
I want to analyze
Hi
That is quite usual. Excel is so widespread that almost everybody assumes it
shall not contain mistakes and behaves correctly. The contrary is true.
Spreadsheet often guess what user have on mind and corrects values to fit
such assumption, let aside mistakes in coded functions.
R expects
On 04-12-2012, at 08:59, T Bal wrote:
Hi,
I have the following data:
0 12
1 10
1 4
1 6
1 7
1 13
2 21
2 23
2 20
3 18
3 17
3 16
3 27
3 33
4 11
4 8
4 19
4 16
4 9
In this data file I would like to sum the numbers of second column
Hi,
Imagine the data you have is in a data frame, c, with columns a and b.
Then you can do this:
res=tapply(b,c[,-2],sum)
res[is.na(res)]-0
res
0 1 2 3 4
12 40 64 111 63
Hope it helps,
José
José Iparraguirre
Chief Economist
Age UK
-Original Message-
From:
Thanks Petr
I thought there might be an equivalent for birthstimeseries[,1] if it were
a dataframe, but split function sounds great.
I could not reproduce the second line of your suggestion l.blist -
lapply(blist, HoltWinters). I receive the message: Error in
decompose(ts(x[1L:wind], start =
Hello, Simon,
see below!
On Tue, 4 Dec 2012, Simon wrote:
Hello all,
I have what feels like a simple problem, but I can't find an simple
answer. Consider this data frame:
x - data.frame(sample1=c(35,176,182,193,124),
sample2=c(198,176,190,23,15), sample3=c(12,154,21,191,156),
You can use, 'sample' function for sampling and may consider using
partition clustering for selecting your regions, see Cluster task view:
http://cran.r-project.org/web/views/Cluster.html
On 4 December 2012 00:53, KoopaTrooper ncoop...@tulane.edu wrote:
I am using package ks() to build 3D
Bonjour,
Je serais en congés jusqu'au Jeudi 6 Décembre.
Pour des raisons d'urgence, vous pourrez me contacter par téléphone au 06 46 34
81 03.
Cordialement,
--
Jérôme Boutet
Conservatoire d'espaces naturels de Picardie
1, place Ginkgo - village Oasis
80 044
At 20:39 03/12/2012, Min Dong wrote:
Hi, I am a novice in R. It will be greatly appreciated if someone
can advise me with the following questions.
There are at least three packages available from CRAN (meta, metafor,
rmeta) which draw forest plots so it would help us if you had told us
which
Try period.apply() from the xts package.
MW
On Tue, Dec 4, 2012 at 9:26 AM, Antonio Silva aolinto@gmail.com wrote:
Dear list members
I want to analyze separately the months of a time series. In other words, I
want to plot and fit models for each month separately.
Taking the example of
Hi
I am not an expert in time series. The problem is that resulting list is not
time series any more. So you need to convert it again to time series and you
need to give it frequency greater than 1.
something like
l.blist - lapply(blist, function (x) HoltWinters(ts(x, frequency=2)))
But this
HI,
You can subset by:
birthstimeseriesJan-subset(birthstimeseries,cycle(birthstimeseries)==1)
A.K.
- Original Message -
From: Antonio Silva aolinto@gmail.com
To: R-help@r-project.org
Cc:
Sent: Tuesday, December 4, 2012 4:26 AM
Subject: [R] partial analisys of a time series
Dear
Thanks for the help,
Perhaps I should elaborate a bit, I am working on bioinformatics project in
which I am trying to run a forward selection algorithm for machine learning
classification of two biological conditions.
At each iteration I want to find the gene that in addition to those I have
Hello,
I have a problem with the do.call-function. I would like to merge
the values of more than 30 columns, but not in all of the rows exist
values, so with this commando i get a lot of ; or NA.
How get i only the merge of cells with a number?
datos$NEW - do.call(paste, c(datos[,19:53], sep =
HI,
You can use either ?tapply(), ?aggregate(), ?ddply() from library(plyr)
dat1-read.table(text=
0 12
1 10
1 4
1 6
1 7
1 13
2 21
2 23
2 20
3 18
3 17
3 16
3 27
3 33
4 11
4 8
4 19
4 16
4 9
,sep=,header=FALSE)
with(dat1,aggregate(dat1[,2],by=list(V1=dat1[,1]),sum))
# V1 x
#1
When you typed x as a command, R runs the command print(x). That function
produces a summary of the results which may include round off numbers to a
few decimal places to make them more readable. When you typed x$statistic,
you got the unrounded version of the result 5.6e-31 which I think you will
Hello List,
Probably many of you aware of the Julia language
(http://julialang.org/), It is a promising project.
However it seems like R is very slow in their benchmarks. Very
important point they omit, they did not
use R's own JIT ! I had a feeling that R is mistreaded there :)
Also another
Try the following:
set.seed(100)
rf1 - randomForest(Species ~ ., data=iris)
set.seed(100)
rf2 - randomForest(iris[1:4], iris$Species)
object.size(rf1)
object.size(rf2)
str(rf1)
str(rf2)
You can try it on your own data. That should give you some hints about why the
formula interface should be
There been, that done.
http://stackoverflow.com/questions/9968578/speeding-up-julias-poorly-written-r-examples/10712158#10712158
MW
On Tue, Dec 4, 2012 at 2:34 PM, Suzen, Mehmet msu...@gmail.com wrote:
Hello List,
Probably many of you aware of the Julia language
(http://julialang.org/), It
DT = data.frame(x=rep(c(a,b,c),each=3), y=c(1,3,6), v=1:9, w=3:11,
z=LETTERS[1:9])
If I understand you right, and you want to select all rows where v3 and
W10
with(DT, DT[which(v3 w10),])
x y v w z
4 b 1 4 6 D
5 b 3 5 7 E
6 b 6 6 8 F
7 c 1 7 9 G
you can use colSums, rowSums on this, but
Hi,
I am trying to covert a Winbugs code into R code. Here is the winbugs code
model{# models likelihoodfor (i in 1:n){time[i] ~ dnorm( mu[i], tau ) #
stochastic componenent# link and linear predictormu[i] - beta0 + beta1 *
cases[i] + beta2 * distance[i]}# prior distributionstau ~ dgamma(
Hello all,
I need a help.
I am modeling a disease and a create a R function like that:
Lambda-function (x,date1,r,h,a){
ndate1 - as.Date(date1, %d/%m/%Y)
t1 - as.numeric(ndate1)
x[order(x$i),]
t -x[,t]
i -x[,i]
CONTAGIEUX -x[,CONTAGIEUX]
while ( t1 min(t) ){
for (i in 1:length(i)
Are you using windows? If you are you may want to try to run your R code from a
batch file:
REM on Microsoft Windows (adjust the path to R.exe as needed)
C:\Program Files\R\R-2.13.2\bin\x64\R.exe CMD BATCH
C:\Users\Frank\Documents\R\Projects\Heinrich\Heinrich.txt
DT-data.frame(time=c(0,1,5,24,36,48,72),DV=seq(0,60,10))
time DV
10 0
21 10
35 20
4 48 30
5 84 40
6 96 50
7 120 60
You want to add 24 to values that are =24 in 'time'
DT[DT$time=24,'time']-DT[DT$time=24,'time']+24
time DV
10 0
21 10
35 20
4 48 30
5 60 40
6
HI,
I am getting an error message:
l.blist-lapply(blist,HoltWinters)
#Error in decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal)
:
# time series has no or less than 2 periods
A.K.
- Original Message -
From: PIKAL Petr petr.pi...@precheza.cz
To: Antonio Silva
Hi,
Try this:
set.seed(15)
datos-as.data.frame(matrix(sample(c(1:20,NA),30,replace=TRUE),ncol=6))
do.call(paste,c(na.omit(datos),sep=;))
#[1] 5;18;14;10;17;3 14;15;15;3;2;20 8;18;19;17;12;11
A.K.
- Original Message -
From: Dominic Roye dominic.r...@gmail.com
To: r-help@r-project.org
Hi,
If the frequency is 1, the error message will be gone.
For e.g.
birthstimeseriesJanFeb-subset(birthstimeseries,cycle(birthstimeseries)==c(1,2))
birthstimeseriesJanFeb1-ts(birthstimeseriesJanFeb,frequency=2,start=c(1946,1))
plot.ts(birthstimeseriesJanFeb1)
Without data to reproduce what you saw, we can only guess.
One possibility is due to tie-breaking. There are several places where ties
can occur and are broken at random, including at the prediction step. One
difference between the two ways of doing prediction is that when it's all done
Thanks, Rui and David!
--
View this message in context:
http://r.789695.n4.nabble.com/Histogram-plot-help-tp4651958p4652065.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Hi,
I've got a new dataset which I don't know how to analyze with R. My knowledge
about R is limited for this kind of problem. I've tried to find a solution with
some spatio temporel packages and lme/lmer functions, but didn't find any
similar example.
I've got 10 locations on a coast on
Adam,
Getting the variance of MLE estimator when the true parameter is on the
boundary is a very difficult problem. It is known that the standard bootstrap
does not work. There are some sub-sampling approaches (Springer book:
Politis, Romano, Wolff), but I am not an expert on this.
I am running a random intercept random slope regression:
fitRIRT - lme(echogen~time,random=~
1+time|subject,data=repeatdata,na.action=na.omit)
summary(fitRIRT)
I would like to get the subject-specific slopes, i.e. the slope that the model
computes for each subject. If I have 10-subjects I
Ken,
Thank you for your help. ranef(fitRIRT) does not give me what I expect. The
subject-specific slopes, and subject-specific intercepts are not anywhere close
to what I would expect them to be; the mean of the subject-specfic values
should be close to those reported by
summary(fitRIRT) and
I think the random effects represent the subject adjustments to the population
averages. You may have to do the addition yourself to get the subject specific
slopes and intercepts. Someone will hopefully correct me if I'm wrong.
On 12/04/12, John Sorkin wrote:
Ken,
Thank you for your
Yes, you are correct.
Thanks,
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax)
Dear all,
Do you know how to return all the R settings to original state? Other than
.Rdata and .Rhistory
Some weid thing happened to my machine. I was trying to get shaded confidence
band ploted using survplot from rms liberary.
It worked on one machine, but not on the other. I tried
I'm solving 4 complex equations simultaneously. Code is below. The code
returns only zero's for the solution though there should also be a non-zero
result. I'm pretty confident that the equations are correct because they
are straight from a published paper and I checked them pretty thoroughly.
John: I think you want the output from coef(fitRIRT). The
ranef(fitRIRT) will give you the subject specific random effect deviations
from the fixed effects means. The coef(fitRIRT) will give you the
combination of the fixed effect means with the subject specific random
effect deviations
HI,
I am not sure the output you wanted is correct:
sample1 sample2 sample3
1 1.0 0 0.5
because
0.2*colMeans(x[,-4])
sample1 sample2 sample3
# 28.40 24.08 21.36
This might help you:
apply(x[-4],2,function(y) length(y[y 0.2*mean(y)
x$class==a])/length(x[x$class==a]))
What are you expecting?
What do you get?
What is the problem?
J
On 4 December 2012 06:01, anoumou teko_maur...@yahoo.fr wrote:
Hello all,
I need a help.
I am modeling a disease and a create a R function like that:
Lambda-function (x,date1,r,h,a){
ndate1 - as.Date(date1, %d/%m/%Y)
t1
Hi,
In the plot function I want to label x axis as the numbers between 1 and 12
(so 1, 2, 3, 4, 5, ..., 12). How should I do it? The range of x values are
different than this range. Thanks!
Kind regards,
T. Bal
[[alternative HTML version deleted]]
Hello,
You should provide sample data and code.
plot(3:10, xlim = c(0, 12), xaxt = n)
axis(1, at = 1:12)
See the help page ?par for a description of the graphical parameters
'xlim' and 'xaxt', and of ?axis.
Hope this helps,
Rui Barradas
Em 04-12-2012 17:24, T Bal escreveu:
Hi,
In the
On 04-12-2012, at 17:06, Alicia Ellis wrote:
I'm solving 4 complex equations simultaneously. Code is below. The code
returns only zero's for the solution though there should also be a non-zero
result. I'm pretty confident that the equations are correct because they
are straight from a
Hi everyone,
I normally include a call to browser() as I'm working out the kinks in my
scripts, and I am always able to step through each line by hitting
Return, but for some reason, in the scripts I'm working on now, hitting
Return seems to cause execution of *all* the lines in my script. I've
On 04-12-2012, at 18:50, Berend Hasselman wrote:
You should return the vector y i.e. function values.
But y has length 4 and x has length 4.
x has length 5 of course.
Berend
So where is the fifth value for y?
}
Xstart=c(1, 200, 0.5, 0.5, 12)
fstart=
Dear all,
I cannot reading a .xlsm file using read.xls.
I executed:
read.xls(resultados.xlsm,
colNames = TRUE,
sheet = 1,
type = data.frame,
from = 1,
rowNames = NA,
colClasses = character,
checkNames = TRUE,
dateTime = numeric,
naStrings = NA,
stringsAsFactors = F)
Error:
Call(ReadXls, file,
Untested, I think it's the blank line in your script which exits the
debugger and then you're seeing regular execution.
MW
On Tue, Dec 4, 2012 at 5:54 PM, David Romano drom...@stanford.edu wrote:
Hi everyone,
I normally include a call to browser() as I'm working out the kinks in my
scripts,
Hi list,
I am using read.csv to read data from csf files, but noticed that the
numeric data (those larger than 10 power 9) are rounded to the nearest
million (10 power 6). Any solution?
Thanks
Arvin
--
Sent from my mobile device
__
On 04/12/2012 1:02 PM, Torus Insurance wrote:
Hi list,
I am using read.csv to read data from csf files, but noticed that the
numeric data (those larger than 10 power 9) are rounded to the nearest
million (10 power 6). Any solution?
What makes you think that is happening? R rounds values for
Hi Arvin,
How are you preparing the data to be read: a spreadsheet?
How are you reading the data?
How have you verified that the CSV file is correct?
How have you verified that the data frame is incorrect?
Can you provide a reproducible example using a small portion of your dataset?
Sarah
On
Hello,
How can I make a monte carlo simulation on R?
Regards
Adel
--
PhD candidate in Computer Science
Address
3 avenue lamine, cité ezzahra, Sousse 4000
Tunisia
tel: +216 97 246 706 (+33640302046 jusqu'au 15/6)
fax: +216 71 391 166
[[alternative HTML version deleted]]
On 04/12/2012 12:54 PM, David Romano wrote:
Hi everyone,
I normally include a call to browser() as I'm working out the kinks in my
scripts, and I am always able to step through each line by hitting
Return, but for some reason, in the scripts I'm working on now, hitting
Return seems to cause
replicate(1000, sum(rnorm(50)^2-rchisq(50, 3)))
Or you know, many other things...
Michael
On Tuesday, December 4, 2012, Adel ESSAFI wrote:
Hello,
How can I make a monte carlo simulation on R?
Regards
Adel
--
PhD candidate in Computer Science
Address
3 avenue lamine, cité ezzahra,
This is a BUGS problem, not an R problem, so would be better asked on the
BUGS list (a practical hint: if it's not working through R, run the code
directly in BUGS: the error reporting is better). Anyway, here BUGS manages
to tell R to tell you what's wrong:
variable n is not defined
And looking
Dear all,
I need to access data from a large matrix (48000 x 48000) and to do it
I am trying to run two loops using for command. Surely it is been a
very slow job.
I heard that for is not the best option to perform large loops in R,
but I don't really know what would be the best (fast) option.
On Dec 4, 2012, at 6:47 PM, Charles Novaes de Santana
charles.sant...@gmail.com wrote:
Dear all,
I need to access data from a large matrix (48000 x 48000) and to do it
I am trying to run two loops using for command. Surely it is been a
very slow job.
I heard that for is not the best
Hi-
A journal has asked me to make all of my text annotations on a figure at
10-point size. For the most part this is easy, e.g. by creating figures with:
pdf(..., family='Times', pointsize=10)
But where I have superscripts (or subscripts) in axis labels, the default seems
to be to shrink
Dear Michael,
Thank you for your answer.
I have 2 matrices. Each position of the matrices is a weight. And I
need to calculate the following sum of differences:
Considering:
mat1 and mat2 - two matrices (each of them 48000 x 48000).
d1 and d2 - two constant values.
sum-0;
for(i in 1:nrows1){
Without a reproducible example it's hard to tell for certain, but what
about simply (assuming nrows2 is actually columns):
sum((mat1/d1 - mat2/d2)^2)
R is smart enough to understand elementwise manipulation of a matrix:
you shouldn't need a loop at all.
Sarah
On Tue, Dec 4, 2012 at 2:27 PM,
On Tue, Dec 4, 2012 at 11:27 AM, Charles Novaes de Santana
charles.sant...@gmail.com wrote:
Dear Michael,
Thank you for your answer.
I have 2 matrices. Each position of the matrices is a weight. And I
need to calculate the following sum of differences:
Considering:
mat1 and mat2 - two
How do I convert a list to a matrix?
--8---cut here---start-8---
list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17),
c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25),
c(45, 19), c(5e+05, 16))
as.matrix(a)
[,1]
[1,]
There is a book on MC with R:
Introducing Monte Carlo Methods with R by Robert/Casella:
http://www.springer.com/statistics/computational+statistics/book/978-1-4419-1575-7
On 4 December 2012 19:21, Adel ESSAFI adeless...@gmail.com wrote:
Hello,
How can I make a monte carlo simulation on R?
On Tue, Dec 4, 2012 at 8:43 PM, Peter Langfelder
peter.langfel...@gmail.com wrote:
On Tue, Dec 4, 2012 at 11:27 AM, Charles Novaes de Santana
charles.sant...@gmail.com wrote:
Dear Michael,
Thank you for your answer.
I have 2 matrices. Each position of the matrices is a weight. And I
need
Try:
matrix(unlist(a), ncol=2, byrow=T)
--Mark Lamias
From: Sam Steingold s...@gnu.org
To: r-help@r-project.org
Sent: Tuesday, December 4, 2012 3:09 PM
Subject: [R] list to matrix?
How do I convert a list to a matrix?
--8---cut
On Tue, Dec 4, 2012 at 8:09 PM, Sam Steingold s...@gnu.org wrote:
How do I convert a list to a matrix?
--8---cut here---start-8---
list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17),
c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25),
Thank you, Sarah! It is a wonderful new!!! :)
Now I need to solve the other question hehe How to allocate such large matrix :)
best,
Charles
On Tue, Dec 4, 2012 at 8:39 PM, Sarah Goslee sarah.gos...@gmail.com wrote:
Without a reproducible example it's hard to tell for certain, but what
about
On Tue, Dec 4, 2012 at 8:14 PM, Charles Novaes de Santana
charles.sant...@gmail.com wrote:
Error in matrix(0, 48000, 48000) : too many elements specified
but I thought it was a machine limitation (and I was asking for access
to a better machine in my labs...). Thanks for clarifying it.
Well,
I don't think there's any reason for the calculation you're doing that
you must have the whole matrix in memory, is there?
Unless there's something more than what you've shown us, you're just
taking the sum of elementwise operations. You can read the matrix in
in manageable chunks, take the sum
Dear R users,
I have a matrix composed of lists:
m - matrix( list(), nrow=1, ncol=3 )
m[[ 1, 1 ]] - list(A, B)
m[[ 1, 2 ]] - list(A, C)
m[[ 1, 3 ]] - list(A, B)
and want to get the sub-matrix where cells contain B.
But
m[ , B %in% m[ 1, ], drop=F ]
as well as
m[ , B %in% m[ 1, ][], drop=F ]
Hello,
I am trying to reformat some data so that it is organized by group in the
columns. The data currently looks like this:
group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP
347 4 4e-04 3e-04 5e-04
353 3 5e-04
It's not clear to me what it is you are attempting to do, as you switch from a
very specific example to some general example with the vague terms var1
var2, and var3.
It sounds like you might be trying to do something similar to what would be
available in the shape package using the melt
That should read the reshape package -- not the shape package.
My apologies.
To: Charles Determan Jr deter...@umn.edu; r-help@r-project.org
r-help@r-project.org
Sent: Tuesday, December 4, 2012 4:36 PM
Subject: Re: [R] reformatting some data
It's not
There is a book on MC with R:
Introducing Monte Carlo Methods with R by Robert/Casella:
http://www.springer.com/statistics/computational+statistics/book/978-1-4419-1575-7
On 4 December 2012 19:38, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
replicate(1000, sum(rnorm(50)^2-rchisq(50,
HI,
I just wonder whether your code worked or not.
set.seed(8)
mat1-matrix(sample(1:80,40,replace=TRUE),ncol=8)
set.seed(25)
mat2-matrix(sample(1:160,40,replace=TRUE),ncol=8)
#Since the dimensions are the same,
m-1:5
n-1:8
sum1-0
for(i in 1:length(m)){
for(j in 1:length(n)){
Thanks to both of you! I learned something new from both of your posts :-)
And you were both right, my example numbers were wrong! I accidentally
computed them based on 0.25 * mean instead of 0.2 * mean.
Thanks again!
Simon
On Wed, Dec 5, 2012 at 4:07 AM, arun smartpink...@yahoo.com wrote:
Hi,
Try this:
list1-list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17),
c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25),
c(45, 19), c(5e+05, 16))
res-t(sapply(list1,function(x) x))
res
# [,1] [,2]
#[1,] 5 101
#[2,] 10 46
#[3,] 15 31
I am using R for hierarchical clustering of a number of documents.
I have a distance matrix on which I have applied hclust method. When I plot
the result of hclust method, I can see the dendogram plotted. What I need
now is the dendogram stored as a tree in a data structure. My goal is to
Hello,
m[ , sapply(1:ncol(m), function(j) sapply(B, `%in%`, m[[1 , j]])), drop=F
]
It indeed does.
Thank you very much!
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Hi,
Not sure whether this helps:
library(reshape2)
dat1-structure(list(group = c(4L, 3L, 4L, 4L, 4L, 2L), X3.Hydroxybutyrate =
c(4e-04,
5e-04, 4e-04, 6e-04, 5e-04, 7e-04), X3.Hydroxyisovalerate = c(3e-04,
3e-04, 3e-04, 3e-04, 3e-04, 4e-04), ADP = c(5e-04, 6e-04, 6e-04,
5e-04, 7e-04, 7e-04)),
Hi,
You can also do this:
dat1-structure(list(group = c(4L, 3L, 4L, 4L, 4L, 2L), X3.Hydroxybutyrate =
c(4e-04,
5e-04, 4e-04, 6e-04, 5e-04, 7e-04), X3.Hydroxyisovalerate = c(3e-04,
3e-04, 3e-04, 3e-04, 3e-04, 4e-04), ADP = c(5e-04, 6e-04, 6e-04,
5e-04, 7e-04, 7e-04)), .Names = c(group,
HI,
Does this work for you?
mapply(function(x) x==B,m)
[,1] [,2] [,3]
#[1,] FALSE FALSE FALSE
#[2,] TRUE FALSE TRUE
A.K.
- Original Message -
From: Asis Hallab asis.hal...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Tuesday, December 4, 2012 4:16 PM
Subject: [R] How to
Hello,
Try the following.
m[ , sapply(1:ncol(m), function(j) sapply(B, `%in%`, m[[1 , j]])),
drop=F ]
Hope this helps,
Rui Barradas
Em 04-12-2012 21:16, Asis Hallab escreveu:
Dear R users,
I have a matrix composed of lists:
m - matrix( list(), nrow=1, ncol=3 )
m[[ 1, 1 ]] - list(A, B)
On Tue, Dec 4, 2012 at 8:17 PM, arun smartpink...@yahoo.com wrote:
Hi,
Try this:
list1-list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17),
c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25),
c(45, 19), c(5e+05, 16))
res-t(sapply(list1,function(x) x))
Bah
Hello,
I have been creating many tileplots to try and illustrate the relative
abundance of fish through space and time. My issue is that the tiles that
border the plot are smaller than those in the center of the plot. In the
example I've provided the effect is pretty minor (I'm hoping this will
No need for all this (see solutions including mine already given) --
but even without those, this is silly. An identity map is a real waste
if you just want the simplification bit of sapply() -- you'd be much
better just using simplify2array()
You are right that simplify2array(p) does
Hi all
Thanks for the attention and answers. I learned a lot I now I can go on my
work. I also tryed to you de command window().
I thought it would be possible to select one column of an ts object, like
we can do with a data.frame (plot(data[,2],data[,3]), to work. But as I saw
we need to
On Dec 4, 2012, at 11:05 AM, Chris Solomon wrote:
Hi-
A journal has asked me to make all of my text annotations on a figure at
10-point size. For the most part this is easy, e.g. by creating figures with:
pdf(..., family='Times', pointsize=10)
But where I have superscripts (or
Hi R users following this thread!
I evaluated both solutions given by Rui and Arun.
Both work very well.
Arun's is a little faster.
I did the following time measurements on a large matrix with 2 rows,
labelled InterPro and GO, and 88664 columns, labelled with protein IDs.
I was interested in
Fantastic - that does the trick, David, thanks for setting me straight!
Chris
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Tuesday, December 04, 2012 8:19 PM
To: Chris Solomon
Cc: r-help@r-project.org
Subject: Re: [R] control point size of superscript
1 - 100 of 112 matches
Mail list logo