On May 2, 2009, at 12:18 AM, RON70 wrote:
Can anyone please explain me why it is not coming? I have done
following :
j=1
i=0:j; sum( choose(i+j,i) )
[1] 3
j=2
i=0:j; sum( choose(i+j,i) )
[1] 10
j=3
i=0:j; sum( choose(i+j,i) )
[1] 35
j=0:3; i=0:j; sum( choose(i+j,i) )
Warning messag
RON70 wrote:
>
> Dear all, is it possible to extract the seed that was used for some random
> number generation? For example suppose I draw a random sample of size 1000
> from a normal population :
>
> rnorm(1000)
>
> Now I want to know what seed R used for that sample generation. Any way
> ou
Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow =
nr, :
invalid 'ncol' value (too large or NA)
the statement was:
for (i in v) {for (j in m[0,]){if(v[i]==m[0,j]){M[,-j]}}}
where 'v' is a vector, and 'm' and 'M' are both matrices.
--
View this message in context:
Can anyone please explain me why it is not coming? I have done following :
> j=1
> i=0:j; sum( choose(i+j,i) )
[1] 3
> j=2
> i=0:j; sum( choose(i+j,i) )
[1] 10
> j=3
> i=0:j; sum( choose(i+j,i) )
[1] 35
> j=0:3; i=0:j; sum( choose(i+j,i) )
Warning message:
In 0:j : numerical expression has 4 elem
Dear all, is it possible to extract the seed that was used for some random
number generation? For example suppose I draw a random sample of size 1000
from a normal population :
rnorm(1000)
Now I want to know what seed R used for that sample generation. Any way out?
Thanks and regards,
--
View
> > x wrote:
> > > x2NA 1.797e+14NA NA
> > > x2' NA 6.475e+14NA
> NA
> > >
> > > Residual standard error: 82.44 on 95 degrees of
> > freedom
> > > Adjusted R-Squared: 0.9992
> > > Error in if (coef[i] > 0 & (i > 2 |
> coef[1]
> > != 0 | Intc !=
Dear Tony,
>From ?scatterplot:
"reset.par: if TRUE then plotting parameters are reset to their previous
values when scatterplot exits; if FALSE then the mar and mfcol parameters
are altered for the current plotting device. Set to FALSE if you want to add
graphical elements (such as lines) to the
Dear R-sians...
Installing libraries through RCMD INSTALL does not seem to work.. Is the
following command c
R CMD install -l "C:\Program Files\R\R-2.8.1\library"
"C:\temp\xpose4_4.0.4_win32
.zip"
I get the following error message.
'C:\temp\xpose4_4.0.4_win32.zip':Windows binary packages in zipfi
What is the model behind stem's scale? How the number of bins are
determined? In the following example session, scale=1 and scale=2 has
the same result.
> stem(c(11,21,31),scale=2)
The decimal point is 1 digit(s) to the right of the |
1 | 1
1 |
2 | 1
2 |
3 | 1
> stem(c(11,21,31),sca
On May 1, 2009, at 7:04 PM, Fritsander Lahr wrote:
Already searched the net for a solution, but couldn't find one.
The piston ring example works fine on my XP laptop and R installation.
However, using the dataset enclosed (I've also enclosed the script
file
used) only type="S" works and bot
Dear Elizabeth,
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
> Behalf Of Elizabeth Pringle
> Sent: May-01-09 6:59 PM
> To: r-help@r-project.org
> Subject: [R] computationally singular and lack of variance parameters in
SEM
>
> Hi all,
Perhaps:
SSCxy <- function(z) {tail(sapply(0:z, function (x) sum(sapply(0:x,
function(y) sum(choose(x+y, y), 1) }
> SSCxy(5)
[1] 462
See also:
http://www.research.att.com/~njas/sequences/?q=1%2C3%2C10%2C35%2C126%2C462&sort=0&fmt=0&language=english&go=Search
On May 1, 2009, at 3:45 PM
Use write.csv to output a zoo object, and found the first column in excel
like: (08-10-16 13:12:00)
How to make it look like : 10/16/2008 13:12:00 ?
write.csv(x=zoo.object)
Thanks!
[[alternative HTML version deleted]]
__
R-he
Hi All,
Already searched the net for a solution, but couldn't find one.
The piston ring example works fine on my XP laptop and R installation.
However, using the dataset enclosed (I've also enclosed the script file
used) only type="S" works and both "R" and "xbar" don't. Entering ylim w
Dear R experts
I need to write a function that incorporates double summation, the problem
being that the upper limit of the second summation is the index of the first
summation, i.e:
sum_{j=0}^{x} sum_{i=0}^{j} choose(i+j, i)
where x variable or constant, doesn't matter.
The following code obviou
Hi all,
I am trying to set up a simple path analysis in the SEM package, but I am
having some trouble. I keep getting the following error message or
something similar with my model, and I'm not sure what I'm doing wrong:
Error in solve.default(C) :
system is computationally singular: reciprocal
Dear R-sians!
The following command works fine on Dos Prompt, but not in a windows batch
script...
dir /S /B C:\Progra~1\R\R* |findstr /I "rcmd.exe" |findstr /I "2.8.1"
how do I implement the above in a windows batch script? I tried to use:
for /F "usebackq tokens=*" %%i in (`dir /S /B C:\Progra
Try this:
> library(zoo)
> z <- zoo(cbind(a = 1:4, b = 5:8), Sys.time() + 0:3 * 3600)
>
> z0 <- zoo(coredata(z), format(time(z), "%m-%d-%y %H:%M:%S"))
> write.zoo(z0, sep = ",")
"Index","a","b"
"05-01-09 17:59:31",1,5
"05-01-09 18:59:31",2,6
"05-01-09 19:59:31",3,7
"05-01-09 20:59:31",4,8
On Fr
I write about R every weekday at http://blog.revolution-computing.com
. In case you missed them, here are some articles from the month of
April of particular interest to r-help subscribers. Thanks to everyone
who has been following the blog and sending me messages and/or leaving
comments -- it alwa
Mark,
Give a look:
rres<-read.table(stdin(), head=T, sep=",")
ID,Traversed, v2
1,5,1
1,7,1
1,8,1
2,8,2
2,11,2
2,7,2
3,11,3
3,22,3
3,16,3
aggregate(rres[c("Traversed", "v2")], list(rres$ID), sum)
bests
milton
On Fri, May 1, 2009 at 5:07 PM, Altaweel, Mark R. wrote:
> Hi,
>
> I am trying to
Hi,
I am trying to sum column information in a list with 3 instances.
For example:
ID Traversed IDTraversed IDTraversed
1 5 1 71 8
2 8 2 11 2 7
3
Hi Cathy,
I interpreted your situation a little differently than the other
responses. Please ignore this if their suggestions solved your
problem.
I assumed you have abundance where available, but otherwise it wasn't
recorded--not as NA, just unrecorded. You want to fill in the missing
"rows" w
On 2009-April-30 , at 22:28 , Gabor Grothendieck wrote:
Check out the getopt package.
Thanks! That's what I need.
JiHO
---
http://jo.irisson.free.fr/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
On Fri, May 01, 2009 at 03:23:18PM -0500, hadley wickham wrote:
>
> If you have a categorical x axis, you need to specify the group
> aesthetic which defines what group of points should form a line. It's
> hard to tell what that should be from your example, maybe sp?
>
Yes, adding group=sp work
Dear phoebe,
See
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f
HTH,
Jorge
On Fri, May 1, 2009 at 4:15 PM, phoebe kong wrote:
> Hi All,
>
> I have problem about the factor features.
>
> I read in a .cvs file, a column which is supposed to be numeric, but
If you read it in properly it _would_ be numeric. So there is either a stray
nonnumeric entry somewhere (comma, quote, ..?) -- check your input carefully
-- or you have not read it in properly. The latter appears to be the case:
what's that "newXaxis" level in the printout about? You need to fix th
Tell me how this works out for you. I think R is seeing your "newXaxis"
variable as a character variable because there is some non-numeric string
in there, then it converts to factor. Try setting stringsAsFactors=FALSE
in the read.csv and see if it is then read as character. If it is, try
yo
On Fri, May 1, 2009 at 2:38 PM, Zeljko Vrba wrote:
> On Fri, May 01, 2009 at 01:06:34PM -0500, hadley wickham wrote:
>>
>> It should be trivial with ggplot2 too, but it's hard to provide
>> concrete advice without a concrete problem.
>>
> Elementary problem:
>
> qplot(wg, v.realtime, data=df.best.
Hi All,
I have problem about the factor features.
I read in a .cvs file, a column which is supposed to be numeric, but it
becomes factor level data after reading in.
mydata[,"newXaxis"]
[1] 0 0.430010601 11.23198508 25.00940297 37.75338045
45.98289639
[7] 48.92328133 52.51142822 61
Hello Everyone-
I'm in the process of slowly learning R and am having a little bit of
trouble plotting an extra line onto a scatterplot. I'm sure the answer
is quite simple but I am stumped.
The code I am using is:
headways <- read.table("headways.csv", header=TRUE, sep=",",
na.strings="", d
I'm not sure what was going on, but trying to decipher it was taking too
much time so I threw out most of the packages and started over with a clean
slate. I don't get the error now. Thanks anyway.
Peter Keller
Wildlife Biologist
Tetlin National Wildlife Refuge
Uwe Ligges wrote on 04/28/2009
On Fri, May 01, 2009 at 09:38:13PM +0200, Zeljko Vrba wrote:
> On Fri, May 01, 2009 at 01:06:34PM -0500, hadley wickham wrote:
> >
> > It should be trivial with ggplot2 too, but it's hard to provide
> > concrete advice without a concrete problem.
> >
> Elementary problem:
>
> qplot(wg, v.realtim
On Fri, May 01, 2009 at 01:06:34PM -0500, hadley wickham wrote:
>
> It should be trivial with ggplot2 too, but it's hard to provide
> concrete advice without a concrete problem.
>
Elementary problem:
qplot(wg, v.realtime, data=df.best.medians$gv1, facets = . ~ n, colour=sp)
produces a nice plot
Jorge Ivan Velez wrote:
Dear Seung,
Try this:
Names <- letters[1:5]
Names
[1] "a" "b" "c" "d" "e"
apply(t(combn(Names,2)), 1, paste, collapse="")
[1] "ab" "ac" "ad" "ae" "bc" "bd" "be" "cd" "ce" "de"
another option is to use the 'FUN' argument of combn(), e.g.,
combn(Names, 2, FUN = past
Dear Seung,
Try this:
> Names <- letters[1:5]
> Names
[1] "a" "b" "c" "d" "e"
> apply(t(combn(Names,2)), 1, paste, collapse="")
[1] "ab" "ac" "ad" "ae" "bc" "bd" "be" "cd" "ce" "de"
HTH,
Jorge
On Fri, May 1, 2009 at 2:55 PM, SEUNG CHEON HONG
wrote:
> Dear R-list,
>
> Is there any way I can
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of David Freedman
> Sent: Friday, May 01, 2009 11:52 AM
> To: r-help@r-project.org
> Subject: [R] sequence number for 'long format'
>
>
> Dear R-help list,
>
> I've got a data se
On May 1, 2009, at 2:55 PM, SEUNG CHEON HONG wrote:
Dear R-list,
Is there any way I can extract part or whole column name from two
variables and combine them? Not values, but column names.
For example,
I have data set with 70 variables. The column names are "Alfalfa",
"Corn","Soybean",..."Sunf
Try this:
ds$seq <- ave(ds$id, ds$id, FUN = seq_along)
On Fri, May 1, 2009 at 2:52 PM, David Freedman <3.14da...@gmail.com> wrote:
>
> Dear R-help list,
>
> I've got a data set in long format - each subject can have several (varying
> in number) measurements, with each record representing one me
Dear R-list,
Is there any way I can extract part or whole column name from two
variables and combine them? Not values, but column names.
For example,
I have data set with 70 variables. The column names are "Alfalfa",
"Corn","Soybean",..."Sunflower". After I combine the two variable (say
Alfalfa a
Dear R-help list,
I've got a data set in long format - each subject can have several (varying
in number) measurements, with each record representing one measurement. I
want to assign a sequence number to each measurement, starting at 1 for a
person's first measurement. I can do this with the by
> My issue is self-evident: using this method resulted in a 30 fold
> increase in time. My question is why? If I time the individual
> components separately, nothing is unusual. My hunch is the
> "interaction" between the model.matrix and nsga2 methods.
>
> Any ideas on how to speed this proces
On Fri, May 1, 2009 at 1:55 PM, Zeljko Vrba wrote:
> Hello,
>
> What would you recommend for producing publication-quality plots with R?
> Built-in graphics, trellis, ggplot2, or something else?
>
> Basic requirements:
>
> - I need to draw line-, box-, density-plots, bar-charts and histograms
> -
Hi,
Apologies in advance for a question that's not directly related to R.
I had a quick google, and didn't find any nicely formatted datasets that
I could use for a quick idea I have. I was wondering whether anyone
could point me towards a source of data for UK death penalty opinion.
I guess th
> Is situation anything better with ggplot2? It seems rather easy to get e.g.
> line plots with error bars, provided that one feeds the data to some
> modeling/regression function and passes the result over for plotting.. but
> what
> if I have generated my own error bar data? This is almost tri
Many thanks for your responses. I realize I made the first-time-poster's error
of not giving an example of the data. There actually are no NA values, so I'm
not simply replacing values in the data frame. So, the number of species (and
therefore abundance values) listed in each treatment diff
Hello,
What would you recommend for producing publication-quality plots with R?
Built-in graphics, trellis, ggplot2, or something else?
Basic requirements:
- I need to draw line-, box-, density-plots, bar-charts and histograms
- error bars on bar- and box-plots
- easy tiling of multiple plots on
On Fri, May 1, 2009 at 12:22 PM, MUHC-Research
wrote:
>
> Dear R-users,
>
> I would have another question about the ggplot() function in the ggplot2
> package.
>
> All the examples I've read so far in the documentation make use of a single
> neatly formatted data.frame. However, sometimes, one may
Dear Cathy,
Try this:
# Some data
set.seed(123)
DF <- data.frame(
Plot=sample(10),
Location = sample(10),
SpeciesName = sample(LETTERS[1:10]),
SpeciesNumber = sample(10),
abundance = rnorm(10),
treatment = sample(letters[1:3],5, replace=TRUE)
)
# M
On 01-May-09 17:20:08, Collins, Cathy wrote:
> Greetings,
> I am new to R and am hoping to get some tips from experienced
> R-programmers.
>
> I have a dataset that I've read into R as a dataframe. There are 5
> columns: Plot location,species name, a species number code (unique
> to each species
This message landed in the "Junk e-mails" folder (of which I have no
control), and it just so happens today that I glanced in the folder
today, instead of just emptying it without checking, trusting the filter
to do the Right Thing...
Since you seem to run into preblem with predict.randomForest, o
Dear R-users,
I would have another question about the ggplot() function in the ggplot2
package.
All the examples I've read so far in the documentation make use of a single
neatly formatted data.frame. However, sometimes, one may be interested in
plotting on the same grid information or objects d
Greetings,
I am new to R and am hoping to get some tips from experienced R-programmers.
I have a dataset that I've read into R as a dataframe. There are 5 columns:
Plot location,species name, a species number code (unique to each species
name), abundance, and treatment. There are 272 plots in
Hi fellow users of R,
My research requires the simultaneous optimization of several response
functions. Therefore, I am using the nsga2 method in the mco package,
which works beautifully.
However, I am running into a significant timing difference that is
causing me grief. The details:
Say I ha
I ran into the same problem - for me, wrapping the axis vector in FORMAT
worked well (see below); it may or may not be elegant but was effective for
your problem I think.
JT
#at <- pretty(xlim)
at <- format(pretty(xlim), digits=2)
# at <- pretty(ylim)
at <- format(pretty(ylim), digits=2)
#
Hi, all
I have a large number of NetCDF files that I need to average and then
put the mean in a new NetCDF file.
My problem is that I do this every time for files with different
variables, so I do not want to hard-code the variables in the new NetCDF
file I creat.
does anyone know how I can copy AL
Hi Greg,
Many thanks for your reply.
I am learning little by little with help from
kind people on this mailing list. Some day I
hope to be able to assist other beginners in
return.
Thank you for your work as a developer of the
package.
Regards,
Tena Sakai
tsa...@gallo.ucsf.edu
-Original
Note that the 'date' class is no longer required by the survexp function, so
the date library is no longer bundled into the survival package.
You can still load the date package separately, but I discourage it since the
newer Date class has more functionality and support.
Terry The
Hi Natalie,
The fact that there's a non-linear relationship between frequency and power
does not matter if you treat power as a categorical variable rather than
continuous.
So like Steve suggested above:
Using the lme4 package
lmer(power~freq*short+(1|animal), data=...)
would seem a good start
On May 1, 2009, at 8:51 AM, steve_fried...@nps.gov wrote:
David and the list
Yes the graph is produced with the code I submitted. However, I was
not
clear in my initial post. and it is totally my mistake for taking up
everyone's valuable time.
My main question focuses on the key which prin
Your parameters to merge do not appear to be objects; they are strings, You
might want to try:
merge(x=get(paste("arunoff_",start_arunoff, sep="")), y
You might want to consider a 'list' for storing your data. Also are you
ever 'detach'ing? It is useful to find ways to avoid 'attach' (
David and the list
Yes the graph is produced with the code I submitted. However, I was not
clear in my initial post. and it is totally my mistake for taking up
everyone's valuable time.
My main question focuses on the key which prints in black as opposed to
using the colors ("black", "red" and "g
Hi James,
(qnorm(.9)-qnorm(.1))
is the width of the 80% CI of a standard normal distribution. So its a
kind of standardization the other way round calculating sd from this.
The same holds for arbitrary p1 and p2. Without loss of generality
(since the normal distribution is symmetric), assume
Dear all,
I am trying to use 'merge' within a loop, however, I receive an error relating
to the 'by' argument of the command, as follows:
> merge_year <- 1986
>
> for (i in 1:10) { # Number of file pairs
+ assign(paste("merged_arunfek_", merge_year, sep=""),
merge(x=paste("arunoff_",start
On 30/04/2009 12:54 PM, Mike Miller wrote:
On Fri, 24 Apr 2009, Duncan Murdoch wrote:
On 4/24/2009 10:29 AM, Mike Miller wrote:
First, it looks like there is bug in the documentation...
According to the documentation for system():
http://stat.ethz.ch/R-manual/R-patched/library/base/html/sys
On 01/05/2009 5:46 AM, Andreas Wittmann wrote:
Dear R-users,
i have to integrate the following function
`fun1` <- function (a, l1, l2)
{
exp(log(l1) * (a - 1) - l2 * lgamma(a))
}
but if l1 is large, i get the "non-finite function value" error, so my
idea is to rescale with exp(-l1)
`fun2`
Hi R-users,
Â
I would like to transform my data using gamma, my data are ahll, bhall and dp1
as shown below:
Â
> ahall
    ah1 ah2 ah3 ah4 ah5 ah6 ah7 ah8 ah9 ah10 ah11 ah12
[1,] 0.9 1.01 1.24 1.85 1.85 2.45 3.67 3.02 3.06 2.33 1.86 0.96
Â
> bhall
      bh1  bh2Â
Dear R-users,
i have to integrate the following function
`fun1` <- function (a, l1, l2)
{
exp(log(l1) * (a - 1) - l2 * lgamma(a))
}
but if l1 is large, i get the "non-finite function value" error, so my
idea is to rescale with exp(-l1)
`fun2` <- function (a, l1, l2)
{
exp(log(l1) * (a - 1)
Dear jholtman,
The problem is that in this case, it seems that the blank is not replaced by
NA according to the information I quote. It is replaced by blank. I have
try: which(is.na(a$V4)), but get NA.
I want to delete the rows that have different format from others.
jholtman wrote:
>
> In som
On Fri, 01-May-2009 at 12:16AM +0200, Jose Quesada wrote:
|> Hi,
|>
|> While I'm a devoted vim user, I'm testing ESS :)
There is a list for ESS where this would be more appropriate, (see
https://stat.ethz.ch/mailman/listinfo/ess-help) so I'll Cc this to
ess-h...@stat.math.ethz.ch.
|> How do I
Hi Tena,
To associate a CSS stylesheet to your web page with the package
'hwriter', you just have to use the 'link.css' argument of the method
'openPage' (as documented in ?openPage). Your example will then become:
library(hwriter)
lcss = 'http://www.ebi.ac.uk/~gpau/hwriter/hwriter.css'
p = o
Dear all, i have my dataset (x,y,zvalue) and I will change tollerance in lag
and in angle of the variogram.
I usa gtat and variogram. What I must change for
the lag: width o cutoff?And for the angle tollerance?
This is that i have:
dati<-read.table("a.dat")
coordx<-dati[,1]
coordy<-dati[,2]
71 matches
Mail list logo