data.frame", row.names = c(NA,
-11L))
# I assume you would like to add up the values with na.rm = TRUE
meanFn <- function(x) mean(x, na.rm = TRUE)
# see ?aggregate
aggregate(dat[, c("PO1M", "PO1T", "PO2M")],
by = dat["STUDENT_ID"],
2, 2018 1:30:37 PM MDT, "Tóth Dénes" wrote:
On 05/02/2018 07:11 PM, Kevin E. Thorpe wrote:
I suspect this is pretty easy, but I'm having trouble figuring it
out.
Basically, I have a list of data frames such as the following
example:
list(A=data.frame(x=1:2, y=3:4),B=data.fr
On 05/02/2018 07:11 PM, Kevin E. Thorpe wrote:
I suspect this is pretty easy, but I'm having trouble figuring it out.
Basically, I have a list of data frames such as the following example:
list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8))
I would like to turn this into data frame w
Hi Martin,
On 11/29/2017 10:46 PM, Martin Morgan wrote:
On 11/29/2017 04:15 PM, Tóth Dénes wrote:
Hi,
A benchmarking study with an additional (data.table-based) solution.
I don't think speed is the right benchmark (I do agree that correctness
is!).
Well, agree, and sorry for the wo
lp@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posti
ng-guide.html
and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
___
On 09/29/2017 12:02 AM, Tóth Dénes wrote:
On 09/28/2017 10:25 PM, Dan Abner wrote:
Hi all,
I have a large number of text strings to search for enumerated items.
However, I am receiving this error message even though I thought that I
properly escaped the special character closed parenthesis
ttps://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
--
Dr. Tóth Dénes ügyvezető
Kogentum Kft.
Tel.: 06-30-2583723
Web: www.kogentum.hu
_
> Dear friends,
>
> How do I stop partial matching of list names?
>
> e.g.,
>
> x <- list(="a", B="b")
> is.null(x$A) #returns FALSE even though there is no element A.
>
> if(is.null(x$A)) {result <- x$} else {result <- x$A}
> result #is even though there is no x$A e
You could use ?unlist:
structure(data.frame(
matrix(unlist(strsplit(beatles," ")),length(beatles),2,T)),
names=c("FirstName","LastName"))
Note that this compact code does not guard you against typos, that is
names with >2 or <2 elements.
Hope that helps,
Denes
> I have a vector of ch
Hi there,
Since you failed to provide us with data and sessionInfo(), I can only
guess that for some reason you call the rtmvt.rejection function instead
of rtmvt.gibbs.
Just look at the code of rtvmt by typing:
rtmvt
There you can see that it is a wrapper for rtmvt.rejection or rtmvt.gibbs.
You
Hi Wendy,
try this:
Z <- matrix(runif(1000)>0.5,10,100)
rowSums(Z)
HTH,
Denes
> Hi all,
>
> I have a huge matrix of TRUE/FALSE table like following, and I want to
> count
> the number of TRUEs in each row. Instead of looping through each row and
> do
> length(Z[Z==TRUE]), I am wondering if t
I do not know the bioconductor packages you mentioned, but the corr.test
function in the psych package, or the rcorr function in the Hmisc package
should do the work.
Also note that the c() in method=c("pearson") is redundant. Just write
method="pearson" instead (or nothing, since this is the defa
Dear Dirk,
You should avoid indexing in the glm call so that the name of the terms
will not contain the indexing part. (Check str(lg) in your example.)
A more preferred solution uses predefined data frames in the original calls:
n <- 250
x <- rnorm(n)
noise <- rnorm(n,0,0.3)
y <- round(exp(x+nois
Just have a look at ?quantile and the probs argument.
tapply(x, l.c.1, quantile,probs=0.75)
Anyway, quantiles and quartiles are not the same. I guess you meant the
3rd quartile.
> All -
>
> I have an example data frame
>
> x l.c.1
> 43.38812035 085
> 47.55710661 085
> 47.55710661 085
end to vacillate between lattice and
> ggplot2. I should probably settle on one or the other and learn it
> better. I'll admit I like the default look of lattice plots better, but
> so far custom panel functions still baffle me.
>
> --Chris
>
> Tóth Dénes wrote:
>>
You might also consider the Deducer package. You can build up a plot by
point and click and then have a look at (and amend) the code and learn the
syntax of ggplot2, which is a nice alternative to the lattice package.
The website of the Deducer package (www.deducer.org) is a good start.
--
An
>
> On Mar 21, 2011, at 2:59 PM, Tóth Dénes wrote:
>
>>
>> Hi,
>>
>> I guess you have commas as decimals in your data. Replace it to
>> decimal
>> points.
>
> If that is true then the easiest fix would be to set the proper
> decimal arg
Hi,
I guess you have commas as decimals in your data. Replace it to decimal
points.
Best,
Denes
>
> On Mar 21, 2011, at 1:57 PM, pat...@gmx.de wrote:
>
>> Hi list,
>>
>> I have problems with the as.numeric function. I have imported
>> probabilities from external data, but they are classified
Hi,
predictAll should do what you want. See ?predict.gamlss.
HTH,
Denes
> Dear All:
>
> I have succeeded in fitting a GAMLSS.dist model to growth data I am
> working
> with it.
>
> My aim is to create a matrix of predicted percentiles and the
> corresponding
> the fitted model's sigma mu
Indeed, I forgot about the segments function.
with(d,plot(date,flow,type="n"))
with(d,segments(start,start.y,end,end.y,col=colour))
> Hi,
>
> because each colour is defined on non-consecutive points, you'll
> probably need to cut the intervals to define segments around each
> point. One approa
Hi!
Not an elegant solution, but seems to work:
date <- c(1:300)
flow <- sin(2*pi/53*c(1:300))
levels <- factor(rep(c("high","med","low"),100))
data <- cbind.data.frame(date, flow, levels)
colours <- as.numeric(levels)+1
# interpolate
resolution <- 0.001
appres <- approx(date,flow,seq(min(date
?unlist
quantile(unlist(data))
> Hi dear all,
>
> It may be a simple question, i have a list output with different number of
> elements as following;
>
> [[1]]
> [1] 0.86801402 -0.82974691 0.3974 -0.98566707 -4.96576856
> -1.32056754
> [7] -5.54093319 -0.07600462 -1.34457280 -1.04080125
t(matrix(a,3,4))
for more complex arrays, see ?aperm
> Hi again,
>
> I'd like to ask you a question again.
>
> I have a matrix like this:
> a <-matrix(c(1,2,3,4,5,6,7,8,9,10,11,12))
> a
>
> [,1]
> [1,]1
> [2,]2
> [3,]3
> [4,]4
> [5,]5
> [6,]6
> [7,]7
>
Hi!
Sorry, I made an error in the previous e-mail.
So try this:
by(df[,-1],df$id,function(x) apply(x,2,tabulate))
This gives you a list. You can rearrange it into a data frame or a 3d
array if you wish.
Regards,
Denes
> Hello everybody,
>
> I have a data frame in R which is similar to the
24 matches
Mail list logo