On 2010-05-17 11:14, Nikhil Kaza wrote:
Does this work?
data(cars)
cars2 - cars
cars2[2:nrow(cars)+1,] - cars2[1:nrow(cars),]
cars2[1,] - NA
Not for me. Did you try it?
-Peter Ehlers
Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina
nikhil.l
or
factor columns.
cl - sapply(numdat, class)
idx - which(cl %in% c('character','factor'))
g - function(x){
sapply(strsplit(as.character(x),-),
function(.x) mean(as.numeric(.x), na.rm=TRUE))
}
newData - numdat
for(i in idx) newData[,i] - g(newData[,i])
newData
-Peter Ehlers
On Mon, May 17
Sorry, my attempt wasn't quite good enough. I didn't
consider the possibility of a 'negative' value in a
character/factor column. To fix that, see inline below.
On 2010-05-17 14:32, Peter Ehlers wrote:
On 2010-05-17 12:54, Henrique Dallazuanna wrote:
Try this:
newData- sapply(numdat
- .Machine$double.eps #or use something like 1e-10
brks - quantile(vec, (0:10)/10) + eps*(0:10)
cut(vec, brks, include.lowest=TRUE, labels=FALSE)
#[1] 10 6 7 5 9 1 3 7 4 2 9 4 1 10 5 8 1
-Peter Ehlers
On Thu, 13 May 2010, vincent.deluard wrote:
Dear Phil,
You helped
would work with matrices, since all of your data
are string variables.
-Peter Ehlers
write.table(output_offspring,offspring_7.txt,row.names=T,col.names=T,quote=F)
females.txt:
SampleID A1 A2 A3 A4
GM920222 GATTGCC GATTGCC GATAGAC GATAGAC
GM930040 GTCATCA GAGTGCA ACTATAA GATTGCC
GM930040 GTCATCA
() computes the Pearson
correlation coefficient by default. Try method='spearman'.
Better yet, plot the transformed variables vs the original
variable for further enlightenment.
-Peter Ehlers
With higher added values (and a right skewed variable) the lambda estimate
was even negative and the correlation
the printouts of
is.na(), pushViewport, popViewport, ...? Egad!
Anyway, as you've discovered, when you want to modify code, look
at the sources.
-Peter Ehlers
On 2010-05-16 12:05, Nikos Alexandris wrote:
Nikos Alexandris:
Among the (R-)tools, I've seen on the net, for (bivariate) Principal
Component
1 0
3 3 5 0 1 0
4 4 3 0 0 1
5 5 4 0 0 1
6 6 5 0 0 1
Any ideas?
Can't you just use names(...) - c() on your final dataframe?
-Peter
And if you do have many variables in one dataframe, you might
wish to construct the formula first using paste():
nm - c(0, names(d)[-c(1,2)])
fo - as.formula(paste(~, paste(nm, collapse= +)))
d - cbind(d, model.matrix(fo, data=d)
-Peter Ehlers
On 2010-05-16 15:30, Thomas Stewart wrote
substitute() does not have an argument 'list'; it does have 'env'.
Replace this line:
list = list (member = as.name (member),
with
env = list (member = as.name (member),
-Peter Ehlers
On 2010-05-14 3:09, Gil Tomás wrote:
Dear list,
A while ago I found in the web
11:47, David Winsemius wrote:
I agree. I was convinced by Ehlers' example that type =2 was a better
match to fivenum's result
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Federico,
Yes, do use axis(2, at = whatever, labels = whateverelse) for one axis.
Then use axis(4, ...) for the other axis.
You may need to use par('usr') to determine the y-extent of the plot.
-Peter Ehlers
On 2010-05-14 11:50, Federico Calboli wrote:
On 14 May 2010, at 18:25, Thomas
for (i in 4:9) {print(quantile(y, c(1,3)/4, type=i) ) }
25% 75%
15.82506 73.93080
25% 75%
15.87405 74.03625
25% 75%
15.84955 74.08898
25% 75%
15.89854 73.98352
25% 75%
15.86588 74.05383
25% 75%
15.86792 74.04943
--
Peter Ehlers
University of Calgary
# So 118 is the largest data value less than or equal to 119.5.
60.5 + 1.5 * IQR(y)
#[1] 116.375
# Using quartiles and the IQR would take the upper whisker to 94.
--
Peter Ehlers
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
function for this.
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
Aretha won't mind if I add my voice to the chorus.
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
' on that page
and the description of the equivalent 'coef' on the help page
for boxplot.stats. boxplot.stats has it right.
This should be made consistent.
[previous posts snipped]
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https
Ted,
Regarding the addition of a 'line' to a plot with log-y axis,
there is a better way: curve() with 'add=TRUE' will respect
the current plot's log setting:
plot((1:10), log=y, yaxt=n)
axis(side=2, at=c(1,2,5,10))
f - function(x, a=0, b=1) {a + b*x}
curve(f, add = TRUE)
.)
-Peter Ehlers
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
(assuming that have installed it):
library(rgl)
persp3d(x, y, z1, col = 'skyblue')
-Peter Ehlers
http://n4.nabble.com/forum/FileDownload.jtp?type=nid=2077409name=Excel_Figure.png
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing
On 2010-05-01 7:13, Berend Hasselman wrote:
David Winsemius wrote:
On May 1, 2010, at 3:28 AM, Berend Hasselman wrote:
Shant Ch wrote:
I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used
the
following code,
uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower
with Wald CIs.
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained
, 4)
A[upper.tri(A)] - vu
A - A + t(A)
diag(A) - vd
A
-Peter Ehlers
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide
such degenerate (and/or
near degenerate) cells and be able to plot the rest.
I don't know of any robust ecdf function, but I would
consider a data manipulation step before the call to Ecdf
to submit only valid data. (But you've probably already
tried that and found it too cumbersome.)
-Peter Ehlers
= n)
axis(1, at = as.numeric(tax), lab = weekdays(tax, TRUE))
-Peter Ehlers
Contrast the x axis result of image with that of plot
plot(tax,rnorm(length(tax)))
where the date-time shows stamps work fine.
How can I get image to behave (or is there a better function for the job?)
Sincerely
=apply(x,2,mean); matrix(x2,byrow=F,nrow=5);
Here is one more way: create a 3-dim array, then apply mean():
za - array(unlist(ll), dim = c(5,6,5))
mn - apply(za, c(1,2), mean)
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
to be quite receptive to intelligent and
well thought-out suggestions. But It is very annoying! is
not the right approach.
-Peter Ehlers
I have sympathies with the author. When I first began using R
(migrating from Matlab), I also found the vector concept strange,
especially because I was doing a lot
Type
?||
and read the help page.
If it helps, the statement is equivalent to
if( (a 10) || (j 100) )
-Peter Ehlers
On 2010-04-26 23:00, assaedi76 assaedi76 wrote:
R users
Thanks in advance
Could someone tell me what this condition means:
if ( a 10 | |j 100)
Thanks
-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
Behalf Of Peter Ehlers
Sent: April-24-10 11:57 PM
To: Anthony Lopez
Cc: R-help@r-project.org
Subject: Re: [R] categorical variable in scatterplot (car)
On 2010-04-24 21:30, Anthony Lopez wrote:
Hello R folks,
I am encountering
and formulate a response to the second. One
may well prefer not to have one's workspace cleared even
though this would not lose more than the temporarily
suspended work. So, is ther *ever* a good reason to
*not* put rm(list=ls()) behind a comment char? I doubt it.
Just my 2c.
-Peter Ehlers
On 2010-04-24 11
, and it's a
hassle to close it down and restart it.
Hadley
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting
to your predict call. Reproducible code
would be best.
-Peter Ehlers
On 2010-04-24 12:45, Brittany Hall wrote:
Hello,
I am trying to calculate predicted values derived from one dataset into a
hypothetical dataset. I tried this line of code:
graphdata$fmgpredvalues- predict(Acs250.3.4
fix this without recoding my
variable?
Make z a factor (which it really should be anyway).
-Peter Ehlers
Thank you!
Anthony
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
Works for me. Did you replace the '' in mylist()
with appropriate c(,) code? For example:
mylist - list(c(0,30), c(40,80), c(0,50),
c(0,50), c(0,50), c(0,50))
-Peter Ehlers
On 2010-04-23 9:22, zhenjiang xu wrote:
Peter, thanks, but that doesn't work. Did I missed something
Greg has provided a solution. Just to answer the question of
why set_complement() is not doing what you think it should:
You need to change your *vectors* nom and denom to *sets*
with as.set().
-Peter Ehlers
On 2010-04-23 9:42, Greg Snow wrote:
Here is a different approach that may work
suggested, then you have
to use limits=mylist, not ylim=mylist.
This was due to my not testing the code carefully.
Sorry about that.
-Peter Ehlers
library(lattice)
barchart(yield ~ variety | site,data=barley, groups = year, layout =
c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space
) )
$minimum
[1] 8.5
$objective
(Intercept)
3.155444e-30
Another (crude) way is to use locator(). I usually maximize
the plot window for this.
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
Package tm does not have a function TermDocMatrix.
Where did you get the idea that it does?
There _is_ a function TermDocumentMatrix, however.
-Peter Ehlers
On 2010-04-23 10:21, Ignacio mas data wrote:
Hi List
I have the next code and the error. I have try with other codes and I have
120 0.13317708
new - data.frame(s1,cm)
plot(s1,cm)
f - function(x,a,b){a*exp(-b*x)} fm -
nls(cm~f(x,a,b),data=new,start=c(a=1,b=1)) co - coef(fm)
Presumably you want f(s1,a,b) in your nls call.
-Peter Ehlers
curve(f(x,a=co[1],b=co[2]),add=TRUE,col=blue
Ehlers
Thank you!
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
If the 'border' argument is not recognized, then this won't work.
Steve:
What version of R are you using? I have no problems with the
suggestions I gave you in R 2.10.1 or R 2.11.0 alpha.
-Peter Ehlers
On Mon, Apr 19, 2010 at 4:21 AM, Steve Murraywrote:
Dear all,
Thanks for the response
On 2010-04-21 4:35, Peter Ehlers wrote:
The 'border' argument was added in 2.1.10.
Egad! Did I really type that?
I meant 'in R 2.10.0'.
-Peter Ehlers
On 2010-04-21 1:53, Steve Murray wrote:
Thanks Peter,
I'm using version 2.8.0 (2008-10-20). This version should be recent
enough
] NA
s.npk.aov[[1]]['Pr(F)'][[1]][1]
[1] 0.01593879
or, if you prefer:
s.npk.aov[[1]]['block', 'Pr(F)']
#[1] 0.01593879
-Peter Ehlers
On the other, the procedure to extract coefficients from a summary of
lm or aov should be the same.
I think one generally extracts the coefficients from
Try using contour() instead of levelplot. See the examples
in help('contour') for how to add contour lines to an
existing plot.
-Peter Ehlers
On 2010-04-21 13:08, David Winsemius wrote:
On Apr 21, 2010, at 2:27 PM, Simon Goodman wrote:
I've generated a levelplot showing the density
On 2010-04-19 8:11, Thomas Stewart wrote:
Try border=c(0,0,1,0).
-tgs
If the 'border' argument is not recognized, then this won't work.
Steve:
What version of R are you using? I have no problems with the
suggestions I gave you in R 2.10.1 or R 2.11.0 alpha.
-Peter Ehlers
On Mon, Apr 19
of thumb},
publisher = {Wiley series in probability and statistics},
year = {2002},
author = {Gerald van Belle}
}
And a very fine book it is, too. Highly recommended.
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
James,
It's actually the bars for hour 3 (which don't exist) that are
missing. You still need the 'drop.unused.levels=FALSE' and if
you make 'OnHour' into a factor then you won't need the
'horizontal=FALSE'.
-Peter Ehlers
On 2010-04-19 8:27, James Rome wrote:
You were right about the gdf
are needed for your plot
question, there really is no need to give us 21 variables.
-Peter Ehlers
On 2010-04-17 6:48, James Rome wrote:
The data are at http://dl.dropbox.com/u/537118/gdf.zip
On 4/17/2010 1:42 AM, Deepayan Sarkar wrote:
On Fri, Apr 16, 2010 at 1:54 PM, James Romejamesr...@gmail.com
superior to what passes for
documentation from, say, MS.
-Peter Ehlers
The only thing that put the correct data on the correct hours was to
call xyplot instead of bwplot, with panel.bwplot in the panel function.
Sorry for being so dense, but I really find it much harder to read R
documentation
'gdf$': this makes no sense to me.
What error occurs if you leave that off?
-Peter Ehlers
On 2010-04-17 13:00, James Rome wrote:
David,
I did post a solved message:
hrs = seq(0, 23, 1)
hrlabs = as.character(seq(0,23,1))
g = xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data
and then adding your preferred
labels at your preferred locations:
truehist(x, nbins = 4, xaxt = n) ## see xaxt under ?par
axis(1, at = 0:3 + 0.5, labels = 0:3)
I usually add
box(bty = l)
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing
to define a colClasses vector whose
elements are NA for columns to be read and NULL for
columns to be skipped, and then read x.csv with that
colClasses vector.
I have no idea how slow this would be.
-Peter Ehlers
__
R-help@r-project.org mailing list
https
as a 'good' or 'bad' correlation. Everything
depends on context. You shouldn't use a statistic if you don't
understand it.
-Peter Ehlers
Cheers,
--
David Nemer
On Sat, Apr 10, 2010 at 2:58 PM, Gabor Grothendieckggrothendi...@gmail.com
wrote:
Try this:
A- c(file1.java, file3.java, file2
blank column between successive labels.
Does this give you what you have in mind:
text(par(usr)[1] + max(strwidth(paste(lab1, ))),
2:4,lab1,adj=c(0,0.5))
-Peter Ehlers
Thanks!
Hocine
[[alternative HTML version deleted]]
__
R-help
should always tell us what contributed packages you are using.
Here, the qqmath function is from pkg:lattice.
Now check FAQ 7.22.
-Peter Ehlers
As I wrote, I'd really appreciate the understand where this behaviour
comes from.
Thanks in advance,
Uwe
the help page.
panel.densityplot(x, darg = list(bw = nrd, adjust = 1.2), ...)
(I would use one of the built-in bandwidth selectors with a
suitable 'adjust' value.)
-Peter Ehlers
Thanks again,
Santosh
On Thu, Apr 15, 2010 at 12:41 AM, Paul Hiemstrap.hiems...@geo.uu.nlwrote:
Santosh wrote
On 2010-04-15 4:03, Uwe Dippel wrote:
Peter Ehlers wrote:
par(mfrow=c(1,1))
qqnorm(rnorm(20))
qqmath(rnorm(20))
par(mfrow=c(3,4))
for(i in 1:12)qqnorm(rnorm(20))
Until here everything works as expected, and the last line prints 12
samples of qqnorm. However,
for(i in 1:12)qqmath(rnorm(20
; it should be just stem(possum$hdlngth).
-Peter Ehlers
Uwe
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
On 2010-04-15 5:00, Uwe Dippel wrote:
Peter Ehlers wrote:
You are mixing 'traditional' graphics (par(...)) and
'lattice' graphics.
That won't work. In lattice, you use the 'layout' argument to
select the number of columns/rows. This is easiest if you set
up a conditioning variable:
cond - gl
of every year):
axis(1, at=seq(1,96,12), 1978:1985)
Your seq() needs to index the elements of temp.
Something like
axis(1, at = temp[seq(...)], ...)
-Peter Ehlers
This one has stumped me somewhat, so I'd be grateful to receive any suggestions
as to how I might resolve this.
Many thanks
I don't know what else is wrong, but do you really want
a shape parameter equal to 28? gamma(28) is about 10^28.
That's not a model I would trust.
-Peter Ehlers
On 2010-04-15 9:37, Asif Wazir wrote:
Dear all
i want to estimated the parameter of the gamma density(a,b,d)
f(x) = (1/gamma(b
= FALSE # in which case no box is drawn for any element
or
border = c(NA, NA, black, NA)
-Peter Ehlers
Many thanks,
Steve
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Get rid of the unnecessary c(...) construction:
recode(green_2004_2$french, 50:100=0; 0:49.99=1)
-Peter Ehlers
On 2010-04-14 1:56, Simon Kiss wrote:
Dear colleagues,
in the help archive there was a previous person who encountered a
problem with the recode command in the car library. I'm
you
anything:
do.call(c, list('a', 'b'))
[1] a b
c - 3
do.call(c, list('a', 'b'))
Then try
rm(c)
and run your Venn code again.
-Peter Ehlers
What's frustrating is that a colleague with different versions of R
(2.8.x) and some of the libraries gets the above function to work fine.
I
I think that this package is very much in the early stages
of development. It may be that the tsts function is still
just a gleam in the eyes of the developers. The paper that
you cite may be ahead of code development.
-Peter Ehlers
On 2010-04-14 10:20, dbonneau wrote:
Thank you so much
)
for n %in% 1:7
-Peter Ehlers
Specific context:
This problem arises e.g. in the context of help files (.Rd) whose
example section contains only code that is not to be run (\dontrun
markup). Running the function example() (that itself calls
source(,echo=TRUE)) on such a file will not display
variables.
-Peter Ehlers
Any help with this would be much appreciated,
Matthew Carroll
### example code
resp- rpois(30, 5)
cat- factor(rep(c(1:3), 10))
var1- rnorm(30, 10, 3)
mod- glm(resp ~ var1 * cat, family=poisson)
summary(mod)
Call:
glm(formula = resp ~ var1 * cat, family = poisson
you a more
definitive solution, but this works:
Make a copy of the function (rename it) and replace that
line with:
data - eval(object$call$data, envir = parent.frame())
Then call your new function instead of match.data.
-Peter Ehlers
The object ex follows:
ex- structure(list(treatment = c
the
suffix 1. The second part requires text so it can use the
paste function.
save((paste(unislopes,master.i,sep=),file=paste(unislopes,master.i,.Rdata,sep=))
Any ideas?
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https
, pch=20, col=cols, cex=1.2)
},
key = list(space=right,
text=list(labels=c('test1','test2','test3')),
points=list(pch=20, cex=1.2, col=cols))
)
print(all, position=c(0,0,1,.7))
-Peter Ehlers
Thanks for your help
Jannis
and may be unlawful.
-Original Message-
From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Wednesday, March
31, 2010 2:03 PM
To: Czerminski, Ryszard
Cc: R-help@r-project.org; David Meyer
Subject: Re: [R] library sets: A EMPTY does not work;
gset_intersection(A,EMPTY) works
Ryszard
...
dm - melt(wide)
# replace dm$variable with appropriate factor
dm$variable - gl(2, 2, nrow(dm), c('x1','x2'))
# choose names for columns
names(dm) - c('Treat', 'x', 'value')
I agree that this 'long' format is usually most useful for
further analysis.
-Peter
--
Peter Ehlers
University
This worked for me in R 2.11.0 alpha:
df - data.frame(a = a\b, v = 4, z = this is Z)
write.csv(df, test.csv, row.names = FALSE, quote = FALSE)
read.csv(test.csv, quote = )
-Peter Ehlers
On 2010-04-07 19:09, Hadley Wickham wrote:
df- data.frame(a = a\b)
write.table(df, test.csv, sep = ,, row
, due to simply
doubling the one-sided p-value.
-Peter Ehlers
Uwe
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented
for all rows.
From your other post(s) on escaped quotes, I assume that
this won't solve your problem with the existing files. (:
Try this:
create a text file with the lines
a,a
\bc\
d\e,f\g
count.fields(file, sep = ,).
[1] 1 1 2
-Peter Ehlers
On 2010-04-07 19:26, Hadley Wickham wrote:
url
On 2010-04-08 9:10, Hadley Wickham wrote:
Remove the comma and count.fields gives 11 for all rows.
From your other post(s) on escaped quotes, I assume that
this won't solve your problem with the existing files. (:
Right - but assuming I'm not crazy, that should cause an error in
read.csv,
base
other attached packages:
[1] sets_1.0-4
-Peter Ehlers
On 2010-04-07 6:54, Czerminski, Ryszard wrote:
Thank you for looking into it!
There is still something I do not understand (despite different numerics on
different machines, etc.)
On my system plain p == p (where p's are from runif
ddply on a bunch of variables?
Thank you very much for your advise!
Yes, there is: colwise()
f - function(x) x / mean(x, na.rm = TRUE)
ddply(x, group, colwise(f, c(a, b)))
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
for combinations, or integer n for x - seq(n).
and factors are not vectors.
Two things will work with factors:
1. use combn(as.character(yourfactor), m)
2. use combn(yourfactor, m, simplify = FALSE) which will return a list.
-Peter
This occurs in R 2.10.1
Thanks,
Greg
--
Peter Ehlers
, panel = mypanel.cloud, lineend = square)
Your choice are round (default), butt and square.
-Peter Ehlers
Thanks in advance
Dan
P.S. the reason for this is that the round end looks bad at lwd=3 or
more
Daniel Alcock
Malaria Genetics (T112)
Wellcome Trust Sanger Institute
Cambridge
CB10 1SA
UK
What a dummy I am. It just occurred to me that you can set
grid graphical parameters with par.settings.
cloud(your stuff,
par.settings = list(grid.pars = list(lineend = butt)))
-Peter Ehlers
On 2010-04-06 14:53, Peter Ehlers wrote:
On 2010-04-06 7:28, Daniel Alcock wrote:
First
Since this may be homework, I'll confine myself to a hint (which
may or may not be the problem; I haven't checked):
The formula you use for z is strongly dependent on the value of 'n'.
-Peter Ehlers
On 2010-04-05 6:06, hix li wrote:
Hi guys,
I have two data sets of prices: endprice0
If I understand correctly what you want (according to your loop),
you could use the na.locf function in pkg:zoo.
library(zoo)
mat - t(apply(mydata, 1, na.locf, fromLast=TRUE, na.rm=FALSE))
dat - as.data.frame(mat) ## since apply returns a matrix
-Peter Ehlers
On 2010-04-05 10:52, Anna
Marsh,
Your rectangles won't be very tall with ymax=ymin!
(I hope that wasn't the cause of the 5 hours.)
-Peter Ehlers
On 2010-04-04 14:18, Marshall Feldman wrote:
Hi R fans,
As a newbie following the five-hour rule (after hitting my head against
the wall for five hours, post to this list
Google leads to some discussion on the Intel Sofware Network:
http://software.intel.com/en-us/forums/showthread.php?t=64585
Be warned: I haven't read the discussion.
-Peter Ehlers
On 2010-04-02 9:30, jacob wrote:
Dear Lists:
I recently ran quite annoyance problem while running R on Ubuntu
~ species, data=dataset)
## Rich
[[alternative HTML version deleted]]
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org
here
x- db1[[1]]
is.vector(x)
[1] FALSE
so I think that this at least explains why it doesn't work as
you expected.
db2 - stack(lapply(db1, as.character))
will do it.
-Peter Ehlers
Thank you for your help.
Kenneth
--
Peter Ehlers
University of Calgary
I can put the text at the
correct position in the panel.function?
You probably want current.panel.limits().
-Peter Ehlers
Thanks,
Jim Rome
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
and 12 slopes as the remaining coefs.
Then you can use
cof - coef(mod)
for(i in 1:12) abline(a=cof[i], b=cof[12 + i])
to plot the 12 lines.
-Peter Ehlers
On 2010-04-01 16:21, Steven Worthington wrote:
Dear R users,
i'm using a custom function to fit ancova models to a dataset. The data
(a)) print(r- lm(a[ ,i] ~ b) )
#Note the comma!
-Peter Ehlers
On 2010-03-31 7:42, David Winsemius wrote:
On Mar 31, 2010, at 9:13 AM, Driss Agramelal wrote:
Hello and thank you both for your answers!
Dennis, I tried to simply run
lm(a ~ b)
after re-importing a as a matrix, but I get
Unless I'm missing something, I don't see any method
in pkg:sets for intersection other than gset_intersection.
So you're using the base R function `` whose help page
tells you that its arguments should be vectors. Yours
aren't.
-Peter Ehlers
On 2010-03-31 8:50, Czerminski, Ryszard wrote
On 2010-03-31 9:30, Peter Ehlers wrote:
Unless I'm missing something, I don't see any method
in pkg:sets for intersection other than gset_intersection.
Whoops, a bit quick on the draw.
There are of course also set_intersection and cset_intersection,
but not AFAICS any method for ``.
-Peter
to call the relevant 'Ops' function:
class(A)
#[1] gset cset
class(B)
#[1] gset cset
class(E - A - A)
#[1] set gset cset
If you re-order the class vector, function Ops.gset will be called
to handle A and E:
class(E) - class(E)[c(2,3,1)]
A E
#{}
I've cc'd David Meyer.
-Peter Ehlers
On 2010-03-31
Perhaps you're just looking for the diff() function?
See ?diff.
-Peter Ehlers
On 2010-03-30 7:15, Niklaus Hurlimann wrote:
Hi R mailing list,
probably a very basic problem here, I try to do the following:
Q-c(1,2,3)
P-c(4,5,6)
A- data.frame(Q,P)
A
Q P
1 1 4
2 2 5
3 3 6
this is my
replace the line
is.na(tBoth[tBoth 2.5]) - TRUE
with
tBoth[tBoth 2.5] - NA
and the rest should work.
Thanks again,
Paul
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Karl,
I strongly support Chuck's recommendations.
If you do still want to compute such probabilities 'by hand',
you could consider the lchoose() function which does work
for your example.
-Peter Ehlers
On 2010-03-30 9:55, Charles C. Berry wrote:
On Tue, 30 Mar 2010, Karl Brand wrote:
Dear
(and others): get used to using
TRUE and FALSE. The few characters saved by using T/F
are not worth it!
-Peter Ehlers
On 2010-03-26 15:40, Glenn E Stauffer wrote:
I am trying to load a package called Rmark, but when I run
library(Rmark)
I get the following:
library(RMark)
Error
vtest(ma,c(3,7))
[1] TRUE
vtest(ma,c(1,7))
[1] FALSE
Berend
--
Peter Ehlers
University of Calgary
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting
) or to sort before testing:
vtest - function(x, lookfor){
any(apply(x, 1, function(v)
{identical(sort(v), sort(lookfor))}))}
-Peter Ehlers
On 2010-03-27 2:46, Berend Hasselman wrote:
David Scott-6 wrote:
I am sure someone can come up with a clever way of doing
I imagine it's in
https://svn.r-project.org/R/trunk/src/main/model.c
-Peter Ehlers
On 2010-03-05 12:43, Werner W. wrote:
Hi,
I would like to see how model.matrix expands factor column to a set of dummy
columns. I think that is done int .Internal(model.matrix(t, data)) which is
called
801 - 900 of 1249 matches
Mail list logo