[R] (no subject)

2024-10-01 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
I would go with unlist on x,single bracket subsetted on f x <- list(`1` = c(7, 13, 1, 4, 10), `2` = c(2, 5, 14, 8, 11), `3` = c(6, 9, 15, 12, 3)) f <- factor(rep(1:3,5)) unlist(x[f]) Yes, unsplit() it is. I was messing around with ave() (which can be hammered into submiss

Re: [R] [EXTERNAL] Re: Very strange behavior of 'rep'

2024-08-15 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
;> On 2024-08-15 2:39 p.m., Izmirlian, Grant (NIH/NCI) [E] via R-help wrote: > \n<>\n\n \n<< > This is very weird. I was running a swarm job on the cluster and it bombed > only for n.per.grp=108, not for the other values. Even though > n.per.grp*n.tt is 540, so that the leng

Re: [R] [EXTERNAL] Re: Very strange behavior of 'rep'

2024-08-15 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
ch=n.per.grp*n.tt) length(arm.i) ____ From: Rui Barradas Sent: Thursday, August 15, 2024 2:51 PM To: Izmirlian, Grant (NIH/NCI) [E] ; r-help@r-project.org Subject: [EXTERNAL] Re: [R] Very strange behavior of 'rep' �s 19:39 de 15/08/2024, Izmirlian, Grant (NIH/NCI

[R] Very strange behavior of 'rep'

2024-08-15 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
\n<>\n\n \n<< This is very weird. I was running a swarm job on the cluster and it bombed only for n.per.grp=108, not for the other values. Even though n.per.grp*n.tt is 540, so that the length of the call to 'rep' should be 1080, I'm getting a vector of length 1078. n.per.grp <- 108 n.tt <-

Re: [R] DescTools::Quantile

2024-01-29 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
It looks like a homework assignment. It also looks like you didn't read the documentation carefully enough. The 'len.out' argument in seq is solely for specifying the length of a sequence. The 'quantile' function omputes the empirical quantile of raw data in the vector 'x' at cumulative probab

Re: [R] New line in caption with math symbols embedded in expression (paste(

2021-02-18 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
"and", "a new line" ~ bar(x) == sum(frac(x[i], n), i==1, n) ) ) p <- ggplot(data=DAT, aes(x=X)) + geom_point(aes(y=Y)) + geom_line(aes(y=Y.p)) p <- p + labs(caption = e) p <- p + theme(plot.caption = element_text(hjust = 0)) p Hope this helps, Rui B

Re: [R] New line in caption with math symbols embedded in expression (paste(

2021-02-18 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
7; (row)" ~ "and", "a new line" ~ bar(x) == sum(frac(x[i], n), i==1, n) ) ) p <- ggplot(data=DAT, aes(x=X)) + geom_point(aes(y=Y)) + geom_line(aes(y=Y.p)) p <- p + labs(caption = e) p <- p + theme(plot.caption = element_text(hjust = 0)) p Hope this helps, Ru

Re: [R] New line in caption with math symbols embedded in expression (paste(

2021-02-18 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Feb 18, 2021 at 9:37 AM Izmirlian, Grant (NIH/NCI) [E] via R-help mailto:r-help@r-project.org>> wrote: ## I am using ggplot and trying to pr

[R] New line in caption with math symbols embedded in expression (paste(

2021-02-18 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
## I am using ggplot and trying to produce a caption containing math symbols. I need to ## add a second line. I did a fair amount of googling for answers. This one seemed like ## it would answer my question as it is nearly exactly my problem, except there is only ## one argument to the paste fun

Re: [R] R-help Digest, Vol 212, Issue 4

2020-10-05 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
Hi -- there are lots of replies --I have not read them all, if someone else suggested this, sorry for duplication. This is similar to the suggestion using mapply, but not specific to matrices. In fact it's a kludge that applies to many settings. You 'sapply' over the index 1:2, and pass a, b as

Re: [R] data frame solution

2019-03-20 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
Statements like c(rbind(x, xx+yy), max(t)) and rep(0,length(df$b[1])) don't make any sense. You're example will be easier to understand if you show us the nrow(df) ==3 case. Thanks Grant Izmirlian, Ph.D. Mathematical Statistician izmir...@mail.nih.gov Delivery Address: 9609 Medical Center Dr,

Re: [R] Q re: logical indexing with is.na

2019-03-11 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
logical indexing requires the logical index to be of the same length as the vector being indexed. If it is not, then the index is wrapped to be of sufficient length. The result on line 3 is y[c(TRUE, TRUE, FALSE, TRUE)] where the last TRUE was originally the first component of !is.na(y[1:3]) Gra