On Thu, 12 May 2022 19:31:51 +
"Sorkin, John" wrote:
> > mean(mlagFZ1,mlagFZ2,mlagFZ3)
> [1] -0.3326792
match.call(mean.default, quote(mean(mlagFZ1, mlagFZ2, mlagFZ3)))
# mean(x = mlagFZ1, trim = mlagFZ2, na.rm = mlagFZ3)
mean() takes a vector to compute a mean of and additional arguments
Hello,
I believe the following is simpler.
It changes the OP's code a bit and uses lapply, not apply.
res2 <- lapply(C, fitdist, "gamma")
do.call(rbind, lapply(res2, `[[`, "estimate"))
# shape rate
#A 3.702253 1.234126
#B 31.300800 3.912649
Hope this helps,
Rui Barradas
On 1/29/20
Capture the results of the apply command into an object and then work with
that. Here is one way to do it:
> res <- apply(C, 2, fitdist, "gamma")
> out <- c( res$A$estimate["shape"], res$B$estimate["shape"],
res$A$estimate["rate"], res$B$estimate["rate"])
> names(out) <- c("A shape","B shape","A r
Hi,
Let say I have data by two columns A and B, and I have fit each column using
the gamma distribution by 'fitdist' . I just want the result show only the
shape and rate only.
Eg:
library(fitdistrplus)
A <-c(1,2,3,4,5)
B<-c(6,7,8,9,10)
C <-cbind(A,B)
apply(C, 2, fitdist, "gamma")
Output sho
I have simplified your function. And I have transposed your results such
that resulting metrics are in columns rather than rows. So, it's not
exactly what you were after, but perhaps you will find it useful.
monthly_summary <- function(dt, r, tol=1E-6) {
# number of days with above tol by year
Hi R-users,
I am new to R. I try to code using the function in R as below:
monthly_summary <- function(dt,r)
{ tol <- 1E-6
mn <- vector(length=12, mode="numeric")
lambda <- vector(length=12, mode="numeric")
ag <- aggregate(dt[,4] > tol, list (dt[,2], dt[,1]), sum)
names(ag) <- c
The || operator will always return a result of type 'logical' and length 1.
You gave it two operands of length 0, so it returned the logical value NA,
meaning it had no idea what the result should be. If you give it operands
of length > 1, it will use the only the first elements of them. (S and S
On Aug 9, 2015, at 8:45 PM, Ragia Ibrahim wrote:
> Dear Group,
> Kindly,
>
> I have those two lines
> if( (z_nebla==0) || (z_nebla_dash==0) )
> CM <- 0 else
>
> CM <- 0.5 *(1/a) + 0.5*(1/b)
>
> when running it
>
> I got this
>
> z_nebla==0
Dear Group,
Kindly,
I have those two lines
if( (z_nebla==0) || (z_nebla_dash==0) )
CM <- 0 else
CM <- 0.5 *(1/a) + 0.5*(1/b)
when running it
I got this
z_nebla==0)
logical(0)
> (z_nebla_dash==0)
logical(0)
> (z_nebla==0) || (z
On 29/05/2015 2:36 PM, Lensing, Shelly Y wrote:
> Is anyone aware of point.in.polygon giving different results for 32-bit vs.
> 64-bit R? Our OS is 64-bit Windows 7 Enterprise. I'm working with someone
> else's extensive R program and the final results are close but not exactly
> matching. We're
Is anyone aware of point.in.polygon giving different results for 32-bit vs.
64-bit R? Our OS is 64-bit Windows 7 Enterprise. I'm working with someone
else's extensive R program and the final results are close but not exactly
matching. We're thinking it might be something with the point.in.polygo
On 12/17/2013 05:50 PM, wrote:
Mydata is as under.
dat=" salary ex
+ 1 1856 1799
+ 2 1856 1800
+ 3 1858 1800
+ 4 1858 1801
+ 5 1862 1803
+ 6 1862 1805
+ 7 1862 1810
+ 8 1865 1805
+ 9 1865 1808
+ 10 1865 1815
+ 11 1865 1820
+ 12 1870 1810
+ 13 1870 1830
+ 14 1880
On Dec 16, 2013, at 10:50 PM, wrote:
> Mydata is as under.
> dat=" salary ex
> + 1 1856 1799
> + 2 1856 1800
> + 3 1858 1800
> + 4 1858 1801
>
snipped
> + "
>
> data<-read.table(text=dat,header=TRUE)
>
> I want to get the result(please see the attatchment),the header is sal
Mydata is as under.
dat=" salary ex
+ 1 1856 1799
+ 2 1856 1800
+ 3 1858 1800
+ 4 1858 1801
+ 5 1862 1803
+ 6 1862 1805
+ 7 1862 1810
+ 8 1865 1805
+ 9 1865 1808
+ 10 1865 1815
+ 11 1865 1820
+ 12 1870 1810
+ 13 1870 1830
+ 14 1880 1840
+ 15 1880 1845
+ 16 1880 1851
+ 17
Yes, now it works!
Thank you very much for your help!
Jane
--
View this message in context:
http://r.789695.n4.nabble.com/Result-of-clustering-on-plot-tp4625043p4627431.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.
You don't give much information about x, but assuming that the "names" you
want to add to the plot are the row names.
Try this
text(x, col=cl$cluster, rownames(x))
Jean
greyofthedawn wrote on 05/10/2012 06:46:05 PM:
> Hello! I 'm new to R and need your help in one question...
> I did cluste
Hello! I 'm new to R and need your help in one question...
I did cluster analysis using kmeans function. I load data from file:
This file also contains headers for objects I want to cluster.
After making a clustering procedure I display result on plot:
And it shows only points (i.e. objects) wit
On 17-01-2012, at 11:35, Nerak wrote:
> Dear all,
> I have a question about the knowing for which row I have the max value of
> one of my variables.
> I calculated the Rsquared for different columns and made a list to gather
> them. I unlisted this list to create a vector with this values. I want
On 17/01/2012 5:35 AM, Nerak wrote:
Dear all,
I have a question about the knowing for which row I have the max value of
one of my variables.
I calculated the Rsquared for different columns and made a list to gather
them. I unlisted this list to create a vector with this values. I want to
know for
Dear all,
I have a question about the knowing for which row I have the max value of
one of my variables.
I calculated the Rsquared for different columns and made a list to gather
them. I unlisted this list to create a vector with this values. I want to
know for which column I have the max value of
Hi,
you can try close R and run R again for getting and saving another csv.
Or if your max(x) is too big, try split into 4, or 5 or even more like:
1:(max(x)/4)
and next run:
(max(x)/4+1) : (max(x)/2) etc
hope this helps,
JL
--
View this message in context:
http://r.789695.n4.nabble.com/
If you do a search on the quantreg documentation for "piecewise", the
first hit on the pdf has code on the same page. Running that rqss fit
call unaltered with your data produced a straight line (because the
data only has a domain of 0-0.5) but lowering lambda lets the
piecewise character g
Hello,
i have the following data:
x=c(0,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.21,0.22,0.23,0.25,0.26,0.27,0.46,0.47,0.48,0.49)
y=c(0.48,0.46,0.41,0.36,0.32,0.35,0.48,0.47,0.55,0.56,0.54,0.67,0.61,0.60,0.54,0.51,0.45,0.42,0.44,0.46,0.41,0.43
aculty/Varadhan.html
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Roland Rau
Sent: Friday, December 14, 2007 2:33 PM
To: '[EMAIL PROTECTED]'
Subject: Re: [R] Result depends on previous result; easy with a loop; but
without a loop?
Dear al
Dear all,
in the meantime, I found a solution -- thank to a suggestion sent by
Mark Leeds to me off-list.
All the best,
Roland
set.seed(1234)
initial.matrix <- rbind(rep(1,4), matrix(0,ncol=4,nrow=5))
the.other.matrix <- matrix(runif(20), ncol=4, nrow=5)
for (i in 2:(nrow(initial.matrix))) {
Dear all,
I am pretty sure that this has been discussed before. Unfortunately, I
can not find anything in the archives -- probably because I am
"RSiteSearching" for the wrong terms. If I remember correctly, I think I
even asked this question a few years ago. But I cannot even find this.
The ba
26 matches
Mail list logo