Dear list,
Changing the default contrasts used in glm() makes me aware how model.matrix()
set column names.
With default contrasts, model.matrix() use the level values to name the
columns. However with other contrasts, model.matrix() use the level indexes. In
the documentation, I don’t see any
Bert,
I think you read my message differently than I expected. I approached the
request as an exercise in evaluating various ways something can be done and
maybe choosing a simple one or choosing a more general one as needed.
I provided some solutions along the lines you mentioned and THEN also
"If you want a much more compact solution that handles arbitrary pairs of
"what to copy", number_of_copies, you can write a function that evaluates
two arguments at a time or takes two vectors as arguments like this one I
wrote quickly and crudely:"
Please! -- The "times" argument of rep can be a
For the particular example you asked for, consider the "each" you can use
with rep()
rep(1:13, each=84)
This is what it does for a shorter version of 4 each:
> rep(1:13, each=4)
[1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6
7 7 7 7 8 8 8 8 9 9 9 9 10 10
Thank you. Using ‘each’ is shorter code, so better if the requested order was
important versus being an initial solution.
blocC <- c(rep(x=c(1:13), times=84)) #it makes 84 copies of the numbers 1:13
blocC <- arrange(.data = data.frame(blocC), blocC) #sort to get requested order.
blocD <- c(rep(x
Nope. She would have wanted the 'each' argument = 84. See ?rep.
-- Bert
On Thu, Jun 13, 2024 at 3:54 PM Ebert,Timothy Aaron wrote:
> Maybe this was your solution?
>
> blocC <- c(rep(x=c(1:13), times=84))
> blocC <- arrange(.data = data.frame(blocC), blocC)
>
> The second line sorts, but that
Maybe this was your solution?
blocC <- c(rep(x=c(1:13), times=84))
blocC <- arrange(.data = data.frame(blocC), blocC)
The second line sorts, but that may not be needed depending on application. The
object class is also different in the sorted solution.
Tim
-Original Message-
From: R-hel
I apologize, I solved the problem, sorry for that.
f.
Il giorno gio 13 giu 2024 alle ore 16:42 Francesca PANCOTTO <
francesca.panco...@unimore.it> ha scritto:
> Dear Contributors
> I am trying to create a numeric series with repeated numbers, not
> difficult task, but I do not seem to find an e
Dear Contributors
I am trying to create a numeric series with repeated numbers, not difficult
task, but I do not seem to find an efficient way.
This is my solution
blocB <- c(rep(x = 1, times = 84), rep(x = 2, times = 84), rep(x = 3, times
= 84), rep(x = 4, times = 84), rep(x = 5, times = 84), re
В Wed, 12 Jun 2024 23:42:18 +
"Levine, Michael" пишет:
> f.int1 <- function(x,y) {Vectorize (function(y) f(c(x,y),H=H,j=j))}
Vectorize returns a callable function(y), so wrapping it in a
function(x,y) will not work. Since you'd like to integrate over y, we
can perform the same transformation
Dear Ivan,
Thank you very much for your suggestions. I understand what you are saying. I
am afraid I didn't explain well enough what was needed, however. Let us again
restrict ourselves to the case of two dimensions. Then, what I have is a
bivariate density function f(x,y) and my intention is
How do you integrate perpendicular to a plane if you don't have a concept of
3d? In that direction the plane is just a point.
Vectors in R do not have any concept of "n by 1"... they are like a string of
beads. When you take a column out of a matrix `a` using indexing b <- a[,j] the
resulting v
12 matches
Mail list logo