Displaying 20 results from an estimated 1000 matches similar to: "xyplot format axis"
2008 Jul 03
1
lm() question
I have data that looks like
YC Age Num
82 11 2
83 10 0
84 9 8
85 8 21
86 7 49
87 6 18
88 5 79
89 4 28
90 3 273
91 2 175
with a program
mod1=lm(log(Num+1)~YC, data=box44)
plot(log(Num+1)~YC, data=box44, pch=19, xlab="Year Class",
ylab="Loge Number at age", ylim=c(0,6), xlim=c(91,82))
abline(lm(log(Num+1)~YC), col="blue", lwd=2)
summary(mod1)
I need to
2009 Mar 12
8
help with loop
Dear useRs,
I'm trying to write a loop to sum my data in the following way:
(the second - the first) + (the third - the second) + (the fourth - the third) + ...
for each column.
So, I wrote something like this:
c <- list()
for(i in 1:ncol(mydata)) {
for(j in 2:nrow(mydata)) {
c[[i]] <- sum(yc[j,i] - yc[(j-1),i])
}}}
As for the columns it works pretty fine, but it only
2011 May 10
1
Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range
Hello,
please excuse my ignorance as i am new to R and this might seem trivial to
you
How can i scale my time series in a way that 90% of the data is in the
-0.-9/ +0.9 range?
I think i first have to select the 90% closest to the mean and then
calculate my scaling parameter on it, then scale the whole series.
I think i could use outlier() from outliers package to identify the outer
10%,
2002 Oct 29
1
samba compiling error
Hello,
I have error on compiling time
I tried on HP-UX 11.00 system with gcc version 3.1 to compile samba source
Samba latest version source was dowloaded from www.us1.samba.org/samba/ftp
I attached log file with this error
thank you.
begin 600 samba_make.log.doc
M(R!M86ME#0HO=7-R+VQO8V%L+W-A;6)A+V)I;B(@+410241$25(](B]U<W(O
M;&]C86PO<V%M8F$O=F%R+VQO8VMS(B
2006 Aug 04
1
Integration and Loop in R
Dear All,
I have seldom needed to use loops in R, but now I need to code a loop
with a stride different from one.
In the R manual I downloaded I have the example:
> xc <- split(x, ind)
> yc <- split(y, ind)
> for (i in 1:length(yc)) {
plot(xc[[i]], yc[[i]]);
abline(lsfit(xc[[i]], yc[[i]]))
}
but in my case I'd like to add a condition so that i varies by 4 from
one go
2006 Oct 26
1
A faster way to calculate Trace?
I want to know how to get trace of product of matrices **faster** when the matrices are really big. Unfortunately the matrices are not symmetric. If anybody know how to get the trace of it, please help me. An example is as below.
n <- 2500
a <- matrix(rnorm(n*n),n,n)
b <- matrix(rnorm(n*n),n,n)
tr1 <- sum(diag(a %*% b))
tr2 <- sum(diag(a %*% b %*% a %*% b))
Thanks,
Yongwan Chun
2004 Dec 03
4
seq.Date requires by
Hi,
What is the reason for seq.Date to require the 'by' argument and not to
default it to 1 in the example below?
> seq(from=as.Date("1996-01-01"), to=as.Date("1996-12-01"))
Error in seq.Date(from = as.Date("1996-01-01"), to =
as.Date("1996-12-01")) :
exactly two of `to', `by' and `length.out' / `along.with' must be
specified
2003 Nov 05
3
using LSODA in R
R help list subscribers,
I am a new user of R. I am attempting to use R to explore a set of
equations specifying the dynamics of a three trophic level food chain. I
have put together this code for the function that is to be evaluted by
LSODA. My equations Rprime, Cprime, and Pprime are meant to describe the
actual equation of the derivative. When I run LSODA, I do not get the
output that
2005 May 13
2
help with texi2dvi
Hello,
Does anyone know how to write the files created by the call of
"texi2dvi" in another directory ?
Thanks,
Matthieu
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2012 Jan 31
1
Selecting contiguous, irregularly-shaped sets of values from arrays
All,
I am attempting to select all of the contiguous elements of a matrix that meet some criterion. I.e., values that would be contained within an irregular area defined by a "contour" applied around point of interest. So, if I have a matrix x as follows:
> x <- matrix(rnorm(25), nrow=5, ncol=5,
2011 Jan 26
1
aggregate(as.formula("some formula"), data, function) error when called from in a function
I'm having a problem with aggregate.formula when I call it in a function and the function is converted from a string in the funtion
I think my problem may also only occur when the left hand side of the formula is cbind(...)
Here is example code that generates a dataset and then the error.
The first function "agg2" fails
> agg2(FALSE)
do agg 2
Error in m[[2L]][[2L]] : object
2009 Jul 31
1
xyplot with 2 panels and 2 different x-scales
Hi All,
I have this data:
type<-c("country","country","country","world","world","world")
place<-c("A","B","C","A","B","C")
rank<-c(1,3,5,512,420,320)
df1<-data.frame(type,place,rank)
and need to produce an xyplot with 2 panels, where the x-values are
labelled:
2011 May 09
2
Create subsets of data
Hello All,
Let's say I have points on a x-y plane. x ranges from 0-2 and y from 0-2.
There are points in quadrants x[0:1]---y[0:1] and in x[1:2]----y[1:2]. I
would like to get the mean and std of the points in the x[0:1]----y[0:1]
quadrant alone. Is there a straight forward way to do it?
I asked a similar question a few days ago regarding plotting a subset of
data using conditions. The
2008 Feb 19
3
simple usage of "for"
Hi list
I have a data frame I would like to loop over. To begin with I would
like crosstabulations using the first variabel in the data frame,
which is called "meriter".
> table(meriter[[1]], meriter[[3]])
ja nej
Annan 0
1999 Jan 20
1
Inherit names ...
No doubt an easy answer to this exists.
I have a data frame which comprises 4 matrices and 2 vectors:
year(1024,6),growth(1024,6),ycens(1024,6),gcens(1024,6),yinit(1024),ginit(1024)
The names of the 26 columns get denoted as y.1 to y.6, g.1 to g.6, yc.1 to
yc.6, gc.1 to gc.6, yi and gi as these are the internal names.
I wish to make a subset of the data using the logical vector R1(length
1024)
2004 Apr 13
1
postscript image problem (PR#6763)
Full_Name: Jonathan Lees
Version: 1.8.1
OS: GNU/Linux 2.4.20-20.8smp #1 SMP
Submission from: (NULL) (152.2.75.114)
I am having trouble with the postscript output of images.
They have lines on them that are not supposed to be there.
I have noticed this on numerous trials of printing various images.
I looked at the postscript and I see that it
appears to plot each individual block - so perhaps
2004 Dec 15
2
which
Why the last "which" in the following example doesn't
work? Is there a simple way to identify the indices of
array elements that meet multiple criteria?
Thanks.
YC Tao
> x<-1:10
> which(x<5)
[1] 1 2 3 4
> which(x>2)
[1] 3 4 5 6 7 8 9 10
> which(x<5 && x>2)
numeric(0)
__________________________________
Dress up your holiday email,
2001 Aug 27
1
colorbar legend for image()
Hi,
are there any plans to add a colorbar legend to image()?
Or such a possibility already implemented which I just haven't
discovered yet. Anyway, I will be willing to spent some time on the
implementation if there isn't anyone working on that already.
Thanks
Thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2012 Oct 22
1
glm.nb - theta, dispersion, and errors
I am running 9 negative binomial regressions with count data.
The nine models use 9 different dependent variables - items of a clinical
screening instrument - and use the same set of 5 predictors. Goal is to
find out whether these predictors have differential effects on the items.
Due to various reasons, one being that I want to avoid overfitting models,
I need to employ identical types of