yes, thank you for catching that slip.
On Tue, Jun 5, 2018 at 11:29 PM, Christopher W. Ryan
wrote:
> Richard--
>
> Nice. If I understand your code correctly, in the line
>
> ddm <- matrix("", (n+2) %/% nc, nc)
>
> I could instead use
>
> ddm <- matrix("", (n + nc - 1) %/% nc, nc)
>
> for generali
Richard--
Nice. If I understand your code correctly, in the line
ddm <- matrix("", (n+2) %/% nc, nc)
I could instead use
ddm <- matrix("", (n + nc - 1) %/% nc, nc)
for generalizability, as I may have to increase nc as the list of words
grows ever longer.
Thanks everyone. Several good suggesti
I think this is cuter, and it is a hair faster.
n <- length(dd)
ddm <- matrix("", (n+2) %/% nc, nc)
ddm[1:n] <- dd
Rich
> system.time(for (i in 1:1) {
+ add <- nc - (length(dd) %% nc)
+ dd2 <- c(dd, rep("", add))
+ ddm <- matrix(dd2, ncol = nc)
+ })
user system elapsed
0.064 0.100
> On Jun 5, 2018, at 9:45 AM, Christopher W Ryan wrote:
>
> I'm writing code for a recurring report, using an R --> Sweave --> pdflatex
> workflow. It includes a character vector of short words that I would like
> to display compactly, in columns on a page, rather than one word per line,
> whi
I'm writing code for a recurring report, using an R --> Sweave --> pdflatex
workflow. It includes a character vector of short words that I would like
to display compactly, in columns on a page, rather than one word per line,
which would waste a lot of space. The vector of words will increase
unpred
5 matches
Mail list logo