Hi
I have two vector
x=c(10,30,40,50)
total=c(20,20,0,10)
Var_exceeding_total=sum(as.numeric(x total))
This will compare the vectors x and total a gives the result.
if i want to compare only if the y 0 .
can we apply condition in the comparison ?
-
Thanks in Advance
Arun
--
I believe this should work
d - read.table(foo.csv, header=T, sep=,, comment=T)
although its spitting back a warning... this used to work for me.
Noah Silverman wrote
Hi,
I have a CSV file that is formatted well, except that the last line is a
summary not is CSV format.
Toy
sum(ifelse(x*total!=0, as.numeric(x total), 0))
arunkumar wrote
Hi
I have two vector
x=c(10,30,40,50)
total=c(20,20,0,10)
Var_exceeding_total=sum(as.numeric(x total))
This will compare the vectors x and total a gives the result.
if i want to compare only if the y 0 .
can
On Sun, Feb 12, 2012 at 07:56:48PM -0800, z2.0 wrote:
Question:
I'm trying to use paste() with rep() to reformat a series of values as zip
codes. e.g., if column 1 looks like:
52775
83111
99240
4289
112
57701
20001
I want rows 4 and 5 to read,
04289
00112
My thought was
Hi everyone,
I tried writing this data into a file using the save(myList,
file=test1.bin) command, but unfortunately, the numerical values seem
to get garbled when I do so.
The numbers in my RGui look like
0, 0.5, 0, 1 etc. etc.
But when I stored it into a .bin file, and
Hi everyone,
I'm using the poLCA module for some analysis work.
Basically, Im using the command poLCA(f, data=response,nclass=2)
This returns a poLCA object (a list)
From this data, I need to retrieve certain indexes, such as[[5]] as seen
below.
[[5]]
Pr(1) Pr(2)
On 13-Feb-2012 Durant, James T. (ATSDR/DTEM/PRMSB) wrote:
Hi -
I am trying to find and describe missing data in a time series.
For instance, in the library openair, there is a data frame
called mydata:
library(openair)
head(mydata)
date ws wd nox no2 o3 pm10so2 co pm25
1
It is the intention of the R Core Team to release the finalized version of the
2.14.x series at the end of February, and soon thereafter to start the run-in
for 2.15.0. I.e.,
2.14.2 Gift-Getting Season on Feb 29 (3rd anniversary of R-1.0.0!)
2.15.0 Easter Beagle on Mar 30
(We'll see about
Dear All,
is there anyone using Tinn R, who knows if it's possible to run more than
one instance of Tinn R on one machine? I'd like to run more than one R
process (R Term) at a time from Tinn R.
Any help will be appreciated.
Thanks.
--
View this message in context:
On 02/13/2012 09:51 AM, Colin Wahl wrote:
Does anyone have any recommendations for producing dotplots with error
bars? Are there packages available for this? I searched far and wide
and cannot find a suitable option.
I am trying to produce publication-quality figures for my thesis
results.
Colin Wahl biowahl at gmail.com writes:
Does anyone have any recommendations for producing dotplots with error
bars? Are there packages available for this? I searched far and wide
and cannot find a suitable option.
Dear Colin,
have a look at this page from the R wiki:
Dear All
I want to chose just spacial columns in R. (read table)
data1- read.table(/home/Documents/data.txt,header=F,sep = \t, as.is =F)
data.2-data1[sub.data[,1],]
The dimension of data.2 is correct but my data are transformed NA
head(data.2)
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
On Mon, Feb 13, 2012 at 02:13:41PM +0530, Suranga Kasthurirathne wrote:
Hi everyone,
I'm using the poLCA module for some analysis work.
Basically, Im using the command poLCA(f, data=response,nclass=2)
This returns a poLCA object (a list)
From this data, I need to retrieve certain
GHard to tell given the file is not available nor do we see the first
lines of it.
Uwe Ligges
On 13.02.2012 10:51, Soheila Khodakarim wrote:
Dear All
I want to chose just spacial columns in R. (read table)
data1- read.table(/home/Documents/data.txt,header=F,sep = \t, as.is =F)
I have some dataset
sci.pre - 0.300.380.500.650.801.031.331.72
2.22
2.873.815.066.759.00 11.97 14.15 16.34 19.04
22.27 25.49 29.72 34.67 40.47 47.29 55.29 64.67 75.6
88.50 103.50 121.10 141.70 165.80 194.00
Dear R-helpers,
I'm a new R-user and I was trying to gain some experience with the GNLS
function of the NLME package.
This is an extract from my dataset (it's a 432x6 data.frame) called input,
in the first column I have the values that I need to fit, while the remaining
columns are input
I have made some chances and I believe now the only problem is making the
system reorder. Please any help would be great
test - function(seed = 123456789, maxStock= 100, minStock =
20,t.max=1100,inventory =50)
{
LAST = t.max
START = 0
t.demand = START
t.supply = START
t.current = START
dear:
i want to know how to get a survival curve of the Cox proportional risk
regression, thank you.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
On Mon, Feb 13, 2012 at 02:08:52AM -0800, uday wrote:
I have some dataset
sci.pre - 0.300.380.500.650.801.031.331.72
2.22
2.873.815.066.759.00 11.97 14.15 16.34 19.04
22.27 25.49 29.72 34.67 40.47 47.29 55.29
Indeed. Thanks for the solution :)
-Original Message-
From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Sent: Friday, February 10, 2012 1:01 PM
To: Chosid, David (FWE); r-help
Subject: Re: [R] function arrows.circular not working
It's a good idea to acknowledge that you've found a
zbleach zt020200 at gmail.com writes:
Hi Pros,
I know leaps() computes the best subset selection for linear model, and
the bestglm() computes the best subset selection for generalized linear
model. Is there any package for best subset selection on random effects
model, or mixed
I've been investigating and I partially respond myself. I tried the
packages 'bigmemory' and 'ff' and for me the latter did the work I need
pretty straightforward. I create the array in filebacked form with the
function ff, and it seems that the usual R indexing works well. I have yet
to see the
Hi,
I am trying to perform relevance vector machines with the rvm-function from
kernlab.
On one dataset I get this message:
Setting default kernel parameters
Error in if (length(data) != vl) { :
RMate stopped at line 0 of selection
missing value where TRUE/FALSE needed
Calls: rvm ...
Hi,
For another trainingset I get this error message, which again is rather cryptic
to me:
Setting default kernel parameters
Error in array(0, c(n, p)) : 'dim' specifies too large an array
RMate stopped at line 0 of selection
Calls: rvm ... .local - backsolve - as.matrix - chol - diag -
On Feb 13, 2012, at 4:51 AM, Soheila Khodakarim wrote:
Dear All
I want to chose just spacial columns in R. (read table)
data1- read.table(/home/Documents/data.txt,header=F,sep = \t,
as.is =F)
data.2-data1[sub.data[,1],]
What is sub.data? are you migrating to R from a language where
I am using a linear kernel (vanilladot).
By switching the kernel, I actually get rid of the error message, but I would
like to stick to the linear one ...
On 13.02.2012, at 16:23, Martin Batholdy wrote:
Hi,
For another trainingset I get this error message, which again is rather
cryptic
On Feb 13, 2012, at 10:23 AM, Martin Batholdy wrote:
Hi,
For another trainingset I get this error message, which again is
rather cryptic to me:
Just imagine how it seems to us!
Setting default kernel parameters
Error in array(0, c(n, p)) : 'dim' specifies too large an array
RMate
Le lundi 13 février 2012 à 19:48 +0800, 丁飞 a écrit :
dear:
i want to know how to get a survival curve of the Cox proportional risk
regression, thank you.
See the relevant part of the Survival Task View here:
http://cran.r-project.org/web/views/Survival.html
And more specifically, see the
Hi R Users,
I am going to run a multiple linear regression with around 57 independent
variables. Each time I run the model with just 11 variables, the results
are reasonable. With increasing the number of independent variables more
than 11, the coefficients will get “NA” in the output. Is there
Dear Friends of R,
I would like to filter high frequent turbulence data with wavelet analysis.
Therefore i want to calculate the wavelet coefficients of the raw data.
And then the inverse for a special frequency band.
How can i do this in the best and easiest way?
Many thanks for your answers
Thank you for your help, David. I was trying to run bootrapping on the
dataset shoes from MASS package. But I still have some problem here.
as.matrix(data.frame(shoes),nrows=10,ncols=2,byrow=T)
A B
[1,] 13.2 14.0
[2,] 8.2 8.8
[3,] 10.9 11.2
[4,] 14.3 14.2
[5,] 10.7 11.8
[6,] 6.6 6.4
[7,] 9.5 9.8
Hello,
I tried writing this data into a file using the save(myList,
file=test1.bin) command, but unfortunately, the numerical values seem
to get garbled when I do so.
The numbers in my RGui look like
0, 0.5, 0, 1 etc. etc.
But when I stored it into a .bin file, and retrieved it using
Hi Petr,
You were correct , thats was the mistake . I am sorry for last reply. now
its working.
Cheers
Uday
--
View this message in context:
http://r.789695.n4.nabble.com/logical-operator-for-different-dimensions-tp4383316p4384143.html
Sent from the R help mailing list archive at
Gabor Grothendieck wrote
Try this xyplot.zoo lattice graph. Time series are represented in
columns so we transpose the data and convert it to zoo. The screen=
argument available in xyplot.zoo groups series into panels:
Lines - plant,aphid,1,2,3,4
Hi,
I'm attempting to calculate the 0.25 and 0.97 quantiles for tree height (0-50
meters) against tree age (0-300 years) and I am running into some difficulty
with the plotted grafic. I've run the examples in the quantreg help and can get
those to work properly and by plugging in my data I
Hi,
I would like plot two surfaces which are each given by vectors x and y,
and a matrix m(x,y) representing the z coordinate. With persp() I can
plot both, using par(new=TRUE) I can put it in one plot. However, I
would like to have the visibility of the surfaces taken into account as
if they are
Dear R-users,
I would like to fit a glmm with cross-classified random effects with
the function MCMCglmm. Something along the lines:
model1-MCMCglmm(response~pred1, random=~re1+re2, data=data)
where re1 and re2 should be crossed random effects. I was wondering
whether you could tell me
Hello,
I use read.xls from the gdata package to read in xlsx files. Sometimes these
data.frames contain NA columns
and rows only. I know how to get rid of those ones but here is the R output
of a test data set read in with read.xls
t1
A B X D X.1
Ok, I am sorry,
My trainingset consists of a 60 x 204 matrix (independent_training – 204
features).
I have 60 continuous labels (dependent_training, ranging from 2.25 to 135).
this is all the code I use:
library(kernlab)
rvm(as.matrix(independent_training), dependent_training, type=regression,
Hi,
many thanks for the reply. I really appreciate it.
Since I'm still very new to R, I think I should take some time to research
what you suggested.
(I don't want to keep posting basic questions to the list all the time)
But still, thank you so much for being helpful...
On Mon, Feb 13, 2012
On 13/02/2012 9:24 AM, Sebastian Schubert wrote:
Hi,
I would like plot two surfaces which are each given by vectors x and y,
and a matrix m(x,y) representing the z coordinate. With persp() I can
plot both, using par(new=TRUE) I can put it in one plot. However, I
would like to have the
Jonas,
A relatively simple way to get the legend to plot beside a graph is to use
the layout function to create two plot areas, create the graph in the
first area and the legend in the second area. You can fool around with the
location of the legend by changing the parameters to layout:
You need to spend some time reading about multiple regression. In statistics
there is always what is possible and what is advisable. I'm not going to
address whether a regression of 57 independent variables is advisable, only
possible. For your data, it is not possible. The attached data contain
Dan,
It is hard to say without being able to reproduce your example. If you send me
the data
I could try to advise something.
Roger
url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558
Hi,
I am developing a package B that, among other things, also offers some
extra S3-methods for functions in package A if the user has installed A.
I do not want to list A under Depends of B, as the dependency list of A
is rather long, and most potential users of B will not be interested in
Hi,
On Mon, Feb 13, 2012 at 10:53 AM, Martin Batholdy
batho...@googlemail.com wrote:
Ok, I am sorry,
My trainingset consists of a 60 x 204 matrix (independent_training – 204
features).
I have 60 continuous labels (dependent_training, ranging from 2.25 to 135).
this is all the code I use:
Sorry, this:
options(error=utils:::dum.frames)
Should be:
options(error=utils:::dump.frames)
-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info:
Hi!
On 13/02/12 17:15, Duncan Murdoch wrote:
I would like plot two surfaces which are each given by vectors x and y,
and a matrix m(x,y) representing the z coordinate.
[..]
I
would like to have the visibility of the surfaces taken into account as
if they are solid thin surfaces, so that for
On Mon, Feb 13, 2012 at 8:23 AM, RichardSmith richardsmith...@gmail.com wrote:
Gabor Grothendieck wrote
Try this xyplot.zoo lattice graph. Time series are represented in
columns so we transpose the data and convert it to zoo. The screen=
argument available in xyplot.zoo groups series into
On Mon, Feb 13, 2012 at 07:48:11AM -0800, syrvn wrote:
Hello,
I use read.xls from the gdata package to read in xlsx files. Sometimes these
data.frames contain NA columns
and rows only. I know how to get rid of those ones but here is the R output
of a test data set read in with read.xls
What package is the bootstrap() function from? There are many
functions by that name
My hunch is that it takes a vector at a time and puts it through
dif.mns so that leads to the error in the apply() call but I can't
verify.
Michael
On Mon, Feb 13, 2012 at 10:34 AM, hithit168
I am in the process of creating a package in R which calls
pre-compiled C code i.e. '.exe' files
In reading the manual, I came across this:
A source package if possible should not contain binary executable
files: they are not portable, and a security risk if they are of the
appropriate
Hi,
I've got this model and following Hothorn et al advices, I used glht for a
post hoc comparison
modezqM-glm(rojos~estacion*zona3,quasipoisson,subset=(edadysexo==M))
anova(modezqM,test=F)
Df Deviance Resid. Df Resid.
Dev F
Hi, in R there is the function density which computes kernel density
estimates. Is there a cumulative version of it? Something like they have
in Matlab:
http://www.mathworks.nl/help/toolbox/stats/ksdensity.html
I know there is ecdf, but I'm not sure it's based on kernel density
smoothing. Thanks
Hi,
thanks for you suggestion.
I finally solved it in a different way using apply and is.na for TRUE NA's
and if(as.character(x) == NA) etc.
However, I just spotted that read.xls seems to have problems reading in
special characters such as or .
Is there any workaround for that?
--
View this
On 13/02/2012 17:15, sahir bhatnagar wrote:
I am in the process of creating a package in R which calls
pre-compiled C code i.e. '.exe' files
Which are only used on Windows, so presumably you forgot to mention that OS.
In reading the manual, I came across this:
A source package if possible
Hi,
does anyone know of an implementation of generalized linear models with random
effects, where the random effects are non-gaussian?
Actually, what I need is to do a logistic regression (or binomial regression)
where the linear predictor in addition to fixed effects and gaussian random
Thanks.
I use the bootstrap() function from the bootstrap package. Let me try it
again to see if I get any luck :)
--
View this message in context:
http://r.789695.n4.nabble.com/Error-in-apply-x2-1-diff-dim-X-must-have-a-positive-length-tp4382435p4384608.html
Sent from the R help mailing list
Dear All,
Sorry for the typoes earlier, let me repost the question.
Suppose I want to generate sequences of length 3 from two symbols {1,2}, we get
the following 8 sequences
1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2
2 2 1
2 2 2
However, I do not want all these 8 sequences. I call two sequencs to be
The question is where do your models come from? Passing nested models
to ?anova.lme in nlme package or lme4 results in a likelihood ratio
test. Are you looking for something else/more ?
On Sun, Feb 12, 2012 at 8:02 PM, Tao Zhang zt020...@gmail.com wrote:
Hi,
I know leaps() computes the
On Feb 13, 2012, at 1:01 PM, francogrex wrote:
Hi, in R there is the function density which computes kernel density
estimates. Is there a cumulative version of it? Something like
they have
in Matlab:
I'm not aware of one, but you could use `integrate`. You will need to
limit your range
Hi guys,
This is a very beginner question. Anybody willing to help?
for(i in 1:1000)
x=29.5 + i/500
y=2x
plot(y,x)
The idea is to produce 1000 values of x and y then plot them.
Cheers,
Eddie
[[alternative HTML version deleted]]
__
x - 29.5 + (1:1000)/500
y - 2 * x
plot(y,x)
On Mon, Feb 13, 2012 at 1:34 PM, eddie smith eddie...@gmail.com wrote:
Hi guys,
This is a very beginner question. Anybody willing to help?
for(i in 1:1000)
x=29.5 + i/500
y=2x
plot(y,x)
The idea is to produce 1000 values of x and y then plot
On Feb 13, 2012, at 1:05 PM, syrvn wrote:
Hi,
thanks for you suggestion.
I finally solved it in a different way using apply and is.na for
TRUE NA's
and if(as.character(x) == NA) etc.
However, I just spotted that read.xls seems to have problems reading
in
special characters such as or
Hi everyone,
I would like to use your meboot package in R in a power simulation
study, where meboot stands for Maximum Entropy Bootstrap.
In this study, each time series that will be bootstrapped includes
both missing values and outliers.
Can meboot
I'd like to get the sum of every other row in a data.frame. When I
actually set about doing this, I get the error in the subject line of
this message. A sample of my data is below, followed by the function
call that should give me the results I want:
dput(head(sens2))
structure(list(Time =
This is how I get a whole SPSS data files into R. You specifically asked about
the codebook, so this may not be exactly what you are after.
spssFileInfo - spss.system.file ( file = path to my SPSS file )
spssDataSet - as.data.set ( spssFileInfo)
spssDataFrame - as.data.frame ( spssDataSet )
Hi David,
I am using read.xls not read.table.
--
View this message in context:
http://r.789695.n4.nabble.com/Deleting-rows-and-columns-containing-NA-s-and-only-tp4384173p4384866.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi all,
I made sure that it's env$sRes1$nPositionsOptimizedM that's correct...
not the env$sRes1$nPositionsOptimized...
But it seems both point to the same memory area...
This is very dangerous because I have used naming conventions such as:
MyLongVariableNameForA
MyLongVariableNameForB
On Feb 13, 2012, at 1:57 PM, syrvn wrote:
Hi David,
I am using read.xls not read.table.
Please read the help page for read.xls more carefully.
--
View this message in context:
http://r.789695.n4.nabble.com/Deleting-rows-and-columns-containing-NA-s-and-only-tp4384173p4384866.html
Sent
In addition to Jim's neat solution (see also below),
some comments on your original code.
Your for loop executes x=29.5 + i/500 100 times,
producing a single value each time and replacing the
previous value which was in x. So, at the end of the loop,
you have a single value of x. Then you compute
On 13/02/2012 2:00 PM, Michael wrote:
Hi all,
I made sure that it's env$sRes1$nPositionsOptimizedM that's correct...
not the env$sRes1$nPositionsOptimized...
But it seems both point to the same memory area...
How did you determine that? The test below just shows that they contain
the
Using the Cement hardening data in Anderson (2008) Model Based Inference in
the Life Sciences. A Primer on Evidence, and working with the best model
which is
lm ( y ~ x1 + x2,data = cement )
the AIC value from R is
model-lm ( formula = y ~ x1 + x2 ,
Hi everybody,
i made a scatterplot using the command
plot (datafile1, xlim=c(0,10), ylim=c(0.001, 1), log=y, xlab=x Achse,
ylab=y Achse, frame.plot=FALSE, axes = TRUE).
Now i have a problem. There is a gap between the x and the y axis. I want that
the x and y axis cut at 0 and 0.001 without
This is answered in ?AIC. Have you read it?
-- Bert
On Mon, Feb 13, 2012 at 10:22 AM, david hamer j.david.ha...@gmail.com wrote:
Using the Cement hardening data in Anderson (2008) Model Based Inference in
the Life Sciences. A Primer on Evidence, and working with the best model
which is
lm
Replace the syntax List$Name with List[[Name]]
and see if things work better.
'[[' does not do the partial matching that '$' does.
E.g.,
x - list(AB=10, BC=20, CD=30)
x$A # returns 10 because A is the initial part of exactly one name in x,
AB
x[[A]] # returns NULL
However, if you have
hi: the definition of AIC can vary a lot from paper to paper and textbook
to textbook because some people keep the multiplicative constants and
other's don't. all that matters when using AIC is COMPARISON. the value
itself means nothing. So, you'll be fine no matter what
you use as long as you're
On 06/02/2012 4:12 PM, Hadley Wickham wrote:
2. It's more flexible to construct the language object as a language object,
rather than pasting something together and parsing it. For one thing, that
allows non-syntactic variable names; I think it's also easier to read. So
your code
On Mon, Feb 13, 2012 at 10:05:02AM -0800, zheng wei wrote:
Dear All,
Sorry for the typoes earlier, let me repost the question.
Suppose I want to generate sequences of length 3 from two symbols {1,2}, we
get the following 8 sequences
1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2
2 2 1
2 2 2
Greetings
I am attempting to plot observations of a cave aquatic invertebrate
dating from 1901-2004. I can come up with a nice lattice plot of the eight
sites from which I have data easily enough. However, I'd like to be able
to highlight the 0 observations on the plots, i.e., attempts to
Hello Everyone,
I am trying to access all R basic C/Fotran libraries to see how some
functions are written in fotran or C so that in case I need to change some
stuff I can do that.
Any help would be great,
nitin
[[alternative HTML version deleted]]
Agostino Moro agostino.moro99 at gmail.com writes:
I would like to fit a glmm with cross-classified random effects with
the function MCMCglmm. Something along the lines:
model1-MCMCglmm(response~pred1, random=~re1+re2, data=data)
where re1 and re2 should be crossed random effects.
On 13-02-2012, at 21:47, nitin kumar wrote:
Hello Everyone,
I am trying to access all R basic C/Fotran libraries to see how some
functions are written in fotran or C so that in case I need to change some
stuff I can do that.
BTW; it's fortran.
Well, goto CRAN (http://cran.r-project.org/)
suppose I have two factor vectors:
x - as.factor(c(a,b,a,c,b,c))
y - as.factor(c(b,a,a,c,c,b))
I can compute their entropies:
entropy(table(x))
[1] 1.098612
using
library(entropy)
but it is not clear how to compute their mutual information directly.
I can compute the joint entropy as
Dear Ted,
Thank you very much for your details explanation!
Cheers.
On Mon, Feb 13, 2012 at 7:12 PM, Ted Harding ted.hard...@wlandres.netwrote:
In addition to Jim's neat solution (see also below),
some comments on your original code.
Your for loop executes x=29.5 + i/500 100 times,
* Sam Steingold f...@tah.bet [2012-02-13 16:14:36 -0500]:
suppose I have two factor vectors:
x - as.factor(c(a,b,a,c,b,c))
y - as.factor(c(b,a,a,c,c,b))
I can compute their entropies:
entropy(table(x))
[1] 1.098612
using
library(entropy)
but it is not clear how to compute their
Hello,
This is my first attempt to write a script in R. The program below
is intended to do some parametric tests on group data. There are subroutines
for each type of test. The call to the parametric.tests, routine sets the
argument testtype for the test to be used. How can I transfer
Hello everybody,
I have the following problem and have no idea how to solve it:
In my dataframe I have six columns representing six societal problems (p1,
p2, ..., p6).
The values are ranks between 1 (worst problem) and 6 (best problem)
p1 p2 p3 p4 p5 p6
1 3 2 5 4 6
2 3 1 6
I want to compare the poisson and the zero-inflated poisson distribution on
describing the data. So, after using the GLM and the ZEROINFL function, I
used the Voung function to compare them. Here is my code:
library(pscl)
glm1 - glm(nmer9_1[, 1] ~ 1, family = poisson)
zip - zeroinfl(nmer9_1[,
Hi,
I am new to R. I was trying to get a very simple program to run. Take one
number from the command line. If the number 0 return -1. If number 0 return
1 and if the number == 0 return 0. The code is in a file called test1.R
The code:
#useage: R --no-save --args 5 test1.R
args =
Dear Petr,
This is fantastic!
I have one more question, when p=4, tt=4. We have 15 non-isomorphic sequences
as you have generated. Among these 15, I selected 2 sequences. How do I recover
all the members of the equivalent classes corresponding to these 2 sequences?
For example,
On Mon, Feb 13, 2012 at 02:04:51PM -0800, zheng wei wrote:
Dear Petr,
This is fantastic!
I have one more question, when p=4, tt=4. We have 15 non-isomorphic sequences
as you have generated. Among these 15, I selected 2 sequences. How do I
recover all the members of the equivalent
if I have a vector, I can find the indexes which satisfy a condition:
x - rnorm(10)
[1] 0.4751132 -0.5442322 -0.1979854 -0.2455521 0.8349336 -0.4283345
[7] 0.6108130 2.0576160 1.1251716 -1.3933637
x[x0]
[1] 0.4751132 0.8349336 0.6108130 2.0576160 1.1251716
(1:10)[x0]
[1] 1 5 7 8 9
how
On Mon, Feb 13, 2012 at 5:07 PM, David Studer stude...@gmail.com wrote:
Hello everybody,
I have the following problem and have no idea how to solve it:
In my dataframe I have six columns representing six societal problems (p1,
p2, ..., p6).
The values are ranks between 1 (worst problem) and
P - paste(P,1:6,sep=)
t(apply(yourdataframe,1,function(x)P[order(x)]))
## result is a mtrix, though.
-- Bert
On Mon, Feb 13, 2012 at 2:07 PM, David Studer stude...@gmail.com wrote:
Hello everybody,
I have the following problem and have no idea how to solve it:
In my dataframe I have six
There is probably a more ellegant way, but:
df -
data.frame(p1=c(1,2,1),p2=c(3,3,2),p3=c(2,1,3),p4=c(5,6,4),p5=c(4,4,6),p6=c(6,5,5))
as.data.frame(t(apply(df,1,function(x) names(x)[match(1:6,x)])))
V1 V2 V3 V4 V5 V6
1 p1 p3 p2 p5 p4 p6
2 p3 p1 p2 p5 p6 p4
3 p1 p2 p3 p4 p6 p5
On Mon, Feb
Hello,
I'm running R 2.14.1 on OS X (x86_64-apple-darwin9.8.0/x86_64 (64-bit)), with
version 3.28 of Thomas Lumley's survey package. I was using predict() from
svyglm(). E.g.:
data(api)
dstrat-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
out -
The function you posted runs without error (on these 6 lines), but
does not return anything that looks remotely like a sum, or cumsum of
anything. Can you clarify what you are trying to do? I assume by sum
of every other row you don't mean summing Time, X and Y for rows
1,3,5,..., ?
For the sum
which(x0)
or
which(x0, arr.ind=TRUE)
depending on your application.
Michael
On Feb 13, 2012, at 5:38 PM, Sam Steingold s...@gnu.org wrote:
if I have a vector, I can find the indexes which satisfy a condition:
x - rnorm(10)
[1] 0.4751132 -0.5442322 -0.1979854 -0.2455521 0.8349336
On 13 February 2012 14:46, ilai ke...@math.montana.edu wrote:
The function you posted runs without error (on these 6 lines), but
does not return anything that looks remotely like a sum, or cumsum of
anything. Can you clarify what you are trying to do? I assume by sum
of every other row you
1 - 100 of 123 matches
Mail list logo