Tena koe Daren
One alternative:
apply(m, 1, function(x) 100*summary(factor(x,
levels=-1:1))/length(x[!is.na(x)]))
Doubtless there are others.
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Daren T
Hello,
Since this an R package, I'm sending the email. I'm loading all the
jar files as:
library(rJava)
hadoop <- Sys.getenv("HADOOP")
allfiles <-
c(list.files(hadoop,pattern="jar$",full.names=T),list.files(paste(hadoop,"lib",sep=.Platform$file.sep,collapse=""),pattern="jar$",full.names=T))
allfi
Dear Ivan,
On 3/23/09, pfc_ivan wrote:
>
> Hello guys, I am stuck here:
>
> How do I make 1000 samples of n = 10 observations from an Exponential
> distribution and then compute the mean for all those 1000 samples?
>
The R Commander will do this. See the menus Distributions ->
Continuous -> Exp
G'day Carl,
On Mon, 23 Mar 2009 20:11:19 -0400
Carl Witthoft wrote:
> >From: Wacek Kusnierczyk
> >Date: Sun, 22 Mar 2009 22:58:49 +0100
>
>
> >just for fun, you could do this with multiassignment, e.g., using
> >the (highly experimental and premature!) rvalues:
>
> >source('http://m
Try this (haven't checked the speed):
f <- function(x) table(factor(x, c(-1, 0, 1)))
100 * prop.table(t(apply(m, 1, f)), 1)
On Mon, Mar 23, 2009 at 8:46 PM, Daren Tan wrote:
> I have a matrix containing -1, 0, 1, however certain rows will not
> have all 3 numbers. I have written some codes to c
Try this:
> library(chron)
> x <- c("06/25/04", "06/25/2004", "03/03/59", "03/03/1959")
> chron(x)
[1] 06/25/04 06/25/04 03/03/59 03/03/59
On Mon, Mar 23, 2009 at 8:06 PM, Farrel Buchinsky wrote:
> How does one convert to a date format when survey respondents have
> used two different date form
G'day Kevin,
On Mon, 23 Mar 2009 18:48:16 -0400
wrote:
> Sorry to be so dense but the article that you suggest does not give
> any information on how the arguments are packed up. I look at the
> call:
>
> val <- .Internal(fmin(function(arg) -f(arg, ...), lower, upper, tol))
>
> and then with t
The result of the code shown below is posted at the following URL:
http://n2.nabble.com/Trying-to-properly-label-abline-td2524629.html
I would like to figure out a better way to label the horizontal abline.
I tried multiplying the text y position by a scale, but this didn't always put
the text
?rect
--
David Winsemius
On Mar 23, 2009, at 11:01 PM, Jason Rupert wrote:
The result of the code shown below is posted at the following URL:
http://n2.nabble.com/Trying-to-properly-label-abline-td2524629.html
I would like to figure out a better way to label the horizontal
abline.
I t
Hello all,
This is something that I am sure has a really suave solution in R, but I can't
quite figure out the best (or even a basic) way to do it.
I have a simple linear regression that is fit with lm for which I would like to
estimate the x intercept with some measure of error around it (conf
Try this:
library(plotrix)
plot(x_vals, y_vals)
abline(h=min(y_vals), col="darkred")
boxed.labels(max(x_vals) - strwidth(bottom_label)/2, min(y_vals) +
strheight(bottom_label), bottom_label)
See ?boxed.labels for more.
On Mon, Mar 23, 2009 at 11:01 PM, Jason Rupert wrote:
>
> The result of the
I am writing my thesis with the function gam(), with the package {mgcv}.
My command is: gam(y~s(x1,bs="cr")+s(x2, bs="cr")).
I need help to know what are the default basis funcitons for gam. I have not
found any detailed reference for this.
Can anyone help me with this??
--
View this messa
I need to have the maths symbol for >= in the legend, and to
substitute threshold variable with its value. Somehow, various
attempts weren't successful. Please help.
threshold <- 0.5
plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1),
xaxs="i", yaxs="i")
legend(x=0, y=1, fill=c(
Try
Wood S.N. (2006) Generalized Additive Models: An Introduction
with R. Chapman and Hall/CRC Press.
listed in the references in the help file of the function.
It's a great read.
Andrew
On Mon, Mar 23, 2009 at 07:36:44PM -0700, oliviax wrote:
>
> I am writing my thesis with the fun
the plotmath help page should give the answer
http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/base/html/plotmath.html
On Mar 24, 2:53 pm, Daren Tan wrote:
> I need to have the maths symbol for >= in the legend, and to
> substitute threshold variable with its value. Somehow, various
> attemp
For the legend argument try this:
leg = as.expression(c(sprintf("Up (>= %d)", threshold),
"Normal", "Down", "NA"))
or use paste in place of sprintf.
On Mon, Mar 23, 2009 at 11:53 PM, Daren Tan wrote:
> I need to have the maths symbol for >= in the legend, and to
> substitute threshold v
I'm not sure what you meant by "a topic on newton's method"
(algorithm? demo?), but the demonstration in the package 'animation'
might help:
install.packages('animation')
par(pch = 20)
ani.options(nmax = 50)
newton.method(function(x) 5 * x^3 - 7 * x^2 - 40 *
x + 100, 7.15, c(-6.2, 7.1))
Regar
I tried sprintf and paste, which solves one of my problem i.e.
replacing the variable name by its value. However, >= is not renderend
correctly as the inequality symbol.
On Tue, Mar 24, 2009 at 12:24 PM, Gabor Grothendieck
wrote:
> For the legend argument try this:
>
> leg = as.expression(c(sprin
101 - 118 of 118 matches
Mail list logo