Well, something like:
LAP <- ifelse(gender =='male', (WC-65)*TG, (WC-58)*TG)
The exact code depends on whether your variables are in a data frame or
list or whatever, which you failed to specify. If so, ?with may be useful.
Cheers,
Bert
On Fri, Nov 3, 2023 at 3:43 AM Md. Kamruzzaman wrote:
It's still kind of weird; embedded 2-column data frames print differently than
1-column ones:
> d <- data.frame(a=1, b=I(data.frame(d=1,e=2)))
> d
a b.d b.e
1 1 1 2
> str(d)
'data.frame': 1 obs. of 2 variables:
$ a: num 1
$ b:Classes 'AsIs' and 'data.frame': 1 obs. of 2 variables:
Hello Everyone,
I have three variables: Waist circumference (WC), serum triglyceride (TG)
level and gender. Waist circumference and serum triglyceride is numeric and
gender (male and female) is categorical. From these three variables, I want
to calculate the "Lipid Accumulation Product (LAP)
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
Thank you very much for your help. It is very much appreciated.
On Fri, Nov 3, 2023 at 7:23 AM roslinazairimah zakaria
wrote:
> Dear all,
>
> I have this set of data. I would like to sum the EnergykWh according date
> sequences.
>
> > head(dt1,20) StationName date time
Hi all,
This is the data:
> dput(head(dt1,20))structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE
> #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
How about send a 'dput' of some sample data. My guess is that your date is
'character' and not 'Date'.
Thanks
Jim Holtman
*Data Munger Guru*
*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*
On Thu, Nov 2, 2023 at 4:24 PM
date appears to be a character variable, and R is treating it as such.
str(dt1)
might give you some insight. Or the dplyr equivalent
glimpse(dt1)
I think R did what you asked, but if you want to be able to order
records by date, in temporal order, you need to tell R that it is a date:
Dear all,
I have this set of data. I would like to sum the EnergykWh according date
sequences.
> head(dt1,20) StationName date time EnergykWh
1 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 12:09 4.680496
2 PALO ALTO CA / CAMBRIDGE #1 1/14/2016 19:50 6.272414
3 PALO ALTO CA
В Wed, 25 Oct 2023 09:18:26 +0300
"Christian Asseburg" пишет:
> > str(x)
> 'data.frame': 1 obs. of 3 variables:
> $ A: num 1
> $ B: num 1
> $ C:'data.frame': 1 obs. of 1 variable:
> ..$ A: num 1
>
> Why does the print(x) not show "C" as the name of the third element?
I think it is more clear-cut than so, at least if the Poisson situation is
something to go by.
There, you can do either of these and get equivalent results
> fit.lung <- glm(cases ~ age + city, offset=log(pop),
+ family=poisson, data=lungcancer)
> fit.lung2 <- glm(cases/pop ~
> On Nov 1, 2023, at 6:06 AM, Kim Emilia wrote:
>
> Hello all,
>
> I would like to take down my packages posted/created on the website rdrr.io.
> [https://rdrr.io/] Is there any way to take down packages from the website?
> It would be appreciated if you suggested/offered a way to remove the
There is a github site with an issues list:
https://github.com/rdrr-io/rdrr-issues/issues
It looks like people have successfully requested removal in the past,
e.g. https://github.com/rdrr-io/rdrr-issues/issues/113
On 2023-11-01 9:06 a.m., Kim Emilia wrote:
Hello all,
I would like to
В Wed, 1 Nov 2023 22:06:27 +0900
Kim Emilia пишет:
> I would like to take down my packages posted/created on the website
> rdrr.io.
I think it's unlikely to find people affiliated with rdrr.io here on
the R-help mailing list. Have you tried contacting the website author
via the links at the
Hello all,
I would like to take down my packages posted/created on the website rdrr.io.
[https://rdrr.io/] Is there any way to take down packages from the website?
It would be appreciated if you suggested/offered a way to remove the
package from the website.
Thank you.
[[alternative
> On Oct 22, 2023, at 4:01 PM, Bert Gunter wrote:
>
> No error message shown Please include the error message so that it is
> not necessary to rerun your code. This might enable someone to see the
> problem without running the code (e.g. downloading packages, etc.)
>
> -- Bert
>
> On Sun,
Às 20:55 de 30/10/2023, Kevin Zembower via R-help escreveu:
Hello,
I'm trying to plot a graph of blood glucose versus date. I also record
conditions, such as missing the previous night's medications, and
missing exercise on the previous day. My data looks like:
b2[68:74,]
# A tibble: 7 × 5
Tim, thanks, it helps very much. It works like a charm.
Wow, there's so much I don't understand about ggplot2 functions,
especially the aes() function. I just discovered the ggplot2-book.org
site, and I hope to read it slowly and carefully over the next couple
of weeks.
Thanks again, Tim, for
[Please keep r-help in the cc: list]
I don't quite know how to interpret the difference between specifying
effort as an offset vs. as weights; I would have to spend more time
thinking about it/working through it than I have available at the moment.
I don't know that specifying effort
No attachments. Most are deleted by ETH mailman ... because they might
contain viruses.
-- Bert
On Tue, Oct 31, 2023 at 8:59 AM David Croll wrote:
> I just received a virus warning from my e-mail provider, GMX. See the
> attached image below.
>
> The virus detection can be spurious - but the
I just received a virus warning from my e-mail provider, GMX. See the
attached image below.
The virus detection can be spurious - but the e-mail was automatically
deleted by GMX.
With the best regards,
David
__
R-help@r-project.org mailing list --
I believe the missing shapes are because you had set alpha=0 for the last geom
point.
I expect there are better ways, but one way to handle it would be to avoid the
filtering, adding columns with med and exercise status, like the following:
# setup with data provided
Date <- c('2023-10-17',
The build system rolled up R-4.3.2.tar.gz (codename "Eye Holes") this morning.
This is a minor update, with a few bug fixes.
The list below details the changes in this release.
You can get the source code from
https://cran.r-project.org/src/base/R-4/R-4.3.2.tar.gz
or wait for it to be
Dear R community,
Just a quick note about a new package on CRAN called makeit. Yesterday, I
added a vignette and released as 1.0.1:
https://cran.r-project.org/package=makeit
https://cran.r-project.org/web/packages/makeit/vignettes/makeit.html
It provides a simple but powerful function make()
Hello,
I'm trying to plot a graph of blood glucose versus date. I also record
conditions, such as missing the previous night's medications, and
missing exercise on the previous day. My data looks like:
> b2[68:74,]
# A tibble: 7 × 5
Date Time bg missed_meds no_exercise
> Iris Simmons
> on Mon, 30 Oct 2023 06:37:04 -0400 writes:
> If you don't know the name of the attributes in advance,
> how can you know the function name to be able to call it?
> This seems like a very flawed approach.
> Also, I would discourage the use of
> Duncan Murdoch
> on Sun, 29 Oct 2023 04:45:19 -0400 writes:
> On 29/10/2023 3:48 a.m., Shu Fai Cheung wrote:
>> Hi all,
>>
>> Just a minor issue that I am not sure whether this is
>> considered a "bug." It is about the help page.
>>
>> In the help page
If you don't know the name of the attributes in advance, how can you know
the function name to be able to call it? This seems like a very flawed
approach.
Also, I would discourage the use of eval(parse(text = )), it's almost
always not the right way to do what you want to do. In your case,
Hi,
n a package, I have a data object with attributes, and I want to
dynamically create a convenience function to access those attributes.
This way, instead of using attr(x, "number"), I would like to use number(x).
Because I don't know in advance which attributes the data object may
On 29/10/2023 3:48 a.m., Shu Fai Cheung wrote:
Hi all,
Just a minor issue that I am not sure whether this is considered a
"bug." It is about the help page.
In the help page of printCoefmat(), for the argument 'eps.Pvalue', the
description is as below:
number, ..
I have to read the source to
Hi all,
Just a minor issue that I am not sure whether this is considered a
"bug." It is about the help page.
In the help page of printCoefmat(), for the argument 'eps.Pvalue', the
description is as below:
number, ..
I have to read the source to figure out that this argument is to be
used by
Jef, your terse reply was so constructive that you converted me! LOL!
That is an interesting point though that I remain a bit unclear on.
Both data.frame and as.data.frame can be used in some ways similarly as in:
> data.frame(matrix(1:12, nrow=3))
X1 X2 X3 X4
1 1 4 7 10
2 2 5 8 11
3
On 28/10/2023 4:45 p.m., Bert Gunter wrote:
Jeff, et. al. : but ...
Note that as.data.frame() *already* changes the matrix object by adding
column names of *its own choosing* when the matrix has none. So the issue
here is not *whether* col names should be added, but *what*/*how* they
should be.
Jeff, et. al. : but ...
Note that as.data.frame() *already* changes the matrix object by adding
column names of *its own choosing* when the matrix has none. So the issue
here is not *whether* col names should be added, but *what*/*how* they
should be. Unless you wish to extend your criticism to
Dear Rui,
I really thank you a lot for your precious R help. It is exactly what I was
trying to do! Once more, many thanks!
Best,
Sacha
Le vendredi 27 octobre 2023 à 09:36:18 UTC+2, Rui Barradas
a écrit :
Às 19:23 de 26/10/2023, varin sacha via R-help escreveu:
> Dear R-Experts,
>
Ah - that's an excellent point. Thanks.
> On Oct 28, 2023, at 14:54, Jeff Newmiller wrote:
>
> as.data.frame is a _converter_, while data.frame is a _constructor_.
> Changing the object contents is not what a conversion is for.
>
> On October 28, 2023 11:39:22 AM PDT, Boris Steipe
>
as.data.frame is a _converter_, while data.frame is a _constructor_. Changing
the object contents is not what a conversion is for.
On October 28, 2023 11:39:22 AM PDT, Boris Steipe
wrote:
>Thanks Duncan and Avi!
>
>That you could use NULL in a matrix() dimnames = list(...) argument wasn't
Thanks Duncan and Avi!
That you could use NULL in a matrix() dimnames = list(...) argument wasn't
clear to me. I thought that would be equivalent to a one-element list - and
thereby define rownames. So that's good to know.
The documentation could be more explicit - but it is probably more work
Борис,
Try this where you tell matrix the column names you want:
nouns <- as.data.frame(
matrix(c(
"gaggle",
"geese",
"dule",
"doves",
"wake",
"vultures"
),
ncol = 2,
byrow = TRUE,
dimnames=list(NULL, c("collective", "category"
Result:
> nouns
Using an offset of log(Effort) as in your second model is the more
standard way to approach this problem; it corresponds to assuming that
catch is strictly proportional to effort. Adding log(Effort) as a
covariate (as illustrated below) tests whether a power-law model (catch
propto
Sent a slightly shorter version of this to your email, this one is to
the list:
On 28/10/2023 1:54 p.m., Boris Steipe wrote:
> > I have been trying to create a data frame from some structured text
in a single expression. Reprex:
> >
> > nouns <- as.data.frame(
> >matrix(c(
> >
I have been trying to create a data frame from some structured text in a single
expression. Reprex:
nouns <- as.data.frame(
matrix(c(
"gaggle",
"geese",
"dule",
"doves",
"wake",
"vultures"
), ncol = 2, byrow = TRUE),
col.names = c("collective", "category")
You can also use the pivot_longer to do it:
library(tidyverse)
input <- structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465,
28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933,
19.3120917, 113.12581575, 28.45843425, 114.400074, 143.925,
46.439634, 20.7845679, 50.82874575,
Paul,
I have snipped away your long message and want to suggest another approach
or way of thinking to consider.
You have received other good suggestions and I likely would have used
something like that, probably within the dplyr/tidyverse but consider
something simpler.
You seem to be viewing
Às 04:13 de 28/10/2023, Paul Bernal escreveu:
Dear friends,
I have the following dataframe:
dim(alajuela_df)
[1] 126 12
dput(alajuela_df)
structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465,
28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933,
19.3120917, 113.12581575,
The tidyverse idiom looks very different but does what you want and I have come
to like it.
What idiom of R one likes, for the mostly small datasets I handle, is largely a
matter
of preferenceds for "readability", itself very personal. Here's my tidyverse
way of doing
what you wanted:
###
Colleagues,
I have a dataset that includes five variables.
- Catch: the catch number counted in some species (ind.)
- Effort: fishing effort (the number of fishing vessels)
- xx1, xx2, xx3: some environmental factors
As an overdispersion test on the “Catch” variable, I modeled with negative
Hi Iris,
Thank you so much for your valuable feedback. I wonder why your code gives
you 1512 rows, given that the original structure has 12 columns and 126
rows, so I would expect (125*12)+ 9=1,509 total rows.
Cheers,
Paul
El El vie, 27 de oct. de 2023 a la(s) 10:40 p. m., Iris Simmons <
You are not getting the structure you want because the indexes are
wrong. They should be something more like this:
i <- 0
for (row in 1:nrow(alajuela_df)){
for (col in 1:ncol(alajuela_df)){
i <- i + 1
df[i,1]=alajuela_df[row,col]
}
}
but I think what you are doing can be written much
Dear friends,
I have the following dataframe:
dim(alajuela_df)
[1] 126 12
dput(alajuela_df)
structure(list(...1 = c(92.9925354, 76.0024254, 44.99547465,
28.00536465, 120.0068103, 31.9980405, 85.0071837, 40.1532933,
19.3120917, 113.12581575, 28.45843425, 114.400074, 143.925,
46.439634,
Dear Bert,
Thank you very much for your quick reply.
I have tested this, and it indeed appears to be the source of the discrepancy I
observed.
My apologies for overlooking this in the documentation and thank you for
clarifying.
Cheers,
Jan
From: Bert Gunter
Às 19:23 de 26/10/2023, varin sacha via R-help escreveu:
Dear R-Experts,
Here below my R code working but I don't know how to complete/finish my R code
to get the final plot with the extrapolation for the10 more years.
Indeed, I try to extrapolate my data with a linear fit over the next 10
Incidentally, if all you wanted to do was plot fitted values, the
predict method is kinda overkill, as it's just the fitted line from
the model. But I assume you wanted to plot CI's/PI's also, as the
example illustrated.
-- Bert
On Thu, Oct 26, 2023 at 1:56 PM Bert Gunter wrote:
>
> from
from ?predict.lm:
"predict.lm produces a vector of predictions or a matrix of
predictions and bounds with column names fit, lwr, and upr if interval
is set. "
ergo:
predict(model, dfuture, interval = "prediction")[,"fit"] ## or [,1]
as it's the first column in the returned matrix
is your
Hmm, I can't replicate (i.e., it works fine for me). What are the
results of your sessionInfo() (from a *clean* R session)?
==
R Under development (unstable) (2023-10-25 r85410)
Platform: x86_64-pc-linux-gnu
Running under: Pop!_OS 22.04 LTS
Matrix products: default
BLAS:
Hello Colleagues,
I am trying to get the Git repository using *remotes* package. I am
using *remotes::install_github("dcl-docs/dcldata")
*to get the Git repo.
However, I am getting the following error message. I have absolutely no
idea on what this error message means and how to get away with
Dear R-Experts,
Here below my R code working but I don't know how to complete/finish my R code
to get the final plot with the extrapolation for the10 more years.
Indeed, I try to extrapolate my data with a linear fit over the next 10 years.
So I create a date sequence for the next 10 years and
Apologies in advance if my comments don't help, in which case, no need
to respond, but I noted in ?ksmooth:
"bandwidth
the bandwidth. The kernels are scaled so that their quartiles (viewed
as probability densities) are at ± 0.25*bandwidth." So, could this be
a source of the discrepancies you
Dear R users! Thank you for your excellent replies. I didn't know that the
print.data.frame expands matrix-like values in this way. Why doesn't it call
the column in my example C.A? I understand that something like that happens
when the data.frame in position three has multiple columns. But
Dear Sir, Madam, or to whom this may concern,
my name is Jan Failenschmid and I am a Ph.D. student at Tilburg University.
For my project I have been looking into different types of kernel regression
estimators and corresponding R functions.
While comparing different functions I noticed that
I recommend cutting snippets out of your code by stopping the code at the point
of interest and using dput() to pull out "data as it is" before the troublesome
section and then using the reprex package to test that the snippet runs.
Either you will notice the problem on your own while taking
Hi,
It isn't at all clear to me what you're trying to do. For one thing,
you never actually add more items to cat.ref in the code snippet you
give.
You do use c() on zx.ref - is that what you mean?
But you aren't adding cat.ref to it, you're adding v$cat.ref, and I
have no idea what that might
Dear All
My program is long and sorry I do not have a replicable set of codes to
present. But I present a chunk of codes at the end below. Essentially,
1. I initialize cat.ref as NUL (see line 1)
2. Then, I repeatedly add elements to cat.ref, where each element
include parentheses in double
Hello,
Inline.
Às 13:32 de 26/10/2023, Ebert,Timothy Aaron escreveu:
The "problem" goes away if you use
x$C <- y[1,]
Actually, if I understand correctly, the OP wants the column:
x$C <- y[,1]
In this case it will produce the same output because y is a df with only
one row. But that is
The "problem" goes away if you use
x$C <- y[1,]
If you have another row in your x, say:
x <- data.frame(A=c(1,4), B=c(2,5), C=c(3,6))
then your code
x$C <- y[1]
returns an error.
If y has the same number of rows as x$C then R has the same outcome as in your
example.
It looks like your code
Às 07:18 de 25/10/2023, Christian Asseburg escreveu:
Hi! I came across this unexpected behaviour in R. First I thought it was a bug in
the assignment operator <- but now I think it's maybe a bug in the way data
frames are being printed. What do you think?
Using R 4.3.1:
x <- data.frame(A =
On 25/10/2023 2:18 a.m., Christian Asseburg wrote:
Hi! I came across this unexpected behaviour in R. First I thought it was a bug in
the assignment operator <- but now I think it's maybe a bug in the way data
frames are being printed. What do you think?
Using R 4.3.1:
x <- data.frame(A = 1,
I would say this is not an error, but I think what you wrote isn't
what you intended to do anyway.
y[1] is a data.frame which contains only the first column of y, which
you assign to x$C, so now x$C is a data.frame.
R allows data.frame to be plain vectors as well as matrices and
data.frames,
Hi! I came across this unexpected behaviour in R. First I thought it was a bug
in the assignment operator <- but now I think it's maybe a bug in the way data
frames are being printed. What do you think?
Using R 4.3.1:
> x <- data.frame(A = 1, B = 2, C = 3)
> y <- data.frame(A = 1)
> x
A B C
Dear Bert,
Many thanks for your suggestion! I am reading the section to
understand more about this topic. It is highly relevant to what I plan
to work on.
Regards,
Shu Fai
On Thu, Oct 26, 2023 at 5:38 AM Bert Gunter wrote:
>
> As you seem to have a need for this sort of capability (e.g.
As you seem to have a need for this sort of capability (e.g. bquote),
see Section 6: "Computing on the Language" in the R Language
Definition manual. Actually, if you are interested in a concise
(albeit dense) overview of the R Language, you might consider going
through the whole manual.
Cheers,
Actually a better solution would be to make PID into a factor. They can
always be coerced to a number, but will display with your meaningful labels.
Duncan Murdoch
On 25/10/2023 3:38 p.m., Duncan Murdoch wrote:
I don't see it documented, but it appears that the gee() function
assumes the id
I don't see it documented, but it appears that the gee() function
assumes the id variable can be coerced to a number. Your ids are in
PID, and are strings like "HIPS004", etc. Change that to "004" or a
numeric 4 and the error goes away.
Duncan Murdoch
On 25/10/2023 3:23 p.m., Sorkin, John
Colleagues,
I am receiving several error messages from the gee function. I don't understand
the ides the error messages are trying to impart, and I don't know how to debug
or correct the error. The error messages follow:
> fitgee <- gee(HipFlex ~
>
Às 00:22 de 25/10/2023, Sorkin, John escreveu:
Colleagues,
I have written an R function (see fully annotated code below), with which I
want to process a dataframe within levels of the variable StepType. My program
works, it processes the data within levels of StepType, but the usual headers
Dear John,
Printing inside the function is problematic. Your function itself does
NOT print the labels.
Just as a clarification:
F = factor(rep(1:2, 2))
by(data.frame(V = 1:4, F = F), F, function(x) { print(x); return(NULL); } )
# V F
# 1 1 1
# 3 3 1
# V F
# 2 2 2
# 4 4 2
# F: 1 <- this
Dear Iris,
Many many thanks! This is exactly what I need! I have never heard
about bquote(). This function will also be useful to me on other
occasions.
I still have a lot to learn about the R language ...
Regards,
Shu Fai
On Wed, Oct 25, 2023 at 5:24 PM Iris Simmons wrote:
>
> You can try
You can try either of these:
expr <- bquote(lm(.(as.formula(mod)), dat))
lm_out5 <- eval(expr)
expr <- call("lm", as.formula(mod), as.symbol("dat"))
lm_out6 <- eval(expr)
but bquote is usually easier and good enough.
On Wed, Oct 25, 2023, 05:10 Shu Fai Cheung wrote:
> Hi All,
>
> I have a
Sorry for a typo, regarding the first attempt, lm_out2, using
do.call(), I meant:
'It does have the formula, "as a formula": y ~ x1 + x2.
However, the name "dat" is evaluated. ...'
Regards,
Shu Fai
On Wed, Oct 25, 2023 at 5:09 PM Shu Fai Cheung wrote:
>
> Hi All,
>
> I have a problem that may
Hi All,
I have a problem that may have a simple solution, but I am not
familiar with creating calls manually.
This is example calling lm()
``` r
set.seed(1234)
n <- 10
dat <- data.frame(x1 = rnorm(n),
x2 = rnorm(n),
y = rnorm(n))
lm_out <- lm(y ~ x1 + x2,
Colleagues,
I have written an R function (see fully annotated code below), with which I
want to process a dataframe within levels of the variable StepType. My program
works, it processes the data within levels of StepType, but the usual headers
that separate the output by levels of StepType
Dear Rui,
I really thank you a lot for your response and your R code.
Best,
Sacha
Le mardi 24 octobre 2023 à 16:37:56 UTC+2, Rui Barradas
a écrit :
Às 20:12 de 23/10/2023, varin sacha via R-help escreveu:
> Dear R-experts,
>
> I really thank you all a lot for your responses. So, here
A variation is to remove Well and then we can use dot to refer to the
remaining columns.
aggregate(cbind(OD, ODnorm) ~ . , subset(df, select = - Well), mean)
On Tue, Oct 24, 2023 at 8:32 AM Luigi Marongiu wrote:
>
> Hello,
> I have a data frame with different groups (Time, Target, Conc) and
Às 20:12 de 23/10/2023, varin sacha via R-help escreveu:
Dear R-experts,
I really thank you all a lot for your responses. So, here is the error (and
warning) messages at the end of my R code.
Many thanks for your help.
Error in UseMethod("predict") :
no applicable method for 'predict'
Thank you
On Tue, Oct 24, 2023 at 3:01 PM peter dalgaard wrote:
>
> Also,
>
> > aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean")
> Time Target Conc ODODnorm
> 11 BACT1 765. 108.3
> 21 BACT2 745. 88.3
> 31 BACT
Also,
> aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc ODODnorm
11 BACT1 765. 108.3
21 BACT2 745. 88.3
31 BACT3 675. 18.0
(You might wish for "cbind(OD,ODnorm) ~ . - Well", but
Thank you, the last is exactly what I was looking for.
On Tue, Oct 24, 2023 at 2:41 PM Sarah Goslee wrote:
>
> Hi,
>
> I think you're misunderstanding which set of variables go on either
> side of the formula.
>
> Is this what you're looking for?
>
> > aggregate(OD ~ Time + Target + Conc, data =
Hi,
I think you're misunderstanding which set of variables go on either
side of the formula.
Is this what you're looking for?
> aggregate(OD ~ Time + Target + Conc, data = df, FUN = "mean")
Time Target Conc OD
11 BACT1 765.
21 BACT2 745.
31 BACT3
Hello,
I have a data frame with different groups (Time, Target, Conc) and
each entry has a triplicate value of the measurements OD and ODnorm.
How can I merge the triplicates into a single mean value?
I tried the following:
```
df = data.frame(Time=rep(1, 9), Well=paste("A", 1:9, sep=""),
This seems to work. A couple of fine points, including handling duplicated Pct
values right, which is easier if you do the reversed cumsum.
> dd2 <- dummydata[order(dummydata$Pct),]
> dd2$Cum <- rev(cumsum(rev(dd2$Totpop)))
> use <- !duplicated(dd2$Pct)
> approx(dd2$Pct[use], dd2$Cum[use], ctof,
Hi Ben, Martin and all,
The function, glmnetcv, in the spm2 package was developed for the following
main reasons:
1. The training and testing samples were generated using a stratified
random sampling method instead of a simple random sampling method. By doing
this, we hoped that it may be able to
Dear R-experts,
I really thank you all a lot for your responses. So, here is the error (and
warning) messages at the end of my R code.
Many thanks for your help.
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "c('matrix',
'array', 'double',
For what it's worth it looks like spm2 is specifically for *spatial*
predictive modeling; presumably its version of CV is doing something
spatially aware.
I agree that glmnet is old and reliable. One might want to use a
tidymodels wrapper to create pipelines where you can more easily
Dear Nader Habibzadeh,
В Sat, 21 Oct 2023 15:11:23 +0330
Nader Habibzadeh пишет:
> I came across the same issue you have demonstrated in "r-help" but
> with the shiny package installation.
Do any of the replies to Murat's question, e.g. [1], help?
If you have a different problem, let us know
> Jin Li
> on Mon, 23 Oct 2023 15:42:14 +1100 writes:
> If you are interested in other validation methods (e.g., LOO or n-fold)
> with more predictive accuracy measures, the function, glmnetcv, in the
spm2
> package can be directly used, and some reproducible examples
Dear Murat,
I came across the same issue you have demonstrated in "r-help" but with the
shiny package installation. I was wondering if you could send me any
information that you have gotten for figuring out this problem.
Best regards,
Nader
--
*Nader Habibzadeh, Ph.D.,*
*Department of
If you are interested in other validation methods (e.g., LOO or n-fold)
with more predictive accuracy measures, the function, glmnetcv, in the spm2
package can be directly used, and some reproducible examples are
also available in ?glmnetcv.
On Mon, Oct 23, 2023 at 10:59 AM Duncan Murdoch
wrote:
On 22/10/2023 7:01 p.m., Bert Gunter wrote:
No error message shown Please include the error message so that it is
not necessary to rerun your code. This might enable someone to see the
problem without running the code (e.g. downloading packages, etc.)
And it's not necessarily true that someone
No error message shown Please include the error message so that it is
not necessary to rerun your code. This might enable someone to see the
problem without running the code (e.g. downloading packages, etc.)
-- Bert
On Sun, Oct 22, 2023 at 1:36 PM varin sacha via R-help
wrote:
>
> Dear
Buen día,
Por favor alguien, sabe como generar un raster de tendencia ?
[[alternative HTML version deleted]]
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es
1401 - 1500 of 269297 matches
Mail list logo