Hi,
Try
pgamma(amounts,shape_gamma,scale=scale_gamma)
as I am guessing you mean scale_gamma to be the scale of the distribution, but
are using it as the rate ( = 1 / scale) instead
Martyn
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Amelia Marsh
S
Its a formatting thing, try
summary(testrow,digits=20)
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Franckx Laurent
Sent: 13 February 2015 11:00
To: r-help@r-project.org
Subject: [R] difference between max in summary table and max function
Dear all
Something else that might be of interest ...
Zhang Q and Wang W (2007) A fast algorithm for approximate quantiles in high
speed data streams Proceedings of the 19th International Conference on
Scientific and Statistical Database Management IEEE Computer Society 29
-Original Message-
Fro
Hi,
The G matrix can be constructed from the SVD because GGt is square and
symmetric, so the matrices of the left and right singular values (i.e. U and V)
are the same.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Pete
Hi,
As a slight aside, did you mean pseudo-random or quasi-random?
http://en.wikipedia.org/wiki/Pseudorandom_number_generator
http://en.wikipedia.org/wiki/Low-discrepancy_sequence
runif gives a sequence of pseudo-random numbers, for quasi-random numbers you
will need something else, for example
Hi,
Not sure if these are relevant as they have been on my "must look at" list for
some time and I've not managed to get around to it ...
http://www.cmap.polytechnique.fr/~aspremon/PDF/SPCAhandbookSV.pdf
http://www2.imm.dtu.dk/projects/manifold/Papers/sparsepc.pdf
Martyn
-Original Message-
Hi,
Try
http://social.technet.microsoft.com/wiki/contents/articles/19295.windows-8-how-to-search-for-large-files.aspx
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Hiyoshi, Ayako
Sent: 17 June 2014 11:40
To: Prof Brian R
Hi,
Something like:
aa <-structure(list(Cat = c(101, 103), Hours = c(15, 10)), .Names =
c("Cat","Hours"), row.names = c(NA, -2L), class = "data.frame")
bb <-structure(list(Cat = c(103, 106), Hours = c(16, 11)), .Names =
c("Cat","Hours"), row.names = c(NA, -2L), class = "data.frame")
dd <- data.
Hi,
Have you tried using a different bandwidth rather than the number of points,
the default bandwidth gives ...
x <- rnorm(1)
dd <- density(x,kernel="epanechnikov",n=101)
sum(dd$y)*(dd$x[2]-dd$x[1])
[1] 1.001014
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:
Hi,
I don't think you are doing anything wrong, the routine is doing what it
is documented to do, from ?cpt.mean
cpt: Vector containing the changepoint locations for the penalty
supplied. This always ends with n.
i.e. as your series is of length 50, the last value returned in cpts
will alwa
Hi,
backsolve() is probably what you are looking for.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Michael Meyer
Sent: 03 December 2013 12:25
To: r-help@r-project.org
Subject: [R] triangular matrix inverse
Greetings,
Hi,
That message usually means that an unknown argument has been supplied to
the function.
In this case you have spelt weights incorrectly.
Best wishes
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of rbowman16
Sent: 21 Nov
Hi,
I've not come across "Royston's measure of prognostic separation"
before, so I might be completely off the mark, but it is likely that by
"invnormal" it is meant the inverse of a standard normal distribution,
i.e. one with a mean of 0 and standard deviation of 1. Which is what
qnorm gives by d
ed to paste the text into the environment variable - time to go home
I think :)
Cheers
Martyn
-Original Message-
From: Joshua Wiley [mailto:jwiley.ps...@gmail.com]
Sent: 14 November 2011 18:17
To: Martyn Byng
Cc: r-help@r-project.org
Subject: Re: [R] unable to get "R CMD" t
x27;m guessing why "R CMD --help" works), do I need the
others in the path as well, and if so, in what order?
Cheers
Martyn
-Original Message-
From: Joshua Wiley [mailto:jwiley.ps...@gmail.com]
Sent: 14 November 2011 16:57
To: Martyn Byng
Cc: r-help@r-project.org
Subject: Re: [R
Hi,
I've just downloaded and installed R 2.14.0 using the windows binary on
a 64bit windows machine running windows 7.
Rterm / RGui work as expected, as does
R CMD --help
and
R CMD BATCH --help
however
R CMD check --help
returns no information and I seem to be unable to check a package.
Va
Hi,
I am sure there are better / more efficient ways of doing this, but the
following seems to work ...
ids <- sapply(split(df,df$ID),function(x) {length(x$rel.head)==2 &
any(x$rel.head==1) & any(x$rel.head==3)})
ids <- as.numeric(names(ids)[ids])
added.dummy <- as.numeric(df$ID%in%ids)
cbind(df
Hi,
Apologies if this is the wrong list to be sending this question to.
I am trying to install a copy of the R tools required to create /
compile packages on windows. After downloading Rtools from
http://www.murdoch-sutherland.com/Rtools/ windows keeps complaining that
"The setup files are corrup
Hi,
The answer to (2) is that num_obs is a scalar, so length(num_obs) is 1.
You probably wanted to do
for (i in 1:num_obs)
instead.
Best wishes
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of armstrwa
Sent: 18 May 2011 1
I wonder if someone with more experience than me on using R to summarise
by group wants to post a reply to this
http://www.analyticbridge.com/group/sasandstatisticalprogramming/forum/t
opics/why-still-use-sas-with-a-lot
To save everyone having to follow the link, the text is copied below
"SAS h
y.day,sum)
}
by.grp <- split(myframe,myframe$group)
lapply(by.grp,sum.by.week)
Martyn
-Original Message-
From: Dimitri Liakhovitski [mailto:dimitri.liakhovit...@gmail.com]
Sent: 30 March 2011 18:03
To: Martyn Byng
Cc: r-help
Subject: Re: [R] summing values by week - based on daily
Hi,
How about something like:
sum.by.day <- function(ff) {
by.day <- split(ff$value,weekdays(ff$dates))
lapply(by.day,sum)
}
by.grp <- split(myframe,myframe$group)
lapply(by.grp,sum.by.day)
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-pro
Hi,
This might do what you want:
iter <- 0
repeat {
iter <- iter + 1
ss <- numeric(40)
ss[1] <- sample(1:40,1)
for (i in 1:39) {
## calculate all possible step sizes that will give a new value in
the 1:40 range
pmove <- sample((1 - ss[i]):(40-ss[i]))
## drop all step sizes tha
Hi,
?summary.lm
describes what summary statistics get calculated and returned, so
ll <- lm(y ~ x)
ss <- summary(ll)
ss$fstatistic
for example would give the F statistic
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of d
Hi,
The values are calculated on the fly in the summary function
stats:::print.summary.princomp
using
vars <- result$sdev^2
vars <- vars/sum(vars)
cumsum(vars)
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of ian_zhangty
Hi,
Not sure what you are trying to do with the "cat" command, but cat
returns an invisible NULL (as described in the doc), so
a = cat(a,v)
just sets a to NULL
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Ravi Kulkarni
Hi,
If you look in the print.ols function you can see that the adjusted R^2
is not stored in the ols object but calculated on the fly, the relevant
code snippet from that function looks to be:
x <- ols1
stats <- x$stats
resid <- x$residuals
n <- length(resid)
ndf <- stats["d.
Hi,
Does
xx = rnorm(100)
hist(xx,freq=FALSE)
curve(dnorm,add=TRUE)
give you what you want?
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of David Winsemius
Sent: 03 March 2011 17:00
To: jpmaroco
Cc: r-help@r-project.org
Sub
Hi,
It is a bit unclear what it is you are trying to do, as mentioned in
replies by a variety of people previously, if you are just trying to get
your data into R and label rows / columns, then
tt = matrix(c(24,134,158,9,52,61,23,72,95,12,15,27),ncol=3,byrow=T)
rownames(tt) = c("None", "Healthy"
Hi,
If you only want the final matrix, i.e. in this case the pm at 10
months, then you might be better off looking at something like the
square-and-multiply algorithm
(http://en.wikipedia.org/wiki/Exponentiation_by_squaring) rather than a
brute force multiplication.
Martyn
-Original Message-
Hi,
This isn't an issue with is.na, you get the same if you use
aa = c(1,1,0,1,1,1,1,1,1)
bb = abs(aa - 1)
xtabs(aa~x1+x2)
xtabs(bb~x1+x2)
it is because you do not have any data in (1,1), i.e. there is no case where x1
= 1 and x2 = 1 so xtabs is putting a zero in that cell
Hope this helps
Mar
Hi,
Looks like the function "theta" takes a variable "data", but that
variable is not being used in the body of the function (you are using
the global dataX and dataY, which will be the same each time the
function is called).
Martyn
-Original Message-
From: r-help-boun...@r-project.org [
Hi,
The following seems to work:
plot(1:12,1:12,xaxt='n',xlab=NA)
axis(1,at=1:12,labels=c("J","F","M","A","M","J","J","A","S","O","N","D")
)
So I'd guess that your X axis data, file$time, doesn't take the values 1
to 12.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mai
package to work correctly (assuming that all pre-requisites are present
/ the same version).
Cheers
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: 09 November 2010 12:25
To: Martyn Byng
Cc: r-help@r-project.org
Subject: Re: [R] Installing the latest
Hi,
I am trying to install the latest version of the BRugs package on a 32
bit windows machine which, due to the set up, won't allow me to install
it via the usual R GUI.
Can anyone point me to a link from which I can download the relevant
files that allow me to install it manually (most pages fl
Hi,
Think I might be misunderstanding what you want, because ...
> t = "123"
> as.integer(t)
[1] 123
anyway
> t = "123"
> substr(t,regexpr("[^0]",t),nchar(t))
[1] "123"
seems to trim the leading 0's
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-
Hi,
Your code is of the form
for (i in 1:nsim) {
## Do something that generates variable qf05
M <- coeff(qf05)
}
This means that you are overwriting the variable M at each iteration and
so when the loop has finished you only have the coefficients from the
last simulation. There are lots of
Hi,
Something like
bb =
data.frame(label=c("a","b","a","b","c","a","b","c"),val=c(4,2,1,6,4,3,2,
1))
l = split(bb,bb$label)
par(mfrow=c(2,2))
lapply(l,function(a) {boxplot(a$val)})
might be what you are looking for
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-
Hi,
Not really sure what you are after, but the following plots a series of
points of varying colour
plot(x,y,type='n')
apply(cbind(x,y,z),1,function(a) {points(a[1],a[2],col=a[3],pch=".")})
but its going to be really slow for a large number of points
Martyn
-Original Message-
From: r-
(1:length(a))[a != 0]
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of vikrant
Sent: 23 July 2010 12:13
To: r-help@r-project.org
Subject: [R] How to get vector of poitions in a vector ?
I have a vector a = c(1,0,0,0,1,0,4,0,0,0)
Now
Hi,
Have you tried gsub?
> a = "abc.degg.hijk"
> gsub("."," ",a,fixed=TRUE)
[1] "abc degg hijk"
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Tolga I Uzuner
Sent: 19 July 2010 12:38
To: r-help@r-project.org
Subject: Re: [
Hi,
Is this what you are looking for?
a = c(528,528,528,528,708,708,529,1208,423,1506,321)
paste(substr(a,1,nchar(a)-2),substr(a,nchar(a)-1,nchar(a)),sep="/")
[1] "5/28" "5/28" "5/28" "5/28" "7/08" "7/08" "5/29" "12/08"
"4/23" "15/06" "3/21"
Martyn
-Original Message-
From: r-h
Hi,
I've no idea if there is a function for doing it, but if not, the
following seems to work
a = "this is a string"
paste(rev(substring(a,1:nchar(a),1:nchar(a))),collapse="")
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of
Hi,
I expect there are better ways of doing this then the following, but you
can probably get the same sort of thing using the split command
bb =
matrix(c(1,1,1,2,2,2,3,3,3,3,10,11,12,43,23,14,52,52,12,23),ncol=2,byrow
=FALSE)
aa = split(bb,bb[,1])
sapply(aa,function(temp) {cc = matrix(temp,ncol=
Hi,
You are using if/then/else which is a logical control statement and so doesn't
return a value, see
?if
for details.
You are probably looking for the ifelse function.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Pe
Hi,
Something like
x = as.factor(rep(1:k,rep(n/k,k))
X = model.matrix(~x-1)
Might be what you are looking for
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Gildas Mazo
Sent: 04 June 2010 16:19
To: r-help@r-project.org
Su
Hi,
If you want to draw lines on your barchart then
aa = barplot(chromosome, col="purple", xlab="Oryza sativa Chromosomes",
border
= NA, space = 5, ylim = c(0,45))
returns the midpoints of each bar in the vector aa and then you can use
the lines() function to do the drawing.
Martyn
-Origin
47 matches
Mail list logo