On 8/1/2025 4:15 PM, Rui Barradas wrote:
On 8/1/2025 3:43 PM, Ebert,Timothy Aaron wrote:
I would save the graph as a PowerPoint object and then edit it in
PowerPoint.
library(ggplot2)
library(grid)
library(officer)
library(rvg)
x <- seq(-5, 5, length.out = 100)
y <- x^2
data <- data.f
function(x) x^2,
color = "blue", linewidth = 1.25,
xlim = c(-5, 5)
) +
geom_segment(
data = arrow_data,
mapping = aes(x = x, y = y, xend = xend, yend = yend, group = id),
arrow = arrow(length = unit(0.5, "cm")
On 7/28/2025 5:30 PM, Daniel Lobo wrote:
Many thanks for your guidance. However my original problem is, how to
select n points in the Real line randomly without any preference of
any particular probability distribution?
On Mon, 28 Jul 2025 at 21:45, Rui Barradas wrote:
On 7/28/2025 5:00 PM
On 7/28/2025 5:00 PM, Daniel Lobo wrote:
Hi,
I want to draw a set of random number from Uniform distribution where
Support is the entire Real line.
runif(4, min = -Inf, max = Inf)
However it produces all NAN
Could you please help with the right approach?
_
Hello,
Good point, rm should be reserved for interactive use only.
I didn't thought of lists but if the OP wants to delete junk.A it should be
dta <- list(junk.A = -, junk.B = "junk.A")
dta[dta[["junk.B"]]] <- NULL
dta
#> $junk.B
#> [1] "junk.A&q
unk.B = "junk.A"
rm(list = junk.B)
junk.A
#> Error: object 'junk.A' not found
junk.B
#> [1] "junk.A"
Hope this helps,
Rui Barradas
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.et
39
#> [4,]8 124 108 124 10
#> [5,] NA NA5 11 NA NA5 11
#> [6,] NA NA6 12 NA NA NA NA
(Then I found [1], with a version of cbind.fill equivalent to mine.)
[1] https://stackoverflow.com/a/7962286/8245406
Hope
x, range and others default to na.rm = FALSE. Change at will.
Hope this helps,
Rui Barradas
Às 20:34 de 25/06/2025, Dennis Fisher escreveu:
you are missing the point:
span(…)
requires less typing than
diff(range(….))
just like
paste0
simplifies use of the paste command
;Line 3" ""
Is this specific to Windows and to the way it treats "\r"? When I open
the file in Notepad I only see two text lines, but when I open it with
vim, it's
Line 1^M
Line 3
the carriage return is there.
(And when I paste it here
Line 1
Line 3
the bec
. By grouping for M, I can
kind of stratify the data...
On Sun, Jun 8, 2025 at 6:03 PM Rui Barradas wrote:
Às 07:21 de 08/06/2025, Luigi Marongiu escreveu:
I would like to plot multivariate data with ggplot2. I have multiple
groups that I need to account for: I have the `x` and `y` values, but
d, reproducible code.
Hello,
You can use the 4th variable to define facets. Like this?
ggplot(df, aes(x=x, y=y, colour=w)) +
geom_line(linewidth=2) +
facet_wrap(~ z, scales = "free_x") +
ggtitle("A+B")
Hope this helps,
Rui Barradas
--
Este e-mail foi ana
"%Y%m%d")
#> Error: unexpected ',' in "as,"
as.Date(paste0("202012", "01"), "%Y%m%d")
#> [1] "2020-12-01"
Hope this helps,
Rui Barradas
Dirk
--
Este e-mail foi analisado pelo software antivírus AVG para verific
[2].
[1] https://github.com/ImageMagick/ImageMagick/issues/5509
[2] https://CRAN.R-project.org/package=magick
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
Hello,
And a test for equality of all solutions so far.
do.call(
identical,
list(
1L - x,
+!x,
as.integer(!x),
as.integer(xor(x, 1L))
)
)
#> [1] TRUE
Hope this helps,
Rui Barradas
Às 16:34 de 19/05/2025, Rui Barradas escreveu:
Hello,
You are right, I didn'
Hello,
You are right, I didn't think about that one.
Here is another, esoteric, way.
With `+` substituting for as.integer:
+!x
Hope this helps,
Rui Barradas
Às 09:10 de 19/05/2025, Goodale, Tom escreveu:
Surely doing
y <- 1 - x
would be the simplest way?
Best,
Tom
-
L, 1L, 0L, 0L, 1L, 0L,
#> 0L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 1L,
#> 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L,
#> 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 1L, 1L,
#> 1L)
Hope this helps,
Rui Barradas
--
Este e-mail foi anal
s
windows(12, 9)
plot(1:10)
X11(width = 12, height = 9)
plot(1:10)
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing list -- To
s of one million 2d vectors
system.time(
res1mil <- gen_mat(1e6, a, b, s)
)
#>user system elapsed
#>3.010.063.86
old_par <- par(mfrow = c(1, 2))
hist(res1mil[1L,])
hist(res1mil[2L,])
par(old_par)
Hope this helps,
Rui Barradas
Às 23:31 de 22/04/2025, Rui Barradas
gt; 0) break
}
v <- s - u
if(a[2] < v && v < b[2]) break
}
c(u, v)
}
gen_mat <- function(m, a, b, s) {
replicate(m, one_vec(a, b, s))
}
set.seed(2025)
res <- gen_mat(1, a, b, s)
colSums(res)
Hope this helps,
Rui Barradas
On Tue, 22 Apr 2025 at
Apr 2025 at 20:43, Rui Barradas wrote:
Hello,
Inline.
Às 16:08 de 21/04/2025, Rui Barradas escreveu:
Às 15:27 de 21/04/2025, Brian Smith escreveu:
Hi,
There is a function called RandVec in the package Surrogate which can
generate andom vectors (continuous number) with a fixed sum
The he
Hello,
Inline.
Às 16:08 de 21/04/2025, Rui Barradas escreveu:
Às 15:27 de 21/04/2025, Brian Smith escreveu:
Hi,
There is a function called RandVec in the package Surrogate which can
generate andom vectors (continuous number) with a fixed sum
The help page of this function states that:
a
#>
#> $RandVecOutput
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0.2157416 0.4691191 0.5067447 0.7749258 0.7728955
#> [2,] 0.7842584 0.5308809 0.4932553 0.2250742 0.2271045
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG
Às 14:04 de 14/04/2025, Rui Barradas escreveu:
Às 12:26 de 14/04/2025, Brian Smith escreveu:
Hi,
For my analytical work, I need to draw a sample of certain sample size
from a denied population, where population members are marked by
non-negative integers, such that sum of sample members if
) <= b - a) return(a + x)
}
}
rand.nums(0, 100, Sample_size, Sample_Sum)
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing list -- T
e using S4, read
package Brobdingnag [1] vignette.
vignette("S4_brob", package = "Brobdingnag")
[1] https://CRAN.R-project.org/package=Brobdingnag
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a p
Hello,
I thought of answering "reformulate can solve the problem" but how do
you create quadratic terms with reformulate?
~(Heigh + Ho + Silver + Away)^2
is still a problem with no solution that I know of but paste/as.formula.
Or Bert's bquote or substitute.
Rui Barradas
ear, names_to = "answer", values_to = "counts") %>%
mutate(answer = as.integer(answer == "yes")) %>%
pooledBin(answer ~ counts | year, data = .)
#> year PLower Upper
#> 1 1980 0.001113165 6.831431e-05 0.009052399
#> 2
X-squared = 0.79341, df = 1, p-value = 0.3731
#> alternative hypothesis: two.sided
#> 95 percent confidence interval:
#> -0.02279827 0.06279827
#> sample estimates:
#> prop 1 prop 2
#> 0.66 0.64
chisq.test(mat)
#>
#> Pearson's Chi-squared test with Yates
3 0.2873563
0.2873563
#> [15] 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563
0.2873563
#> [22] 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563
0.2873563
#> [29] 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563 0.2873563
0.2873563
#> [36] 0.2873563 0.2873563 0.
1$par) < Fn(c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09,
0.08, 0.02, 0.02, 0.03, 0.06, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02))
#FALSE
On Fri, 28 Mar 2025 at 00:58, Rui Barradas wrote:
Às 18:35 de 27/03/2025, Daniel Lobo escreveu:
Hi,
I have below minimization problem
MyDat = stru
feval = 1000,
maxiter = 500
)
q1$value
#> [1] -0.1632184
Fn(q1$par)
#> [1] -0.1632184
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r
× 5
#> statut color female male n
#>
#> 1 divorcedblue 100 0 1
#> 2 divorcedred 5050 2
#> 3 married blue 0 100 1
#> 4 married green 0 100 1
#> 5 married red0 100 1
#> 6
Hello,
Sorry, much simpler:
poly(as.matrix(X), degree = 2L)
Hope this helps,
Rui Barradas
Às 13:58 de 25/03/2025, Rui Barradas escreveu:
Hello,
This seems to work and is independent of the number of columns. 'p' is
the output in my previous post.
f <- function(x, data =
Hello,
This seems to work and is independent of the number of columns. 'p' is
the output in my previous post.
f <- function(x, data = X) with(data, eval(parse(text = x)))
p2 <- poly(sapply(names(X), f), degree = 2L)
identical(p, p2)
# [1] TRUE
Hope this helps,
Rui Barrada
.0 34.11147 140.62467
#>
#>
#> $coefs[[2]]
#> $coefs[[2]]$alpha
#> [1] 0.1356218 1.0041956
#>
#> $coefs[[2]]$norm2
#> [1] 1.0 20.0 21.53021 39.73742
#>
#>
#> $coefs[[3]]
#> $coefs[[3]]$alpha
#> [1] 0.2533081 0.1689801
#>
#> $coefs[[3]]$norm
he notes, they are always welcome.
-Original Message-
From: R-help On Behalf Of Rui Barradas
Sent: Saturday, March 15, 2025 5:28 PM
To: Kevin Zembower ; r-help@r-project.org
Subject: Re: [R] What don't I understand about sample()?
Hello,
I have been following this thread and though a
geom_density(color = "red")
alpha <- 1 - (1 - conf.level)/2
interval <- mean(x) + c(-1, 1) * qnorm(alpha) * se
if(plot) {
plot(p)
}
list(boot.statistics = boot.statistics, interval = interval, se = se,
plot = p)
}
Hope this helps,
Rui Barradas
Às 17:28 de 1
reproducible code.
Hello,
The colors COLS are missing from the question.
As for the labels, use
lbls <- c("Condition 1", "Condition 2", "Condition 3", "Control")
and then
scale_colour_manual(values = COLS, labels = lbls)
Hope this helps,
Rui Bar
e-use bits and pieces but perhaps for longer examples, not in prototyping
mode, writing a custom function that passes minimally over the data, may be a
better choice.
-Original Message-
From: R-help On Behalf Of Rui Barradas
Sent: Saturday, February 22, 2025 7:36 AM
To: Dennis Fishe
out <- apply(mat, 1L, \(m) {
ifelse(m[1L] == m[2L], m[1L], paste(m, collapse = "-"))
})
print(out)
}
y <- as_seqInterval(x)
class(y)
#> [1] "seqInterval" "numeric"
# autoprinting y
y
#> [1] "1" "3-5" "7-8&qu
tc)
showConnections()
close(tc)
showConnections()
Hope this helps,
Rui Barradas
-pd
On 5 Feb 2025, at 15:35 , Duncan Murdoch wrote:
Thanks to Rui, Peter and Tanvir! Peter's seems to be the fastest of the 3
suggestions so far on the little test case, but on the real data (where x
cont
more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-
guide.html
and provide commented, minimal, self-contained, reproducible code.
Hello,
Use ?textConnection.
The 5th line is left out, just like in your code.
x <- c("ab
.
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : NULL
#> .. ..$ : chr [1:3] "Count" "Mean" "Var"
# ugly output, the matrix column has its colnames
# prefixed with the data.frame's 2nd column name (mpg).
agg3
#> gear mpg.Count
#> if (is.null(object$y) || is.null(object$qr))
#> object <- update(object, y = TRUE, qr = TRUE, ...)
#> result <- NextMethod()
#> if (plotit)
#> invisible(result)
#> else result
#> }
#>
#>
?NextMethod tells you to look in the def
Às 19:38 de 21/01/2025, Rui Barradas escreveu:
Às 02:18 de 21/01/2025, Sorkin, John escreveu:
I have used ggplot to create a graph on which the y-axis is on the log
scale. (see data and code, below.) I would like to add minor tick
marks, which will also be on the log scale. The data and code
minor_breaks =
rep(log10(seq(1, 9, by=1)), times = n_major) +
rep(major_breaks, each = 9)
return(10^(minor_breaks))
}
}
PopByDayByAQIminus %>%
mutate(Day = factor(Day)) %>%
ggplot(
aes(x = AQI_Cat, y = TotalPop/100,
group = Day,
color = Day,
40,60,80,100),
lot1 = c(118,58,42,35,27,25,21,19,18),
lot2 = c(69,35,26,21,18,16,13,12,12))
fit1 <- glm(lot1 ~ log(u), data = clotting, family = gaussian)
fit2 <- lm(lot1 ~ log(u), data = clotting)
# all of the results below are identically equal
sigma(fit1)
rse(fit1)
sigma(fit2)
rse
er of observations n?
[Ans: n - 2 params == length(weight) - 2]
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing list --
wrap(facets = ~ Species) +
theme(axis.text.x = element_text(angle = 270))
Also, why color the points if the plots are already separated by
Species? Personally, I find it redundant, it adds no information to the
plot.
Unless you want other stuff added to the plot, I would remove
colour = S
[1:3, 1:4] 12 22 32 10 20 30 15 25 35 4 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : NULL
#> .. ..$ : chr [1:4] "mean" "min" "max" "nobs"
# this solves it, the method cbind.data.frame is
# called since the 1st argument is a
base
#
# loaded via a namespace (and not attached):
# [1] compiler_4.4.2
#
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing lis
you don't need to load the package to have access to one of its
data sets,
data(energy, package = "ISwR")
will load it. In this case, it's probably even better, "energy" is not
an uncommon source for data and there might be data sets with the same
name in other p
yr = olddata %>% mutate(first = as.integer(row_number() == 1), .by
= ID)
)
print(mb, order = "median")
However, note that dplyr operates in entire data.frames and therefore is
expected to be slower when tested against instructions that process one
column only.
Hope
ide commented, minimal, self-contained, reproducible code.
Hello,
If you want to shift an entire vector, you don't need the loop, pass the
vector itself to data.table::shift.
x <- data.frame(Id=rep(1:10),num=rep(11:20))
data.table::shift(x[["num"]], n = 1L)
#> [1] N
sorted in ascending order.
ave(olddata$date, olddata$ID, FUN = \(x) x[1L])
#> [1] 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 10 10
If the dates are not sorted,
ave(olddata$date, olddata$ID, FUN = \(x) min(x))
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo softw
the date and
time parts.
x <- "2007-02-01_10:10:30"
as.POSIXct(x, format = "%Y-%m-%d_%H:%M:%S", tz = Sys.timezone())
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
_
<- ymd(dat$date1)
or
dat$date1 <- as.Date(dat$date1)
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing list -- To UNSUBSCR
Or you can test in a small subset of the files
# If this works then it's probably safe to read them all
# (and you don't have to, if it doesn't)
AAR_list <- lapply(filelist[1:3], read.table)
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus
, reproducible code.
Hello,
I find it strange that the error is complaining about the 2nd argument,
W[[1]]$year. It seems that column W[[1]]$Precip exists but not year.
What does
str(W[[1]])
return? A data.frame?
And why sep = "" when reading the files, aren't those files cs
e a functionality that only exists in
your system and this can sometimes be a source for unexpected behavior.
as.character.difftime <- function(x) {
u <- units(x)
paste(unclass(x), u)
}
start_time <- Sys.time()
result <- sum(1:10000)
dur_time <- Sys.time() - start_time
as.characte
Às 08:27 de 18/10/2024, Rui Barradas escreveu:
Às 22:50 de 17/10/2024, Sparks, John escreveu:
Hi R Helpers,
I have been looking for an example of how to execute different dplyr
mutate statements on the same dataframe in a single step. I show how
to do what I want to do by going from df0 to
(MRELGE:MSKC, ~case_when(
.x == 0 ~ 0,
.x == 1 ~ 5,
TRUE ~ -99
)),
MGODRK = case_when(
MGODRK == 0 ~ 0,
MGODRK == 1 ~ 5,
TRUE ~ -99
)
)
identical(df3, df3c)
# [1] TRUE
Hope this helps,
Rui Barradas
--
Est
0", "2024-01-01 12:30"), as.POSIXlt, tz =
"CET")
# as documented in ?mapply > sapply, all attributes are lost,
# after simplification the class attribute follows the hierarchy
# NULL < raw < logical < integer < double < complex < character < list &
this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
; y 1.056885 0.8704518
Hope this helps,
Rui Barradas
Às 13:28 de 04/10/2024, Steven Yen escreveu:
OK. Thanks to all. Suppose I have two vectors, x and y. Is there a way
to do the covariance matrix with “apply”. The matrix I need really
contains the deviation products divided by the degr
zero, it's
only one value therefore it does not vary. A similar reasonong can be
applied to cov(x[1], x[2]), etc.
Hope this helps,
Rui Barradas
Às 12:14 de 04/10/2024, Steven Yen escreveu:
Hello
I have a vector:
set.seed(123) > n<-3 > x<-rnorm(n); x [1] -0.56047565 -0.23
Hello,
If you have a numeric matrix or data.frame, try something like
cov(mtcars)
Hope this helps,
Rui Barradas
Às 10:15 de 04/10/2024, Steven Yen escreveu:
On 10/4/2024 5:13 PM, Steven Yen wrote:
Pardon me!!!
What makes you think this is a homework question? You are not
obligated to
i <- index(dt_ts) >= from & index(dt_ts) <= to
dt_ts[i]
Also, instead of copying&pasting the data, you can attach a file with
extension .txt.
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.c
n question and if
you have doubts translating the Python code to R code, ask us more
specific questions on those doubts.
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
w
(y ~ x, data = df),
lm(y ~ x + I(x^2), data = df)))
mydt[[2L]][1L] |> class()
#> [1] "list"
mydt[[2L]][[1L]] |> class()
#> [1] "lm"
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a prese
Hello,
There is a CRAN Task View: Epidemiology that should be or have what you
are looking for.
[1] https://CRAN.R-project.org/view=Epidemiology
Hope this helps,
Rui Barradas
Às 06:29 de 19/09/2024, Aleena Shaji escreveu:
Dear R Support Team,
I hope this email finds you well.
I am
creates a mean at each position for three subjects,
replacing instead of the value of the single, the group mean.
But when NA appears, all the group gets NA.
Perhaps there is a different way to obtain the same result.
On Mon, 16 Sept 2024 at 11:35, Rui Barradas wrote:
Às 08:28 de 16/09/20
mean(.x, na.rm = TRUE)))
# same result, summarise's new argument .by avoids the need to group_by
db10 %>%
summarise(across(starts_with("cp"), ~ mean(.x, na.rm = TRUE)), .by =
groupid)
Can you post the expected output too?
Hope this helps,
Rui Barradas
--
Este e-mail foi
4 4 3 2 1 3 2112
5 1 NA NA NA NA NA NA NA NA NA NA NA NA
6 2 5 5 10 10 9 10 10 10 NA 109 10", header = TRUE)
df1
library(dplyr)
df1 %>%
mutate(across(starts_with("cp"), ~ +(is.na(.) & id != 1), .names =
"
red$se)
# with more points ahead
predict(model, n.ahead = 2, newxreg = c(10, 12))
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-project.org mailin
ata_POSIX, "%Y-%m-%d") status hs
#> 1 2024-01-02 D 51.2
# the formats in the OP but extracted from the date/time and used in the
formula that follows.
year <- format(mydf$data_POSIX, "%Y")
month <- format(mydf$data_POSIX, "%m")
day <
-Original Message-
From: R-help On Behalf Of Rui Barradas
Sent: Wednesday, August 28, 2024 4:19 AM
To: Francesca PANCOTTO ; r-help@r-project.org
Subject: Re: [R] Fill NA values in columns with values of another column
[External Email]
Às 11:23 de 27/08/2024, Francesca PANCOTTO via R-help escreveu
21
#> 2172
#> 2272
#> 31 103
#> 32 103
#> 4144
#> 4244
#> 5195
#> 5295
#> 6156
#> 6256
#> 7127
#> 7227
#> 8168
#> 8268
Hope this helps,
R
#> version.string R version 4.4.1 (2024-06-14 ucrt)
#> nickname Race for Your Life
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença
de vírus.
www.avg.com
__
R-help@r-proj
own above. Guess I need to read more
about invisible.
On 8/11/2024 10:09 PM, Rui Barradas wrote:
Às 09:51 de 11/08/2024, Steven Yen escreveu:
Hi
In the following codes, I had to choose between printing (= TRUE) or
deliver something for grab (ei, vi). Is there a way to get both--that
is, to
ing 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/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Hello,
Maybe change the end of the code to return a bigger list.
Hello,
.lm.fit is an order of magnitude faster than lm.fit but the Description
section warns on its use, see the examples in help("lm.fit").
Hope this helps,
Rui Barradas
Às 21:08 de 10/08/2024, Yuan Chun Ding via R-help escreveu:
You are right. I also just thought abou
hat you are saying is hardly (not) possible.
If you ever call that code with joint12 set to TRUE, do you reset to
FALSE afterwards?
Can you give a small working example with code and data showing this
behavior?
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antiv
ommunist", "minority", "religious", "social",
"no",
"primary", "middle", "high", "veryh", "somewhath", "notveryh",
"verym", "somewhatm", "notverym&
plot.margin = unit(c(0.2, 0, 0.1, 0), "cm"))
p2 <- df %>%
filter(nm != "A") %>%
ggplot(aes(x = date)) +
geom_col(aes(y = val0), na.rm = TRUE, fill = "white") +
geom_line(aes(y = val1)) +
ylab("") +
facet_wrap(~ nm, scales = "fre
re, see
https://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.
Hello,
Try to remove
scales="free_y"
from facet_wrap(). With scales="f
ot your posted origin date,
# see the examples on Windows and Excel
# dates in help("as.Date")
as.Date(19024, origin = "1970-01-01")
#> [1] "2022-02-01"
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a pre
;-rowSums(tmp)
tem2 <-tmp[row0!=0,]
tmp3 <- cor.test(tem2[,1],tem2[,2])
r[i, j] <- tmp3$estimate
P[i, j] <- tmp3$p.value
}
}
}
r<-as.data.frame(r)
P<-as.data.frame(P)
From: R-help On Behalf Of Yuan Chun Ding via
R-help
Sent: Thursday, July 2
38 0.68452834
#> g2 0.7979717 NA 0.4070838 0.06758329
#> g3 0.4070838 0.40708382NA 1.0000
#> g4 0.6845283 0.06758329 1.000 NA
You can put these two results in a list, like Hmisc::rcorr does.
lst_rcorr <- list(r = r, P = P)
Hope this helps,
Rui Bar
R-help@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/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Hello,
This is not exactly the
Às 17:43 de 18/07/2024, Rui Barradas escreveu:
Às 16:27 de 18/07/2024, SIBYLLE STÖCKLI via R-help escreveu:
Hi
I am using ggplot to visualise y for a two-factorial group (Bio: 0 and
1) x
= 6 years. I was able to adapt the colour of the lines (green and red)
and
the linetype (solid and
d provide commented, minimal, self-contained, reproducible code.
Hello,
To have one legend only, the labels must be the same. Try using
labels=c("ÖLN", "BIO")
in
scale_linetype_manual(values=c("dashed", "solid"), labels=c("ÖLN", "BIO"))
H
algebra
x <- cbind(1, (Dat$Gender == "Male")) %*% coef(Model)
pred1 <- exp(x)/(1 + exp(x))
# use the fitted line equation
y <- coef(Model)[1L] + coef(Model)[2L] * (Dat$Gender == "Male")
pred2 <- exp(y)/(1 + exp(y))
head(predict(Model, type="response"))
head(p
bject it returns and the following
should work.
# this is 'x', a named character vector
coef(fit)
#
fit |> coef() |> names() |> grep("somewhat|very", x = _)
Hope this helps,
Rui Barradas
Às 10:26 de 12/07/2024, Steven Yen escreveu:
Thanks. In this case below, what
p="")
SS[i] <- sum(get(e))
}
SS
#> [1] 55 54 52 49 45
Or all in one instruction with the assistance of ?ls.
# ls(pattern = "^adds") |> mget() |> lapply(sum)
ls(pattern = "^adds") |> mget() |> sapply(sum)
#> adds1 adds2 adds3 adds4 adds5
#>
es)
matrix(nrow = nsims, ncol = 1L + ngrps, dimnames = list(NULL, nms))
}
NSims <- 4
Grps <- 5
create_matrix(NSims, Grps)
#> NSims Value1 Value2 Value3 Value4 Value5
#> [1,]NA NA NA NA NA NA
#> [2,]NA NA NA NA NA NA
#> [3,]
x) - 1L)))
colnames(x) <- nms
x
}
NSims <- 4
Grps <- 5
DiffMeans <- matrix(nrow=NSims,ncol=1+Grps)
names_cols(DiffMeans)
#> NSims Value1 Value2 Value3 Value4 Value5
#> [1,]NA NA NA NA NA NA
#> [2,]NA NA NA NA NA NA
#> [3,]
turn value of lapply
OUTPUT <- lapply(INPUT, \(f) {
mydata <- read.csv(f)
boprobit(eqs, mydata, wt=weight, method="BHHH",
tol=0, reltol=0, gradtol=1e-5, Fisher=TRUE)
})
# assign the output list's names
names(OUTPUT) <- paste0("bop", seq.int(m))
Hope th
line of the output)?
You are right, in the case I posted there were unwanted characters.
Most of the tests I ran there were no additional, unwanted charcters,
though.
This is definitely unstable, that's all I can say.
Hope this helps,
Rui Barradas
Thank you again
Tanguy
1
---
4) GUI: Rgui
Output:
[1] "plot(AirPassengers)" "က \005ⷀǏǭ"
[1] "plot(AirPassengers)"
[1] "plot(AirPassengers)"
[1] "plot(AirPassengers)"
[1] "plot(AirPassengers)"
[1] "plot(AirPassengers)"
[1] "plot(AirPassengers)"
1 - 100 of 1088 matches
Mail list logo