similar to: Extracting vectors from matrices

Displaying 20 results from an estimated 3000 matches similar to: "Extracting vectors from matrices"

2001 Sep 03
1
Missing values in time series
Apologies for this - I'm sure I'm missing something somewhere... I've got a time series with several of missing values in it that I want to torture with R. But ts doesn't like the NA's, and I can't find any documentation telling me what to do about it. Help! Bob -- Bob O'Hara Metapopulation Research Group Division of Population Biology Department of Ecology and
2000 Jun 22
2
Postscript Legends (or not)
I discovered a little problem when using the Windows NT release of R 1.0.1, and it's still there in R 1.1.0. The boiled down version is this: I want to draw the following plot and put it into a Postscript file: x <- c(1,2,3,4); y1 <- c(1,2,3,4); y2 <- c(2,2,2,2) Fred <- c(1,2) postscript(file="d:/Bob/Papers/IFM/try2.ps") plot(x,y1, type="l")
2001 May 28
1
Fonts on Windows devices
Moi! I've spent a fun few hours trying to get a plot to look exactly the way I want it, and with a lot of help from Venables & Ripley (the book!) and the help pages, I've almost got it perfect. Only one problem now remains.... I'm using R1.2.2 on Windoze NT. I want to draw the graph as a Windows metafile (so at the moment I'm using the windows device, i.e. on the screen and
2001 Nov 08
2
Error Bars
I'm trying to draw some error bars on a bar chart. I'm using code like this: thing <- c(3,3,3) se <- c(1,1,1) names(thing) <- c("A", "B", "C") barplot(thing, ylim=c(0,4)) arrows(c(1:3), thing-se, c(1:3), thing+se, code=3, angle=90,length=0.1) Using c(1:3) has 2 problems: 1. Obviously it is untidy, but using names(thing) doesn't work, and I
2002 Jul 22
1
"New" problem with polr (or optim, or ...)
Hello from a presently sunny Helsinki! I've bee trying to repeat an analysis I did about 18 months ago (the reviewers of the paper want something adding to it). I'm using R1.5.0, but I couldn't see anything in the list of changes between this and 1.5.1 to suggest it would act any differently. The data is observational, on the changes in the population status of carabid beetles, and
2002 Dec 23
1
Strange axis labels?
Moi! I'm trying to add a rather long label to a y-axis, and it's so long that it won't fit into one line. However, things get strange when I try and split it over 2 lines. The problem seems to be the plus/minus symbol, which means I have to use expression(). I'm using R1.6.1 on Windoze 2000. As an example: thing1 <- expression(paste("log odds of survival probability (
2009 Nov 12
1
Substituting vectors into a legend
I have a simple (!) problem. What I want to do is to create a legend with Greek letters, and substituting numbers into the legend. Like this: mu=1:3 Mean=rep(mu, each=20) plot(runif(60), rnorm(60,Mean,0.1), pch=Mean) # create a plot legend(0.6,1.7, paste("mu =", 1:3), pch=mu) but with a Greek letter mu. I think the solution has something to do with substitute() possibly along with
2002 Aug 28
0
Extracting variance component estimates from lme
I assume I'm missing something obvious here... The short form of my main question is: how do I extract variance components from an lme object? The longer form (plus optional supplementary question!): I'm looking at some quantitative genetics, and want to estimate two variance components so that I can then calculate a statistic called Qst from them. So I have this: reg1 <- lme(y ~
2018 Jan 10
2
OpenBLAS in everyday R?
On Wed, Jan 10, 2018 at 12:04 AM, Keith O'Hara <keith.ohara at nyu.edu> wrote: > > Check if libopenblas is linked against libomp or libgomp. > > I?d be curious to see any errors that arise when an OpenMP version of OpenBLAS is linked with R. > > Keith > The one time I tried compiling OpenBLAS for Windows 64 with USE OMP = 1, I got an error. I don't recall if it
2003 Jul 11
2
Offsets in glmmPQL?
I've got a colleague who's using a GLMM to analyse her data, and I've told her that she needs to include an offset. However, glmmPQL doesn't seem to allow one to be included. Is there anyway of doing this? Bob -- Bob O'Hara Rolf Nevanlinna Institute P.O. Box 4 (Yliopistonkatu 5) FIN-00014 University of Helsinki Finland Telephone: +358-9-191 23743 Mobile: +358 50 599
2004 Mar 19
2
Odd behaviour of step (and stepAIC)?
I can only assume I'm betraying my ignorance here, but this is not what I would expect. I'm getting the following from a stepwise selection (with both step and stepAIC): > step(lm(sqrt(Grids)~ SE + Edge + NH), scope=~ (Edge + SE + NH)^2) Start: AIC= 593.56 sqrt(Grids) ~ SE + Edge + NH Df Sum of Sq RSS AIC <none> 2147.0 593.6 + Edge:NH 1
2011 Feb 20
1
inter-specific competition - community matrices and two species models using Lotka-Volterra
Does anyone know of example r-code/packages for carrying out analysis? Preferably this would have examples from real experimental data of two or more competing species... Thanks Chris Buddenhagen [[alternative HTML version deleted]]
2004 Oct 20
2
Odd behaviour with scale()
Moi! A student here has been getting a bit irritated with some side effects of scale() (OS is Windows XP, the behaviour occurs in R 2.0.0, but not 1.7.1). The problem is that she scales a variable in a data frame, then does a regression, and tries to get some predictions for some new data. However, at this point she gets an error (see the example below). This seems to be because the
2003 Jul 02
1
Maximisation of likelihood of a discrete parameter
Moi! I have a problem where I want to find the ML estimate of a discrete parameter. I just want a function like optim that finds the max/min value for a function. Does anyone know of such a function for R? Thanks. Bob -- Bob O'Hara Rolf Nevanlinna Institute P.O. Box 4 (Yliopistonkatu 5) FIN-00014 University of Helsinki Finland Telephone: +358-9-191 23743 Mobile: +358 50 599 0540 Fax:
2017 Dec 16
0
OpenBLAS in everyday R?
It seems that reproducibility across systems is also an issue with multithreaded BLASes: https://hal.archives-ouvertes.fr/hal-01202396/file/exblas.pdf On Sun, Dec 17, 2017 at 11:50 AM, Keith O'Hara <keith.ohara at nyu.edu> wrote: > On point 1): > > The standard approach seems to favor the reference BLAS for reasons other > than speed. > > For example, vecLib,
2004 Jan 08
1
Using split.screen
I want to draw a figure with several panels of unequal size, so i thought I would try using screen(). However, I can't figure out how to define the sizes as a matrix. I've tried this: split.screen(matrix(c(0,0.5,0,0.5, 0.5,1,0.5,1), byrow=F, ncol=4)) and a couple of variants on it, but get the same error: Error in par(.split.screens[[cur.screen]]) : invalid value specified
2002 Sep 13
2
Multiple random effects inlme?
Moi! I was helping to teach a course on mixed models this week, and we came across a problem with coding more than one random effect in lme when they aren't nested. As an example, suppose we have an experiment where we sample moths from several populations, and place the moths on different trees, and measure a trait (in this case survival of offspring, but that's less important). We
2005 Aug 25
3
Converting characters to numbers in data frames
I'm sure I'm missing something obvious here, but I can't find the solution (including in the FAQ etc.). I have a vector of names of variables like this: NRes.x.y. where x and y are numbers. I want to extract these numbers as numbers to use elsewhere. I can extract the numbers as a list of characters using strsplit(), and convert that to a data frame, e.g.:
2010 Sep 27
1
compare two matrices
Hi everyone: I have a kinda easy question but i do not know how to solve that in a simple way. I want to compare the rows of two matrices. col1 <- c(1,2,3,4,5,6) col2 <- c(6,5,4,3,2,1) m <- cbind(col1, col2) col3 <- c(1,3,2,6) col4 <- c(6,3,5,1) n <- cbind(col3, col4) In matrix n, for example the first row is (1,6), it is also some row
2010 Jan 14
1
Extracting data from a list of matrices
Hi, Apologies in advance for the basic nature of my question. I am still very much a rookie when it comes to R. Having googled it, checked Nabble and trial/error to the best of my ability, I have yet to find an easy solution. I am currently working with a list of 5x5 matrices, and want to extract a list consisting of the first number of each matrix. In other words I want to go from: [[1]]