Hi R users,
I have a question about manipulating data. For example, I have DF1 as the
following, how to transform it to a gridded dataset DF2? In DF2, each value
Precip is an attribute of the corresponding grid cell. So DF2 is like a
spatial surface, and can be imported to ArcGIS. Thanks for your
"I'd like to see a cleverer solution that vectorizes..."
and Herve provided it.
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Nov 12, 2018 at 9:43 PM B
It is not clear to what you want for the general case. Perhaps:
> v <- letters[c(2,2,1,2,1,1)]
> wh <- tapply(seq_along(v),factor(v), '[',1)
> w <- wh[match(v,v[wh])]
> w
b b a b a a
1 1 3 1 3 3
> ## and if you want NA's for the first occurences of unique values
> ## of course:
> w[wh] <- NA
> w
Hi,
On 11/12/18 17:08, Duncan Murdoch wrote:
> The duplicated() function gives TRUE if an item in a vector (or row in
> a matrix, etc.) is a duplicate of an earlier item. But what I would
> like to know is which item does it duplicate?
>
> For example,
>
> v <- c("a", "b", "b", "a")
> duplicate
> match(v, unique(v))
[1] 1 2 2 1
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Nov 12, 2018 at 5:08 PM Duncan Murdoch
wrote:
> The duplicated() functi
With two variables there are no combinations with less than 2 observations.
Here's the part of the data you provided:
> df <- structure(list(V1 = c(200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 500, 500, 500,
500, 500, 500, 500, 350, 350, 350, 350, 35
On 2018-11-13 12:55, William Dunlap wrote:
You wrote:
## On Windows 3.4.2
x <- airquality
saveRDS(x, file = "x.rds")
saveRDS(x, file = "y.rds")
Files x.rds and y.rds are identical in size but utterly different in
content.
Wow! Can you show us the results of
x <- datasets::airquality
what about as.integer(factor(v, levels = unique(v)))
I recall very clearly when I realized the power of this feature of
factor(), but I've not seen it discussed much.
Cheers, Mike.
On Tue, 13 Nov 2018 at 12:08 Duncan Murdoch
wrote:
> The duplicated() function gives TRUE if an item in a vecto
The duplicated() function gives TRUE if an item in a vector (or row in a
matrix, etc.) is a duplicate of an earlier item. But what I would like
to know is which item does it duplicate?
For example,
v <- c("a", "b", "b", "a")
duplicated(v)
returns
[1] FALSE FALSE TRUE TRUE
What I want is
thanks for the replies.
i don't believe the data is the problem. here you see how i used 3 variables
and it fails,
but when i use any combination of 2 variables, it does work
> head(df)
V1 V2 V3 V4 V5 V6 V7
1 200 16 16 3 64 5.584092e+13 1.616745e+12
2 200 16 16 3 64 5.58
You wrote:
## On Windows 3.4.2
> x <- airquality
> saveRDS(x, file = "x.rds")
> saveRDS(x, file = "y.rds")
>
Files x.rds and y.rds are identical in size but utterly different in
content.
Wow! Can you show us the results of
x <- datasets::airquality
saveRDS(x, file="x.rds")
saveR
On 11/12/18 12:37 PM, Yectli Huerta via R-help wrote:
> Hello,
>
> I was wondering if there are other packages like MANOVA.RM that could be used
> to analysis non normal distributions. I have to analyze data with more than 2
> predictor variables and a similar number of response variables. When
The error message does not say anything about having more than two predictor
variables. It says that one of the combinations of the predictor variables has
less than 2 observations (i.e. 1 or 0 observations). That is probably an issue
of your sample size. You may need to consider combining some
Dear Bert,
I understand and thanks for your recommendation. Unfortunately I do not
have any possibility to contact a statistical expert at the moment. So this
forum experts' recommendation would be crucial to me to understand how R
works in relation to my question.
I hope that someone could reply t
I could not find the word "censor" in the documentation for the missRanger
package, so I think additional explanation is needed.
Also, I would expect information about censoring to be included in data
provided to a function in a package -- inserting censoring into a package
doesn't make sense.
On 2018-11-12 22:49, peter dalgaard wrote:
Er, where, what, how? I can't reproduce that, at least not on 3.5.1 on
MacOS:
x <- airquality
saveRDS(x, file = "x.rds")
x <- NULL
x <- readRDS(file = "x.rds")
x
Ozone Solar.R Wind Temp Month Day
1 41 190 7.4 67 5 1
2 36
Hello,
I was wondering if there are other packages like MANOVA.RM that could be used
to analysis non normal distributions. I have to analyze data with more than 2
predictor variables and a similar number of response variables. When I try the
function MANOVA.wide with more than 2 predictor varia
You have asked what I believe is an incoherent question, and thus are
unlikely to receive any useful replies (of course, I may be wrong about
this...).
Please read and follow the posting guide linked below to to ask a question
that can be answered.
Bert Gunter
"The trouble with having an open m
Hi,
does anybody know where I need to insert the censoring in the missRanger
package?
Regards,
Rebecca
__
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 h
Generally speaking, this list is about questions on R programming, not
statistical issues. However, I grant you that your queries are in something
of a gray area intersecting both.
Nevertheless, based on your admitted confusion, I would recommend that you
find a local statistical expert with whom
Dear Peter and Eik,
I am very grateful to you for your replies.
My current understanding is that from the GLM analysis I can indeed
conclude that the response predicted by System A is significantly different
from that of System B, while the pairwise comparison A vs C leads to non
significance. Now
Yes, only one of the pairwise comparisons (B vs. C) is right. Also, the overall
test has 3 degrees of freedom whereas a comparison of 3 groups should have 2.
You (meaning Frodo) are testing that _all 3_ regression coefficients are zero,
intercept included. That would imply that all three systems
Dear Jedi,
please use the source carefully. A and C are not statistically different
at the 5% level, which can be inferred from glm output. Your last two
wald.tests don't test what you want to, since your model contains an
intercept term. You specified contrasts which tests A vs B-A, ie A-
(B-
Dear Petr,
thank you very much for your feedback.
Can anyone in the list advise me if the way I report the results is correct?
Kind regards
FJ
On Mon, Nov 12, 2018 at 1:02 PM PIKAL Petr wrote:
> Hi Frodo
>
>
>
> I do not consider myself as an arbiter in statistical results and their
> presen
Hi Frodo
I do not consider myself as an arbiter in statistical results and their
presentation. Again your text seems to as good as any other.
You should keep responses to mailing list as others could have another opinion.
Cheers
Petr
From: Frodo Jedi
Sent: Monday, November 12, 2018 1:48 PM
T
Dear Frodo (or Jedi)
The results seems to confirm your assumption that 3 systems are different. How
you should present results probably depends on how it is usual to report such
results in your environment.
BTW. It seems to me like homework and this list has no homework policy (Sorry,
if I am
The solution was very simple. Don't use the same name for the rds
file as used for the R object, viz a vie:
saveRDS(x, file = "x.rds")
and
x <- readRDS(file = "x.rds")
will not work; however
saveRDS(x, file = "y.rds")
and
x <- readRDS(file = "y.rds")
will work.
An undocumented feature?
Thank
27 matches
Mail list logo