Thanks, David, Rui and Jeff!!! The function order works much better.
I should have used an example where the permutation and its inverse are not
identical:
> i <- order(c("B", "C", "A"))
> i
[1] 3 1 2
> c("D","E", "F")[i]
[1] "F" "D" "E"
> c("D","E", "F")[order(i)]
[1] "E" "F" "D"
2018-05-23 14:
Hi.
I dunno what you are doing wrong.
After that
> library(ggplot2)
> df<-data.frame(x1=c(1,2), y1=c(3,4),z1=c(5,6),w1=c(7,8))
> library(reshape2)
> dfm<-melt(df)
No id variables; using all as measure variables
> dfm$variable<-factor(dfm$variable, levels=levels(dfm$variable)[c(2,1,3,4)])
> p2<-g
Hello,
Like David said, what you are trying to do with sort() can be done with
order() in a much easier way.
First, your code
x <- sort(c("bc","ac","dd"), index.return=TRUE)
Now, with function order()
i <- order(c("bc", "ac", "dd"))
y <- c("D","E", "F")[i]
y
#[1] "E" "D" "F"
# This will
Hi Everyone,
I am using ASReml to fit a spatial model. I do not have all the components
of ASReml when I call;
names(summary())
e.g.
names(summary(fcov.asr2))
[1] "call""loglik" "nedf""sigma" "varcomp"
I am trying to get the coefs but I get "NULL".
Does anybody know the reason?
Any
> On May 22, 2018, at 11:37 PM, John wrote:
>
>
> > sort(c("bc","ac","dd"), index.return=TRUE)
> $x
> [1] "ac" "bc" "dd"
>
> $ix
> [1] 2 1 3
>
>
> We have the permutation, namely 1-->2, 2-->1, 3-->3.
> How can I apply the permutation function to a new set
> c("D","E", "F")?
> so that the
Perhaps the question was "what is indexing"?
On May 23, 2018 5:06:39 AM GMT+02:00, David Winsemius
wrote:
>
>
>> On May 22, 2018, at 10:57 PM, John wrote:
>>
>> Thanks, David.
>> I got the answer from the web.
>> Is there any easy way to permute a set (e.g., a set of characters) by
>the perm
Hi
You need to be careful - you are grid.echo()ing (and then
grid.grab()ing) on full-size pages and then redrawing in half-height
pages, which is why you lose the x-axis labels in the result from
grid.arrange().
This gives a better result (grid.echo() directly in the half-height
viewports)
> sort(c("bc","ac","dd"), index.return=TRUE)
$x
[1] "ac" "bc" "dd"
$ix
[1] 2 1 3
We have the permutation, namely 1-->2, 2-->1, 3-->3.
How can I apply the permutation function to a new set
c("D","E", "F")?
so that the result is
c("E","D", "F").
2018-05-23 11:06 GMT+08:00 David Winsemius :
>
> On May 22, 2018, at 10:57 PM, John wrote:
>
> Thanks, David.
> I got the answer from the web.
> Is there any easy way to permute a set (e.g., a set of characters) by the
> permutation it returns? Thanks,
>
>
> > x <- c(10,7,4,3,8,2)
> > sort(x, index.return=TRUE)
> $x
> [1] 2 3 4 7
Thanks, David.
I got the answer from the web.
Is there any easy way to permute a set (e.g., a set of characters) by the
permutation it returns? Thanks,
> x <- c(10,7,4,3,8,2)
> sort(x, index.return=TRUE)
$x
[1] 2 3 4 7 8 10
$ix
[1] 6 4 3 2 5 1
2018-05-23 10:49 GMT+08:00 David Winsemius :
> On May 22, 2018, at 10:06 PM, John wrote:
>
> Hi,
>
> Is there any way to find the permutation function of the sorting and to
> apply the function (or its inverse) elsewhere?
>
> For example, the following permutation function from the sorting in the
> matrix form is
> c(1,2,3), c(2,1,3
Many thanks,
My goal is to make a plott like attached but the Y axis starts in XIV and
end at top in I. Generally for instance in excel X axis is categories but
Y axis is numbers I want the contrary plotted in lines, your last help is
near what I look but barplot is not needed.
Hope you can help
Hi,
Is there any way to find the permutation function of the sorting and to
apply the function (or its inverse) elsewhere?
For example, the following permutation function from the sorting in the
matrix form is
c(1,2,3), c(2,1,3)
> sort(c("bc","ac","dd"))
[1] "ac" "bc" "dd"
I try to fin
Hi,
I ran your code, but the results were not as expected. After I ran the
code by "source", it return
No id variables; using all as measure variables
> p2
and no line or legend is on the graph (as attached)
Am I doing anything wrong?
John
library(ggplot2)
library(reshape2)
dfm<-mel
Greetings
On linux, is it possible to invoke an OS command from within R without
spawning a child process? If not, is it possible to avoid copying the
"parts of the caller's context" that are mentioned on the clone manpage?
ENOMEM Cannot allocate sufficient memory to allocate a task struct
Seems O/T for this list, which is about R programming.
Have you tried an internet search on "Install R on ubuntu" or similar.
I found this:
https://www.linode.com/docs/development/r/how-to-install-r-on-ubuntu-and-debian/
There are also r-sig-debian and r-sig-fedora mailing lists, in case that
m
I would love to hear from anyone who has successfully built 3.5.0 under
Ubuntu 18.04 (Bionic Beaver). My attempts have failed, including:
export LDFLAGS="$LDFLAGS -fPIC"
export CXXFLAGS="$CXXFLAGS -fPIC"
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-R-shlib --prefix=/usr/lib/R/3.5.0
C
Hi, I was able to get Eivind's code to work by slight modification of
the "grab" function:
grab <- function() {
grid.echo()
grid.grab()
}
Best Regards,
W. Michels, Ph.D.
On Fri, May 18, 2018 at 9:56 AM, Eivind K. Dovik wrote:
> On Fri, 18 May 2018, Ed Siefker wrote:
>
>> I have dose r
Ah ok this solves it for me, thank you!
Bailey
From: Bert Gunter
Sent: May 22, 2018 4:42 PM
To: Bailey Hewitt
Cc: Daniel Nordlund; r-help@R-project.org
Subject: Re: [R] Using tryCatch in a for loop
No. If your ouput is a numeric "matrix", it cannot include alpha. Columns in a
da
Hi
In addition to Richard's suggestion to add borders to the "only filled"
bars, you could add "mitred" corners, like this ...
par(ljoin="mitre")
barplot(x, beside=T, border=rep(c('black', 'black'),5),
space=c(0.08,1), col=rep(c('black', 'white'),5))
It may be overkill, but if the "
Is there any way to perform stepwise Poisson regression with GEE in R?
(I know, and agree that stepwise procedures are not best statistical practice.
I have developed a model with 10 independent variables, my client want me to
include 50 other independent variables. I, of course, don't what to do
No. If your ouput is a numeric "matrix", it cannot include alpha. Columns
in a data frame can be of different classes, but each column must be single
class.
and finally, of course, see ?cat -- I think you are misusing it. If you
simply want to return "somestuff", your function should be:
function
On 5/22/2018 11:32 AM, Bailey Hewitt wrote:
Hi Bert,
Thank you for the quick response!
In its current state the code prints three lines that say "warning". What I was
expecting is that I would get a matrix with 4 columns, 1. column names (from the original
data, ex. Lake1) 2. breakpoint year
(practically) ALWAYS respond to the list. I have cc'ed them here.
Others may (almost always do!) have greater insight/better answers than I.
In this case, I have no clue, but presumably your call is wrong, but as I
have no experience with the segmented.lm function, I don't care to track
down how
Hi Bert,
Thank you for the quick response!
In its current state the code prints three lines that say "warning". What I was
expecting is that I would get a matrix with 4 columns, 1. column names (from
the original data, ex. Lake1) 2. breakpoint year 3. slope 4. slope difference
from the first
Others may have greater insight, but my response is: Exactly what did or
didn't happen that makes you say the code didn't work? That is, what did or
didn't you get when you ran it compared to your expectations?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep
I think it is simpler to use !grepl() instead of -grep() here, since
subscripting with logicals works properly when there are no matches.
Also, since mat is a matrix, add the argument drop=FALSE so the
result is a matrix when all but one rows are omitted. E.g.,
> mat <- matrix(1:6, nrow=3, ncol=2
Thank you for your reply. It is about the MICE package indeed.
I have tried your 'solution', but I do not see anything unusual going on.
My variable Time is a numerical variable, ranging from 0 to 1200. My variable
Falls is coded as zero one, where one is having the event.
Maybe this informati
Hard to tell from the info you are giving us. I assume this regards the "mice"
package?
One way to proceed is to set options(error=recover) which will dump you into
the browser() environment when the error occurs and you can oka around and see
what the value of variables was at the point of the
Dear all,
Currently, I am doing a research project about serum sodium levels and falling.
I am doing my analysis in R. I am performing the multiple imputation right now.
I want to perform a survival analysis later, but therefore I need to specify
the Nelson-Aalen estimator. My dataset is called
Thanks a lot. The code works great.
Regards
Ahmed
**
Ahmed Serag
Analytical Chemistry Department
Faculty of Pharmacy
Al-Azhar University
Cairo
Egypt
From: Rui Barradas
Sent: Tuesday, May 22, 2018 2:16 PM
To: Ahmed Serag; R-help@r-pro
Hello,
Please always cc the list.
As for the question, yes, it does. If you want to remove just the ones
with exactly 73.1 use the pattern
grep("^73\\.1$", etc)
Explanation:
Beginning of string: ^
End of string: $
Escape special characters: \\ (needed because the period is a special
charac
Hello,
Use grep to get the row indices and then subset with a *negative* index
to remove those rows.
rn <- scan(what = character(), text = "
70/556
71.1/280
72.1/556
72.1/343
73.1/390
73.1/556
")
mat <- matrix(rnorm(6*6), nrow = 6)
row.names(mat) <- rn
inx <- grep("73\\.", row.names(mat))
n
Dear R-experts,
How can I remove a certain feature or observation by a part of its name. To be
clear, I have a matrix with 766 observations as a rows. The row names are like
this
70/556
71.1/280
72.1/556
72.1/343
73.1/390
73.1/556
Now I would like to remove all the rows that contain the text 7
Hi,
I have used R rmgarch package to implement EGARCH ADCC model from which I
can extract conditional covariance matrix. Now I would like to introduce
positive and/or negative shocks to see the asymmetric response of
covariance. I have come to know that impulse response function (IRF) or
volatility
Hello,
Right!
I copied from the OP's question without thinking about it.
Corrected would be
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred <- predict(fit)
y <- d$crp
median((y - ypred)^2)
}
Sorry,
rui
On 5/22/2018 2:32 AM, Rui Barradas wrote:
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred <- predict(fit)
y <- d$crp
median(y - ypred)^2
}
since the OP is looking for the "median squared error"
I forgot, you should also set.seed() before calling boot() to make the
results reproducible.
Rui Barradas
On 5/22/2018 10:00 AM, Rui Barradas wrote:
Hello,
If you want to bootstrap a statistic, I suggest you use base package boot.
You would need the data in a data.frame, see how you could do
Hello,
If you want to bootstrap a statistic, I suggest you use base package boot.
You would need the data in a data.frame, see how you could do it.
library(boot)
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred
Hi
Your approach seems to me rather complicated. I would reshape data before
plotting and maybe also change order of levels in resulting variable factor
library(reshape2)
dfm<-melt(df)
dfm$variable<-factor(dfm$variable, levels=levels(dfm$variable)[c(2,1,3,4)])
p2<-ggplot(dfm, aes(x=rep(1:2,4), y
40 matches
Mail list logo