On 06/07/11 16:26, Lao Meng wrote:
If I have 3 groups,and for each group,I get the ratio(e.g. incidence rate).
Now I wanna
For crying out loud!!! Repeat after me: It's ***not*** ``wanna'',
it's ***want to*** ***want to*** ***want to***!!!
The word ``wanna'' is a
Hello,
I have the following 2 x 3 contingency table,
12 3
Case12 13 15
Control 10 5 10
I want to find min(x1,x2,x3) P(X=x)
where P(X=x) = ( (22 Choose x1) * (18 Choose x2) * (25 Choose x3) ) / (62
Choose 40)
If I have 100 such 2 x 3 tables can I find this
Dr. Pfaff:
How do we pass the by results to rlevel.gev function to get the return
level
and also save the results (both rg2(par.ests and $par.ses) and rl)
as.data.frame?
#Grouped vector
Gdata - data.frame(n = rep(c(1,2,3), each = 100), y = rnorm(300))
library(evir)
require(plyr)
#Model for
Hi,
I'm trying to figure out how to make a plot with ylab showing the permil
symbol. Anyone know how to do this?
Thanks
--
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi:
I am trying to compare the results of evir and fExtreme packages. I could
not figure out how to save the evir package results. Also, how to pass the
results to fExtreme function gevrlevelPlot and evir function rlevel.gev
to get the return levels. I just need the values and not graphs.
On Wed, 6 Jul 2011, mathew brown wrote:
Hi,
I'm trying to figure out how to make a plot with ylab showing the
permil symbol. Anyone know how to do this?
Yes.
Now, it you would follow the posting guide and give the 'at a minimum'
information you were asked for, and the graphics device you
Readers,
Attempting to solve the knapsack problem (e.g. see:
http://rosettacode.org/wiki/Knapsack_problem/Unbounded), the following
error occurred:
...
result would be too long a vector
Is this indicative that R is not suitable to solve this problem when
combinations are large?
Is there a known
Good point.
Here is the code
plot(dat$timestamp,dat$delta_18_16, ylab=, xlab=(min), tck=0.05, col=blue)
mtext(side=2, line=1.5, expression(*delta*^18*O [\u0089]), cex=1, adj=0.5)
I'm still not sure how to get your code to work.
thanks
On Wed, 6 Jul 2011 09:45:49 +0100 (BST)
Prof Brian Ripley
EdBo wrote:
You are right Joshua.
I changed the code because I failed to understand how you attached the
full data set. How you made the data part of your code.
I am new to R so I am used to one way of attaching data(the way I redone
it).
You don't need to attach the data by using
Hello,
the more general thing I'd like to learn here is how to compute Function of
Data on the basis of grouping determiend by n variables.
In terms of the reason why I am interested in this, I need to compute the
average of my data based on the value of the month and day across years. I
have
You still have not sent the information requested in the posting
guide, and I do not know your target device nor locale, nor is that a
reproducible example.
Please learn some respect for the time of the helpers here (and for
all the work that went into making this possible in R).
On Wed, 6
Dear R-help subscribers;
I have a question regarding making gradients in R. I've searched on the
web, but was only able to find functions that make a gradient between
color X and Y, which is not what I want.
I want to 'pick out' individual, smaller pieces of a gradient based on a
range of
I have a data frame with 2 columns, the first is an index of participants and
the second is a list of words presented to the participant (see below).
head(dat)
sword
1a pianist
1a sweat
1a carnage
1a nymph
1ahank
1a waist
tail(dat)
sword
4a package
4a
Hi,
I am using gogarch from the package gogarch. i have 13 series. the
univariate model for the one of the series has a statistically insignificant
constant term (garch(1,1)).
so I want to re fit the model assuming the constant term top be zerocan
i use update method to do soif not please
t-tests and the like test for a difference in mean value, not for
non-overlapping populations or data sets.
The fact that the mean of one data set differs significantly from the mean of
the other does not mean that the ranges of the individual points in each data
set are disjoint.
Actually to get exactly what I want I need to add
no.dimnames(AvgDemand )
where
no.dimnames - function(a) {
## Remove all dimension names from an array for compact printing.
d - list()
l - 0
for(i in dim(a)) {
d[[l - l + 1]] - rep(, i)
}
To all in R land,
Here is what I would like to do.
x = c(1:10)
y = c(1:10)
plot(x,y)
mtext(side=2, line=1.5, expression(*delta*^18*O [permill]), cex=1,
adj=0.5)
That's it. Except I would like to replace permill with the symbol.
Thanks for the help
On Wed, 6 Jul 2011 11:07:55 +0100 (BST)
Prof
table(dat$word)
Sent from my iPad
On Jul 6, 2011, at 1:41, Lee Averell lee.aver...@newcastle.edu.au wrote:
I have a data frame with 2 columns, the first is an index of participants and
the second is a list of words presented to the participant (see below).
head(dat)
sword
1a
On 07/06/2011 04:19 PM, Annemarie Verkerk wrote:
Dear R-help subscribers;
I have a question regarding making gradients in R. I've searched on the
web, but was only able to find functions that make a gradient between
color X and Y, which is not what I want.
I want to 'pick out' individual,
On Wed, 2011-07-06 at 12:24 +0200, mathew brown wrote:
To all in R land,
Here is what I would like to do.
x = c(1:10)
y = c(1:10)
plot(x,y)
mtext(side=2, line=1.5, expression(*delta*^18*O [permill]), cex=1,
adj=0.5)
That's it. Except I would like to replace permill with the symbol.
Dear list members,
is it somehow possible to include figures to the html help pages of individueal
functions (containing for example a plot produced by that function?)
I thought about adding these figures into a 'graphs' subfolder of the package
folder and then to somehow insert some sort of
On occasion, as pointed out in an earlier posting, it is efficient to convert
to a matrix and when finished convert back to a data frame. The Hmisc
package's asNumericMatrix and matrix2dataFrame functions assist by
converting character variables to factors if needed, and by holding on to
original
On 11-07-06 8:47 AM, Jannis wrote:
Dear list members,
is it somehow possible to include figures to the html help pages of individueal
functions (containing for example a plot produced by that function?)
I thought about adding these figures into a 'graphs' subfolder of the package
folder and
Hello Peter,
str(rg2)
us quite revealing for this; by() returns a list and hence lapply() can be
employed, e.g.:
lapply(rg2, rlevel.gev, k.blocks = 5)
By the same token, you can extract the relevant bits and pieces and put them
together in a data.frame.
Best,
Bernhard
-Ursprüngliche
Dear R-helpers,
I have a huge dataset and I create a filter selecting only the cases I want
using:
data - subset(data, data$var=='x' | data$var=='y' | data$var=='z' | ... )
The problem is, when i check my new data it doen't show a row_names column
but when the data is exported to MYSQL (using
Hi,
I am reading payment data like so
2010-01-01,100.00
2010-01-04,100.00
...
2011-01-01,200.00
2011-01-07,100.00
and plot it aggregated per month like so
library(zoo)
df - read.csv(daily.csv, colClasses=c(d=Date,s=numeric))
z - zoo(df$s, df$d)
z.mo - aggregate(z, as.yearmon, sum)
Dear all,
I have a undirected network (g), representing all the sexual relationships that
ever existed in a model community.
I also have a directed edgelist (e) which is a subset of the edgelist of g. e
represents the transmission pathway of HIV.
Now I would like to superimpose the picture of
Thanks for your advice Duncan. In which file should I put the
\figure{}
command? I tried the *.Rd file, but the html files created are without the
figure. Are you sure I only need to include the filename and no path?
Jannis
--- Duncan Murdoch murdoch.dun...@gmail.com schrieb am Mi,
On 06/07/2011 10:03 AM, Jannis wrote:
Thanks for your advice Duncan. In which file should I put the
\figure{}
command? I tried the *.Rd file, but the html files created are without the
figure. Are you sure I only need to include the filename and no path?
Yes, in the .Rd file.
Can't really
Dear Duncan,
OK, my fault. I did not realize that you only refer to r-devel. I found however
a way for standard R by putting this into the Rd file:
\details{
\if{html}{\out{img src=../doc/image_name.png alt=image .. should be
here/}}\ifelse{latex}{}{}
}
And saving the figure in inst/doc.
Hello all!
As beginner I'm struggling for a while with time zones issue and can't find
a suitable solution.
I would be grateful for any help.
Dataset imported from excel has a variable transplant.date which has been
recorded with CET time zone.
subDataset$transplant.date
[1] 2000-01-01 CET
[Reposting, since there was problems with encodings the first time around.]
Dear all,
I stumbled upon what appears to be a troublesome issue when sampling from an
ARIMA model (from Rob Hyndman's excellent 'forecast' package) that contains
a seasonal AR component.
Here's how to reproduce the
When try to use install.package I have this error message :
Error in m[, 1L] : incorrect dimensions number
What the matter with my installation ? I run R2.13 on Window 7 32bits.
Justin BEM
BP 1917 Yaoundé
Tél (237) 76043774
[[alternative HTML version deleted]]
On 06/07/2011 10:37 AM, Jannis wrote:
Dear Duncan,
OK, my fault. I did not realize that you only refer to r-devel. I found however
a way for standard R by putting this into the Rd file:
\details{
\if{html}{\out{img src=../doc/image_name.png alt=image .. should be
here/}}\ifelse{latex}{}{}
}
Hi there,
I'm wondering what Zelig in the following situation (code below) actually does.
Is this considered as a so called regression adjustment after the propensity
score matching?
library(MatchIt)
library(Zelig)
data(lalonde)
re78 represents the outcome variable
1. With Zelig
m.out -
I have a data.frame e and would like to extract the 23rd column,
remove any NA's and then remove any values = 30. I can do it in steps
such as this but have failed to figure out how to do it in a single line
any suggestions?
first - e[,23]
second - first[!is.na(first)]
third -
?
This is basic. Please read An Intro to R before posting any more
such questions if you have not already done so.
-- Bert
On Wed, Jul 6, 2011 at 8:35 AM, Jim Maas j.m...@uea.ac.uk wrote:
I have a data.frame e and would like to extract the 23rd column, remove
any NA's and then remove any
On Wed, Jul 6, 2011 at 10:37 AM, B Laura gm.spam2...@gmail.com wrote:
Hello all!
As beginner I'm struggling for a while with time zones issue and can't find
a suitable solution.
I would be grateful for any help.
Dataset imported from excel has a variable transplant.date which has been
A) ?str
A common mistake by beginners is to fail to import to the appropriate data
type. Learn to confirm your data types.
B) ?dput
Provide reproducible examples. dput is one useful tool for creating such.
C) Sys.setenv(TZ=CEST)
If you can't use ?chron or ?Date, then setting the default timezone
Dear R users,
I am trying to estimate a nested logit model that has a constant option in
a degenerate partition. The data set is a conjoint survey where
respondents were asked to answer multiple choice sets. The choice sets
consist of three alternatives (described by four varying attributes) and
Yes absolutely, your explanation makes sense. Thanks very much.
rgds
Paul
--
View this message in context:
http://r.789695.n4.nabble.com/clustering-based-on-most-significant-pvalues-does-not-separate-the-groups-tp3644249p3649233.html
Sent from the R help mailing list archive at Nabble.com.
Hi,
I would like to calculate the RELATIVE euclidean distance. Is there a
function in R which does it ?
(I calculated the abundance of 94 chemical compounds in secretion of
several individuals, and I would like to have the chemical distance
between 2 individuals as expressed by the relative
Hi,
I need to reshape my dataframe from a long format to a wide format.
Unfortunately, I have a continuous date variable which gives me headaches.
Consider the following example:
id=c(034,034,016,016,016,340,340)
date=as.Date(c(1997-09-28, 1997-10-06, 1997-11-04, 2000-09-27,
2003-07-20,
Hi All
This might be something very trivial but I seem to miss something in the
syntax or logic which makes me keep wandering around the problem without
arriving at a solution.
What I want to do is to simulate a sample data for performing cluster
analysis. I tried to use
x1=
Date: Wed, 6 Jul 2011 13:10:14 +0200
To: r-help@r-project.org
CC: but...@uci.edu
Subject: [R] superimposing network graphs
Dear all,
I have a undirected network (g), representing all the sexual relationships
that ever existed in a model community.
I also have a directed edgelist (e)
I am fitting a series of models using lmer(). I'd like to be able to
manipulate the coefficients generated by ranef() to facilitate comparisons
between models, and I can't figure out how to do it. (This is probably old
news for most of you, but the problem is that although the ranef() output is
in
On Fri Feb 18 17:48:11 CET 2011 Jérôme wrote:
I'm trying to install the hdf5 library into R. The HDF5 package is
installed in a special directory, distributed accross my cluster:
/share/apps/HDF5
So i put the args option to the configure command as i read in previous
post in the list:
Hi,
I'm running a tutorial (Meta-analyses of data from two (or more) microarray
data sets), which use wgcna package. I have an error in the function
modulePreservation (it is below).
I'm using R2.13
Can you help me? Do you know, what is happens?
Thanks
Raquel
multiExpr = list(A =
Hi Pete,
Try the reshape function (see ?reshape for documentation). It can be
a bit confusing, but its worth learning if you deal with multiple
observations per unit much. Code inline does what you want (though
you might need a bit of tweaking to get pretty names, etc.
HTH,
Josh
On Wed, Jul
On Wed, Jul 6, 2011 at 8:27 AM, Raquel Martinez Garcia
rmartin...@cnio.es wrote:
Hi,
I'm running a tutorial (Meta-analyses of data from two (or more) microarray
data sets), which use wgcna package. I have an error in the function
modulePreservation (it is below).
I'm using R2.13
Can you
Dr. Pfaff:
After using str; can you give an example on data extration (e.g. for
$par.ests and @residuals)
- Original Message
From: Pfaff, Bernhard Dr. bernhard_pf...@fra.invesco.com
To: Peter Maclean pmaclean2...@yahoo.com; Dr. Bernhard Pfaff
bernh...@pfaffikus.de
Cc:
I want to create columns from this row vector. From:
x1 x2 x3 x1 x2 x3 x1 x2 x3
1 2 3 1 2 3 1 2 3
to:
x1 x2 x3
1 2 3
1 2 3
1 2 3 Peter Maclean
Department of Economics
UDSM
__
R-help@r-project.org mailing list
Uwe,
This worked.
Thank you so much,
Audrey
--
View this message in context:
http://r.789695.n4.nabble.com/very-large-pair-plot-tp3634075p3649361.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Is there a quick and easy way to write data frames side-by-side in a csv file
with one column separating them?
I could just fill them with empty rows so they all have the same height,
then cbind them with empty columns in between, but I'm looking for a more
elegant solution, if one exists.
You mean like:
myvec - c(1,2,3,1,2,3,1,2,3)
myvec
[1] 1 2 3 1 2 3 1 2 3
matrix(myvec, ncol=3, byrow=TRUE)
[,1] [,2] [,3]
[1,]123
[2,]123
[3,]123
Or do you actually have more complex requirements?
Sarah
On Wed, Jul 6, 2011 at 2:06 PM, Peter Maclean
The question was whether you could do this
'in a single line' and the word 'elegant' was in the
subject line. Those two things don't always go together.
You can put semicolons between the statements so they
all can go on one line, but that isn't very elegant.
You could collapse the three
Hello,
I am trying to run a linear mixed model using
model.a - lme(Psstotals ~ Visit, data=caf, random= ~ Visit|Id)
My dataset looks lie the following:
Id Visit Agecorrected Psstotals
1 106 0 19 8
2 106 1 19 9
3
After importing multiple files to data.frames in R, I want to rename all
their columns and do other operations with them. The data.frame names are
not continuous like 1, 3, 4, 6.
I could not find a way of creating a list of the data.frames and loop this
and ended up putting them into a list first:
Hi,
On Wed, Jul 6, 2011 at 1:18 PM, Cliff Clive cliffcl...@gmail.com wrote:
Is there a quick and easy way to write data frames side-by-side in a csv file
with one column separating them?
I could just fill them with empty rows so they all have the same height,
then cbind them with empty
At 12:21 04/07/2011, John Kane wrote:
In a OpenOffice.org forum someone was asking if the spreadsheet
could graph this
http://www.elmundo.es/elmundosalud/documentos/2011/06/leche.html
I didn't think it could. :)
I don't think I've ever seen exactly this layout. Does anyone know
if there is
Hi:
Here's one way with the reshape package. I converted ref to numeric
and date to character string first. Sometimes these little things
matter...
library(plyr)
library(reshape)
# Modified original data; note the option in the data.frame() statement
id=c(034,034,016,016,016,340,340)
Hi Duncan
Your method works well for my situation when I make only one call to the
database/URL with the login info. Our database is configured like the
first situation (cookies) that you described below. Now, I will need to
make multiple successive calls to get data for different sites in
In general, if the data frames are all related then it is best to keep them
together in a list like you have. But if you want to change the names of the
component data frames then you can use a loop, or sometimes better use the
lapply function. Here is a basic example:
tmp - list(
Thanks Bill! That is very useful. Is the str.language function in
any package (findFn(str.language) came up empty)? It certainly
helped me, not only to understand this particular problem, but in
trying to wrap my head around language objects (which I only very
poorly grasp) in general.
Josh
Thanks Michael.
It looked like a decent display but it's nice to know what is going on. I has
figured out something to do with milk but that was my total knowledge..
--- On Wed, 7/6/11, Michael Dewey i...@aghmed.fsnet.co.uk wrote:
From: Michael Dewey i...@aghmed.fsnet.co.uk
Subject: Re:
t(matrix(rep(1:3, 3), nrow=3))
--- On Wed, 7/6/11, Peter Maclean pmaclean2...@yahoo.com wrote:
From: Peter Maclean pmaclean2...@yahoo.com
Subject: Re: [R] Split a row vector into columns
To: r-help@r-project.org
Received: Wednesday, July 6, 2011, 2:06 PM
I want to create columns from this
Dear R-help subscribers,
I have a quite stupid question about using lapply. I have the following
function:
create.gradient - function(i){
colorgrad01-color.scale(seq(0,1,by=0.01), extremes=c(red,blue))
tree1$edge[i,1] - x
tree1$edge[i,2] - y
print(x)
print(y)
all2[x] - z
all2[y] - z2
round(z,
Hi,
I am having a trouble parsing dates using strptime() that I get in the
format of year and week number. The data looks like this 201127 which
means year 2011 and week 27. I would like to graph this using ggplot but
then I get a gap between 201054 and 201101 so I thought I would just easily
Hello,
a probably rather stupid question to which I can't find an answer:
I have a bar chart, and I want to present which bars are significantly
different by placing a line with an asterisk above then (similarly to fig. 3
in: http://jnm.snmjournals.org/content/46/4/574.figures-only).
Does
Dear all,
I did a Kruskall-Wallis test for a comparison of a variable of interest
between 10 sites and I get a significant result (p=0.0019). however, when I
perform a post-hoc test using kruskalmc from the pgirmess package, I get no
difference between any of the paired comparisons. I cannot
Dear Annemarie,
Can you replicate the problem using a madeup dataset or one of the
ones built into R? It strikes me as odd to pass tree1$edge directly
to lapply, when it is also hardcoded into the function, but I do not
have a sense exactly for what you are doing and without data it is
hard to
* Sam Steingold f...@tah.bet [2011-07-05 15:30:02 -0400]:
I want to modify etr.rt (or create a new frame etr.rt.md) which would
have all the columns of etr.rt plus 5 additional columns
market.cap
X52.week.low
X52.week.high
X3.month.average.daily.volume
X50.day.moving.average.price
Dear
I have been trying to a program which requires nprmpi. However, I have
tried to install the downloaded zip file but get the error: cannot open
compressed file 'npRmpi_0.40-7.tar.gz/DESCRIPTION'
I tried the command: install.packages(nprmpi) but get the message package
'nprmpi' is not
Hello all,
I am trying to estimate the cumulative distribution function for a single
stock return time series. A piecewise estimation is composed of three parts:
parametric generalized Pareto (GP) for the lower tail (10% of the
observation), non-parametric kernel-smoothed interior (80% of the
I'd do it by hand with either segments() or arrows() and text(), but
without a reproducible example I can't give you specific instructions.
Sarah
On Wed, Jul 6, 2011 at 4:37 PM, omernevo nev...@gmail.com wrote:
Hello,
a probably rather stupid question to which I can't find an answer:
I have
On Wed, Jul 6, 2011 at 1:37 PM, omernevo nev...@gmail.com wrote:
Hello,
a probably rather stupid question to which I can't find an answer:
I have a bar chart, and I want to present which bars are significantly
different by placing a line with an asterisk above then (similarly to fig. 3
I
# Incremental approach
bb - c(23, 45, 67)
bsp - barplot(bb,beside=TRUE) # get midpoints of the bars and plot
# draw lines
segments( .7, 50, 1.9, 50)
segments(.7, 50, .7, 48)
segments(1.9, 50, 1.9, 48)
# Or all in one go
segments(c(.7, .7, 1.9), c(50,50,50), c(1.9,.7,1.9), c(50, 48, 48))
---
paste on a 'day' since it is trying to convert to something that is ambigous:
strptime(2011010,%Y%W%w)
[1] 2011-01-02
strptime(2011520,%Y%W%w)
[1] 2011-12-25
strptime(2011120,%Y%W%w)
[1] 2011-03-20
strptime(2011200,%Y%W%w)
[1] 2011-05-15
On Wed, Jul 6, 2011 at 3:17 PM, David Pitkin
What function are you using to export your data.frame to MySQL?
On Wed, Jul 6, 2011 at 10:41 PM, Thiago Clark clark.thi...@gmail.com wrote:
Dear R-helpers,
I have a huge dataset and I create a filter selecting only the cases I want
using:
data - subset(data, data$var=='x' | data$var=='y' |
Hi,
within lme(), I think it is only possible to do na.action = na.omit. The
default action (= na.fail) causes lme() to print an error message and
terminate if there are any incomplete observations
Best,
Christine
-
--
Christine Adrion, Dipl.-Stat.,MPH
Ludwig-Maximilians-Universität
Hi,
Suppose I have two vectors, not necessarily the same length (in fact,
they usually are different lengths): y.1 that has increasing values
between 0 and 1; y.2 that has decreasing values between 1.0 and 0. You
can picture these as being supply (= y.1) and demand (= y.2) curves from
Hey guys,
Could you please teach me how to run or execute a query stored in an Access
2007 database?
I can connect and run queries from my Access database without any problem. But
I have an append query stored there. Say called Append2Tbl. How do I execute
it without copying and pasting the
On Jul 6, 2011, at 4:43 PM, Data Analytics Corp. wrote:
Hi,
Suppose I have two vectors, not necessarily the same length (in
fact, they usually are different lengths): y.1 that has increasing
values between 0 and 1; y.2 that has decreasing values between 1.0
and 0. You can picture these
That is what I wanted
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Sarah Goslee sarah.gos...@gmail.com
To: Peter Maclean pmaclean2...@yahoo.com
Cc: r-help@r-project.org
Sent: Wed, July 6, 2011 1:15:31 PM
Subject: Re: [R] Split a row vector into columns
You
Has anyone had problems with Rapache that don't show up on command line
execution of R? I just ran into this loading rgdal in Rapache page and having
a problem with loading shared object. The final complaint was that
Stop_XMLParser
was undefined- this was surprising since grep -l showed it in
No, it is not in any package. Feel free to use
it as you wish - it has no licensing restrictions.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: Joshua Wiley [mailto:jwiley.ps...@gmail.com]
Sent: Wednesday, July 06, 2011 1:23 PM
To: William Dunlap
Sourced: BiodiversityGUI.R
Error : .onAttach failed in attachNamespace() for 'Rcmdr', details:
call: get(Menus[m, 5])
error: object 'chisquareDistributionPlot' not found
Error in BiodiversityRGUI() : needs Rcmdr
Hi Guys,
I am from China, I wanna use Biodiversity R, but it can't work.
Can
I have not used BiodiversityGUI.R, but it looks like it needs Rcmdr ... are you
using Rcmdr? In case you are not, here is the url:
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
Cheers
David Cross
d.cr...@tcu.edu
www.davidcross.us
On Jul 6, 2011, at 5:37 PM, Aishuijiao wrote:
Sourced:
What package are you using to connect to the Access database?
On Thu, Jul 7, 2011 at 7:02 AM, Alex Zhang alex.zh...@ymail.com wrote:
Hey guys,
Could you please teach me how to run or execute a query stored in an Access
2007 database?
I can connect and run queries from my Access database
Hi,
How can I discern which elements in x (see below) are in 'order', but more
specifically.. only the 1st 'ordered run'?
I would like for it to return elements 1:8... there may be ordered values
after 1:8, but those are not of interest.
x - c(1, 2, 3, 4, 5, 6, 7, 8, 20, 21, 22, 45)
Thanks
Hi,
If an ordered run means the difference is between the ith and ith +
1 position is 1, then:
out - rle(diff(x))
?diff gives you the differences (i + 1) - (i), and then run length
encoding encodes how long a run of the same number is. In this case,
there first run is length 7.
rle() outputs
well.. the following works, but if you have another idea I am still
interested.
1:(which(diff(x)!=1)[1])
B77S wrote:
Hi,
How can I discern which elements in x (see below) are in 'order', but more
specifically.. only the 1st 'ordered run'?
I would like for it to return elements
I am an R newbie, and I am facing what is for me a challenging problem. I am
trying to write functions to solve the following problems. It seems as though R
offers so many options I am not sure how to approach the problem.
I have a data frame with dates in the first column and returns in
Quoting Ouattara b.ouatt...@swansea.ac.uk:
Dear
I have been trying to a program which requires nprmpi. However, I have
tried to install the downloaded zip file but get the error: cannot open
compressed file 'npRmpi_0.40-7.tar.gz/DESCRIPTION'
Since you didn't tell us any basic information, we
I seem to recall seeing this done in one or two elegant lines, but
run - function(x, type = 1) {
index - rle(diff(c(NA, x)))
i - cumsum(index$lengths)
j - match(type, index$values)
x[seq.int(i[j - 1], i[j])]
}
run(c(1, 2, 3, 4, 5, 6, 7, 8, 20, 21, 22, 45))
run(c(20, 22, 24, 26, 1, 2,
Dear all,
I want to simulate from the null distribution of the following 2 x 3 table,
2 5 10
4 8 5
I am using a chi-squared test.
Anyone has any idea how to do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
__
On Jul 6, 2011, at 8:58 PM, Jim Silverton wrote:
Dear all,
I want to simulate from the null distribution of the following 2 x 3
table,
2 5 10
4 8 5
I am using a chi-squared test.
Yeah. Right. A chi-squared test. That certainly narrows it down ...
to maybe one quarter of all
On Wed, Jul 6, 2011 at 7:32 PM, B77S bps0...@auburn.edu wrote:
Hi,
How can I discern which elements in x (see below) are in 'order', but more
specifically.. only the 1st 'ordered run'?
I would like for it to return elements 1:8... there may be ordered values
after 1:8, but those are not of
Hi,
Steven i just solved it.
the problem was with RMYSQL, not with the subset.
dbWriteTable(..., row.names=FALSE) solved my problem...
thanks, sorry for the inconvenience.
2011/7/6 Steven Kennedy stevenkennedy2...@gmail.com
What function are you using to export your data.frame to MySQL?
Steven - I use RODBC. Thx,
- Alex
From: Steven Kennedy stevenkennedy2...@gmail.com
To: Alex Zhang alex.zh...@ymail.com
Cc: r-help@R-project.org r-help@r-project.org
Sent: Wednesday, July 6, 2011 7:18 PM
Subject: Re: [R] How to Execute A Query Stored In Access
1 - 100 of 111 matches
Mail list logo