I realized after posting that you can also just do this...
x <- matrix(rnorm(25 * length(m), m, s), ncol=4, byrow=TRUE)
Michael
On 11 January 2011 19:13, Amelia Vettori wrote:
> Dear Mr Bedward and Mr Newmiller,
>
> Thanks a lot for the guidance. Really appreciated.
>
> Sagga K
>
> --- On *Tu
Dear Guy,
Have a look at cast() from the reshape package. You'll need something
like
cast(fldsampleid ~ Analysis, value = "Result", data = your.data.frame)
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor na
Dear all,
I have a example from library survey about estimating in subpopulations and
I need to reproduce it step by step. This is the example (from paper:
Estimates in subpopulation of Thomas Lumley and just instead of svymean I
used svytotal) that I did in R:
library(survey)
data(fpc)
dfpc<-
Hi,
A new version (0.1-5) of Rd2roxygen is on CRAN now.
Rd2roxygen is a package to help developers transit from the raw Rd
files to roxygen-style documentations, and it also has utilities to
help build the package (with options to reformat the usage and
examples sections).
Updates:
o a new way
Frodo Jedi wrote:
>
>
>>What is the question you are really trying to find the answer for?
Knowing that
>>may help us give more meaningful answers.
>
> Concerning your question I thought to have been clear.
>
> I want to understand which analysis I have to use in order to understand
> if t
Hello,
The answer to this one drops out of the answer to your previous question...
m <- matrix(1:16, nrow=4)
end <- c(2,3,1,3)
ii <- cbind(sequence(end), rep(1:length(end), end))
x <- m[ ii ]
Hope this helps,
Michael
2011/1/11 zhaoxing731 :
> Hello
>
> Suppose I have a matrix mat=(1:16,2)
>
Dear Mr Bedward and Mr Newmiller,
Thanks a lot for the guidance. Really appreciated.
Sagga K
--- On Tue, 11/1/11, Michael Bedward wrote:
From: Michael Bedward
Subject: Re: [R] Generation of Normal Random Numbers
To: "saggak"
Cc: r-help@r-project.org
Received: Tuesday, 11 January, 2011, 7:24
Hello
I am running a program from value intervals for a set of variables.
I thought I could use Smolyak to get my intervals adding points as I need
them , so instead of running the program for a whole interval I would run
only for the most important points.
I am new to Smolyak algorithm though, a
I think I found out about the existing problem with generation of tables
done by latex():
Checking the source code of 'table.R' I noticed any optional arguments
specified seem to be discarded when calling the function latex.table()
after preprocessing the summary.rqs-output
So unlike state
On 11-01-10 5:43 PM, R Heberto Ghezzo, Dr wrote:
Hello, I am on a laptop with Win7, running R-2.12.1
if I click on Packages/InstallPackages I get :
utils:::menuInstallPkgs()
Warning: unable to access index for repository
http://cran.skazkaforyou.com/bin/windows/contrib/2.12
Warning: unable to
On 10.01.2011 23:43, R Heberto Ghezzo, Dr wrote:
Hello, I am on a laptop with Win7, running R-2.12.1
if I click on Packages/InstallPackages I get :
utils:::menuInstallPkgs()
Warning: unable to access index for repository
http://cran.skazkaforyou.com/bin/windows/contrib/2.12
Warning: unable
Hi,
The package animation 2.0-1 is on CRAN now
(http://cran.r-project.org/package=animation).
CHANGES IN animation VERSION 2.0-1
NEW FEATURES
o demo('Xmas_card') contributed by Yuan Huang
o demo('flowers') to show how to download images from the Internet
and create an
On 01/11/2011 09:20 AM, ang wrote:
I was actually looking to create a similar type of graph in R.
But I guess I am going to try to approach it by using a stacked column chart
and hiding the 'net' series, while only showing the increases/decreases in
value.
I'll post an update later on what I co
Hi,
I have a data frame with variables a, b, c (character vars) and t (time var,
could be represented as POSIXct or character, depending on which is most
useful.
The format is "-mm-dd hh:mm:ss CET"). Now, I want to sort the data frame in
ascending order by a, b, c and then in descending or
Hi Deepayan
Thank you very much for the update to lattice and the solution.
For the current problem the texts are all single lines and the solution
works well.
The example was to accentuate the problem and I thought that it would be
useful in the future.
I was able to make all the heights look
Got it, after rtmíng I realized I had to use xtfrm:
ord <- order(c(idvars, -xtfrm("t")))
myData[ord, ]
It's downright ugly, as it confronts the user with some implementation detail
(cf SAS or SPSS), but well, it works.
Cheers!!
Albert-Jan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi
I would like to add a line to the plot of the data panel of a stl
decomposed time series.
Example:
plot(stl(nottem, "per"))
plots a 4(or is t 8?) panel graph. I thought that I might be able to use
mfg to plot in the top (left?) panel ("data"), b
This is not exactly an R specific question, but I think the people on this list
can probably help.
I'm working on a simulation. In the model I have the first three moments of the
distributions of the variables. I know how to generate a random number from a
distribution given the first two momen
> Date: Sun, 9 Jan 2011 12:57:49 +
> From: c...@witthoft.com
> To: r-help@r-project.org
> Subject: Re: [R] how to calculate this natural logarithm
>
>
>
> You could re-do part of your code to run with mpfr-class variables, and use
> this function:
> # mpfr choose(n,k)
> rmpfac<-function(n,k,
Dear Jim Holtman,
I would like to thank you for your help.
Just to update also the community that worked fine :)
Best Regards
Alex
--- On Mon, 1/10/11, jim holtman wrote:
> From: jim holtman
> Subject: Re: [R] From vector to a step function
> To: "Alaios"
> Cc: r-help@r-project.org
> Date: Mo
Hi list. I was saving my modified pairs graphic using a custom panel from
the R Graphics site, and I got an interesting difference in the final image
when I save it as eps or png.
This custom panel make possible to show at the left side of the pairs plot
the p-value as symbol and the correlation r
Hi, a correction in the previous script. Anyone who tries to use it must
ignore (remove) the [,-7] after the Grupos object.
Sorry.
De: Rodrigo Aluizio [mailto:r.alui...@gmail.com]
Enviada em: terça-feira, 11 de janeiro de 2011 11:01
Para: R Help
Assunto: Postscript function Bug at R x64 2.
i write an php R web app on a linux server that takes an user input matrix
(20X20) and makes an Multidimensional Scaling calculation. Now my answer is,
can R support (let's say) 1000 requests per second? (my app is intended to
be use on facebook) What's the best way, use R as a server, deployng mo
I am using the quantreg package to build a quantile regression model and
wish to generate confidence intervals for the fitted values.
After fitting the model, I have tried running predict() and
predict.rq(), but in each case I obtain a vector of the fitted values
only.
For example:
library(quant
Hello,
this little example my work for demo purposes:
x1 = runif(45)
x2 = runif(45)
x3 = runif(45)
df = data.frame(x1=x1,x2=x2,x3=x3)
test <- function(df, values, n) {
if (nrow(df) < n) {
df <- rbind(df, values)
} else {
df[1:(nrow(df)-1),] <- df[2:nrow(df),]
df[n,] <- values
}
return(df)
}
I'm having a hard time fathoming your question, since "pterms" appears
nowhere in my source code to residuals.survreg. Can we start at the
beginning, per the posting guide?
1. What version of R are you running?
2. What exactly are the statements you typed which give the message?
Note that resi
Thanks,
I will have a look at it.
Sebastien
Michael Bedward wrote:
Hi Sebastian,
You might also find the proto package useful as a way of restricting
the scope of variables. It provides a more intuitive (at least to me)
way of packaging variables and functions up into environments that can
be
You need to add explicitly newdata = list(x=x) and if you want percentile
method you also
need se = "boot".
Roger Koenker
rkoen...@illinois.edu
On Jan 11, 2011, at 3:54 AM, Davey, Andrew wrote:
> I am using the quantreg package to build a quantile regression model and
> wish to generate conf
Use na.approx:
set.seed(21)
x <- xts(rnorm(10), Sys.time()-10:1)
is.na(x) <- 2:4
is.na(x) <- 8:9
na.approx(x)
na.spline(x)
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrading.com
On Tue, Jan 11, 2011 at 12:08 AM, Rustamali Manesiya
wrote:
> Hello,
>
> I have a xts object, I would l
So far I have "learned" that a binary logit model can either not
converge or show linear separability (two different warnings). And
so far I assume that this is also the case for multinomial models.
For these models, if such errors occur, the coefficients are not
very useful. In a loop (bootstr
Hello Julian,
I'm not sure my answer will be very helpful to you but it seems that Tinn-R
looks for Rprofile.site at the old place (R/bin/etc). With the new R
configuration, this file is in now R/bin.
Maybe you can try to copy the Rprofil.site file to the place expected by
Tinn-R.
I also found
> The data is initially extracted from an SQL database into Excel, then saved
> as a tab-delimited text file for use in R.
You might also want to look at the SQL packages for R so you can skip
this manual step. I'd recommend starting with
http://cran.r-project.org/doc/manuals/R-data.html#Relation
Dear R gurus,
first let me apologize for a question that might hve been answered
before. I was not able to find the solution yet. I want to concatenate
two lists of lists at their lowest level.
Suppose I have two lists of lists:
list.1 <- list("I"=list("A"=c("a", "b", "c"), "B"=c("d", "e", "f")
Hello,
I have logging information for multiple machines, which I am trying to
summarize and graph. So far, I process each host individually, but I
would like to summarize the user count across multiple hosts. I want to
answer the question "how many unique users logged in on a certain day
acro
Hi Georg,
This was an interesting challenge to me. Here's what I came up with.
The first option meets your desired result, but could get messy with
deeper nesting. The second is less code, but is not quite what you
want and requires as.data.frame() to give a reasonable result for each
list. Cal
I am not sure exactly what your data represents. For example, from
looking at the data it appears that user1 and user2 have been logged
on for about 4 days; is that what the data is saying? If you are
keeping track of users, why not write out a file that has the
start/end time for each user's ses
Hi Petr,
Sorry for the delay. I ended up implementing a simple and fast but
not-universal or elegant solution, since it turned out that I only needed to
test a rather small subset of combinations for my purposes.
Nevertheless, I did go back and try the solutions posted. Bill's 'binary
expansio
On Tue, 11 Jan 2011, Georg Otto wrote:
Dear R gurus,
first let me apologize for a question that might hve been answered
before. I was not able to find the solution yet. I want to concatenate
two lists of lists at their lowest level.
Suppose I have two lists of lists:
list.1 <- list("I"=list(
Lists are (isomorphic to) trees with (possibly) labelled nodes. A
completely general solution in which two trees have possibly different
topologies and different labels would therefore involve identifying
the paths to leaves on each tree, e.g. via depth first search using
recursion, and unioning le
Hi,
when I apply a glm() model in two ways,
first with the response in a two column matrix specification with
successes and failures
y <- matrix(c(
5, 1,
3, 3,
2, 2,
0, 4), ncol=2, byrow=TRUE)
X <- data.frame(x1 = factor(c(1,1,0,0)),
x2 = factor(c(0,1,0,1)))
g
Your first model is a binomial glm witb 4 observations of 6,6,4,4
trials.
Your second model is a Bernoulli glm with 20 observations of one trial
each.
The saturated models are different, as are the likelihoods
(unsurprising given the data is different): the binomial model has
comnbinarial f
Dear list members,
does anybody know a way how to add plots to already existing subplots created
with layout? I have created two subplots via
layout(matrix(1:2))
and would like to add different plots to each of them. As I need to load data
in between I need to add a plot to the first subplot,
Without any error checking, I'd try this:
recurse <-
function(l1,l2){
if(is(l1[[1]],"list"))
mapply(recurse,l1,l2,SIMPLIFY=F) else
{mapply(c,l1,l2,SIMPLIFY=F)}
}
recurse(list.1,list.2)
which recursively traverses each tree (list) in tandem until one is not
composed o
Hi, is there any direct R function to write an diagonal matrix in an opposite
way? for example I want to get like:
> diag(rnorm(5))[,5:1]
[,1] [,2] [,3] [,4] [,5]
[1,] 0.000 0.000 0.000 0.00 -0.1504687
[2,] 0.000 0.000 0.000 -2
I have a really simple question
I have a data frame of 8 variables (the first column is the subjects' id):
SubID G1G2 G3 G4W1W2 W3W4
1 6 5 6 2 6 22 4
2 6 4 7 2 6
> x <- 1:5
> diag(x)[rev(seq(length(x))),]
On Tue, Jan 11, 2011 at 12:56 PM, Ron Michael wrote:
> Hi, is there any direct R function to write an diagonal matrix in an
> opposite way? for example I want to get like:
>
> > diag(rnorm(5))[,5:1]
>[,1] [,2] [,3] [,4]
Is there a way to achieve
lbl=c("a", "b", "c", "d")
par(mfrow=c(2,2), ann=FALSE)
for (t in 1:4){
plot(seq(from=1,to=2*pi,length=100),
sin(t*seq(from=1,to=2*pi,length=100)), type="l")
title(main=paste("(", lbl[t], ")", sep=""))
}
without having to use an object like 'lbl'?
More generally: is
All:
Anyone have an idea about how to plot a PLS biplot on the x-y plane under a 3-D
surface? Preferably a 3-D surface such as one created with rgl.surface()
(meaning, I would love an interactive plot when all is said and done).
I have seen examples which combine a 3-d surface with contour plo
Hi Jim,
I looked through the plotrix documentation, and the waterfall plot comes
from the stackpoly function right? I'm not sure if I can modify the
stackpoly to create the plot I want, since stackpoly is a line plot and
fills the area under with color.
I haven't played with all the options yet
Hi,
On Tue, Jan 11, 2011 at 9:19 AM, wangwallace wrote:
>
> I have a really simple question
>
> I have a data frame of 8 variables (the first column is the subjects' id):
>
> SubID G1 G2 G3 G4 W1 W2 W3 W4
> 1 6 5 6 2 6 2
Okseems as I found a way. For anybody looking for a similar solution:
?split.screen
Cheers
Jannis
--- Jannis schrieb am Di, 11.1.2011:
> Von: Jannis
> Betreff: [R] adding plots to existent multiuple plots
> An: r-help@r-project.org
> Datum: Dienstag, 11. Januar, 2011 18:13 Uhr
> Dear lis
On Jan 11, 2011, at 2:06 PM, Eduardo de Oliveira Horta wrote:
Is there a way to achieve
lbl=c("a", "b", "c", "d")
opar <- par(mfrow=c(2,2), ann=FALSE)
for (t in 1:4){
plot(seq(from=1,to=2*pi,length=100),
sin(t*seq(from=1,to=2*pi,length=100)), type="l")
title(main=paste("(", lbl[t], ")", sep
Dear all, I would like to ask one question related to statistics, for
specifically on defining dummy variables. As of now, I have come across 3
different kind of dummy variables (assuming I am working with Seasonal
dummy, and number of season is 4):
> dummy1 <- diag(4)
> for(i in 1:3) dummy1 <- rb
That's correct, those users have been logged in or had processes running
on this machine for four days. The machines in question are time-sharing
Linux servers for college students and professors to use. multi-day jobs
are common.
The "last" command does what you suggest, but it doesn't captur
R does not use dummy variables. Models and contrasts are specified in
more natural, model formula based ways. See
?arima
and/or CRAN's Time Series task view for numerous packages that fit time series.
-- Bert
On Tue, Jan 11, 2011 at 12:18 PM, Christofer Bogaso
wrote:
> Dear all, I would like
> From: Frodo Jedi [mailto:frodo.j...@yahoo.com]
> Sent: Monday, January 10, 2011 5:44 PM
> To: Greg Snow
> Cc: r-help@r-project.org
> Subject: Re: [R] Assumptions for ANOVA: the right way to check the normality
>
> Dear Greg,
> first of all thanks for your reply. And I add also many thanks to al
You are not offering example of real codings but are rather showing
something1 that you think looks like something2 (in R) that looks like
something3 (in a textbook?). My guess is that the something2 might be
contrast matrices or model matrices.
If you want a contrast matrix whose columns s
Many many thanks for your feedback Greg.
You have been very enlightening for me.
Now is time for me to study the material you kindly provided me. Thanks.
From: Greg Snow
Cc: "r-help@r-project.org"
Sent: Tue, January 11, 2011 10:13:34 PM
Subject: RE: [R] A
Thanks,
I wasn't even aware that 'letters' was there.
Best regards
On Tue, Jan 11, 2011 at 6:08 PM, David Winsemius wrote:
>
> On Jan 11, 2011, at 2:06 PM, Eduardo de Oliveira Horta wrote:
>
>> Is there a way to achieve
>>
>> lbl=c("a", "b", "c", "d")
>>
>> opar <- par(mfrow=c(2,2), ann=FALSE)
The documentation for `aggregate` makes it sound like aggregate.formula should
behave identically to aggregate.data.frame (apart from the way the parameters
are passed). But it looks like aggregate.formula is quietly removing rows
where any of the "output" variables (those on the LHS of the for
Avi,
Its been nearly a year since you made this post, but I'm curious if you were
able to find a solution to your problem? Your inquiry is closely related to
a problem I'm having.
Thanks,
Eric
--
View this message in context:
http://r.789695.n4.nabble.com/Strange-behavior-when-trying-to-pig
Hi Ed,
The sn package can generate random values from skewed Normal and t
distributions.
Also see here: http://azzalini.stat.unipd.it/SN/faq-r.html
Michael
On 11 January 2011 23:37, Ed Keith wrote:
> This is not exactly an R specific question, but I think the people on this
> list can probabl
On Jan 11, 2011, at 5:41 PM, Dickison, Daniel wrote:
The documentation for `aggregate` makes it sound like
aggregate.formula should behave identically to aggregate.data.frame
(apart from the way the parameters are passed). But it looks like
aggregate.formula is quietly removing rows where
Has anyone successfully created a PNG file for a dendrogram?
I am able to successfully launch and view a dendrogram in Quartz. However, the
dendrogram is quite large (too large to read on a computer screen), so I am
trying to save it to a file (1000x4000 pixels) for viewing in other apps.
Ho
I'm guessing that your code actually generates two plots, one with the
command p <- plot(hc) and one with plot(p), which doesn't work for a
png. Try getting rid of the plot(p).
Peter
On Tue, Jan 11, 2011 at 4:01 PM, Richard Vlasimsky
wrote:
>
> Has anyone successfully created a PNG file for a de
On Tue, Jan 11, 2011 at 3:18 PM, Christofer Bogaso
wrote:
> Dear all, I would like to ask one question related to statistics, for
> specifically on defining dummy variables. As of now, I have come across 3
> different kind of dummy variables (assuming I am working with Seasonal
> dummy, and number
I very much doubt your first example does work. the value of plot() is NULL
which if you plot again will give the error message you see in your second
example.
What where you trying to achieve doing
p <- plot(hc)
plot(p) ### this one is trying to plot NULL
?
Here is an example (s
On 2011-01-11 14:41, Dickison, Daniel wrote:
The documentation for `aggregate` makes it sound like aggregate.formula should behave
identically to aggregate.data.frame (apart from the way the parameters are passed). But
it looks like aggregate.formula is quietly removing rows where any of the
Oh wow, that would be it. Not sure how I missed that. Thanks for the tip.
Sent from my iPhone
On Jan 11, 2011, at 18:56, "David Winsemius" wrote:
>
> On Jan 11, 2011, at 5:41 PM, Dickison, Daniel wrote:
>
>> The documentation for `aggregate` makes it sound like
>> aggregate.formula should b
On Jan 11, 2011, at 7:01 PM, Richard Vlasimsky wrote:
Has anyone successfully created a PNG file for a dendrogram?
I am able to successfully launch and view a dendrogram in Quartz.
However, the dendrogram is quite large (too large to read on a
computer screen), so I am trying to save it
Dear r heper,
How can I change the strip text, for example (16,23] in the following
example, to other more informative text such as "high level" on the
fly?
library(effects)
Cowles$ex2 <- cut(Cowles$extraversion,3)
mod.cowles <- glm(volunteer ~ sex+neuroticism*ex2,data=Cowles, family=binomial)
ef
On Jan 11, 2011, at 9:27 PM, David Winsemius wrote:
On Jan 11, 2011, at 7:01 PM, Richard Vlasimsky wrote:
Has anyone successfully created a PNG file for a dendrogram?
I am able to successfully launch and view a dendrogram in Quartz.
However, the dendrogram is quite large (too large to r
Christofer,
I am not sure I understand how you are using your dummy variables. Generally if
you have n categories you need n-1 dummy variables. Thus if you have three
categories, low, medium, high and want to compare two of the levels to a
reference level (a coding scheme sometimes called refere
Hi all,
First time poster and a relatively new R user, I'm beginning analysis for my
masters degree. I'm doing a bit of work on octopus behaviour, and while it's
been fascinating, the stats behind it are a bit beyond my grasp at the
moment. I was hoping that somebody with more experience my be ab
Hi,
I am guessing this is not what you meant by "on the fly", but I think
it will be by far the easiest way. Plotting an effects object is a
high level plot with a lot of defaults and automation built in to make
your life simple. The cost is that it is less flexible---you work its
way, not vice
Sure that is one way to go.
Since it is possible to pass lattice arguments to that high level
function, and there should be ways to relabel/custom the strip text in
the lattice plotting system, I would think such an indirect method a
last resort.
Thank you.
Ronggui
On 12 January 2011 11:51, Josh
Hi Chris,
This seems to work on the sample data you provided.
FUN <- function(x) {
x <- xts(as.numeric(x),index(x))
period.apply(x, endpoints(x,"secs"), sum)
}
lapply(split.default(xSym$Size,xSym$Direction), FUN)
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrading.com
On Sun, Jan 9,
Hmm, I felt like it was the clearest, most direct way. Then again,
things of this nature (overide defaults using arguments rather than
changing what you feed the functions) do seem to be a common request
both for lattice and ggplot2. In any case, my memory of the lattice
book and a quick search o
Hi,
I am using plot to show scatter points in 2_D.
in my data, there is no data between -1 and +1 in x-axis.
I want to skip this region, i.e. x axis becomes [-Inf:-1, 1:Inf].
can any one tell me how to do?
YU
[[alternative HTML version deleted]]
Samaritan gmail.com> writes:
> [snip]
You might want to ask follow-up questions on the R-sig-mixed-models list
> At the most basic level, I'm testing the effect of sleep deprivation on
> various behaviours (e.g. amount of time spent awake, amount of time spend
> expressing difference texture
Dear All,
I am in the process of translating some of my functions into C and one such
function sometimes get stuck when I applied optim. The pure R codes work fine
but the translated C codes occasionally get stuck and I like to find out why.
Is it possible to extract the parameters of function
Hello,
I have a little problem about degree of freedom in R.
if you can help me, I will be happy.
I used nlme function to analyze my data and run the linear mixed
effects model in R.
I did the linear mixed effect analysis in SAS and SPSS as well.
However, R gave the different degrees of freedom t
82 matches
Mail list logo