similar to: conditions simpler way

Displaying 20 results from an estimated 1000 matches similar to: "conditions simpler way"

2013 Apr 02
2
R Commander and FactoMineR
Dear Users, I helped to install R Commander and FactoMineR to one of my collegaues. He wanted to do an MCA. Selecting three variables and using the default settings results in only one graph, the variables representation, where he gets three points for the three variables (which is totally fine). Running the code (output of the point-and-click method) EuTop100.MCA<-EuTop100[,
2012 Mar 28
6
How to get all possible combinations?
Dear all, suppose I have a vector with elements as: Vec <- c(2,3,4,5,6) Now I want to have all possible combination of length 3 using those elements and without any repetition. Like, I want to have 1 possibility like 2-3-4 but not 3-2-4. Can somebody guide me how to achieve that in R? Thanks for your help.
2013 Jan 22
1
FactoMineR
Dear Users, I installed R Commander and the FactoMineR plug-in. Everything is fine, I can see the new menu, I can import datasets, but if I want to use any of the items in the FactoMineR menu, i get the following error: Error in get(.activeDataSet) : object '.activeDataSet' not found even if there is an active dataset (if there is none, all the menu items are grey of course). I have R
2013 Dec 14
2
Change factor levels
Suppose I have a dataframe 'd' defined as L3 <- LETTERS[1:3] d0 <- data.frame(cbind(x = 1, y = 1:10), fac = sample(L3, 10, replace = TRUE)) (d <- d0[d0$fac %in% c('A', 'B'),]) x y fac 2 1 2 B 3 1 3 A 4 1 4 A 5 1 5 A 6 1 6 B 8 1 8 A Even though factor 'fac' in 'd' only has 2 levels, but it seems to bear the birthmark
2012 Nov 30
3
loop function and integrate?
Hi guys! I have to compute something and i don't know what i'm doing wrong. my code is a bit complex, but imagine that is something like this: a = c(1,2,3,4) ia = length(a) x = seq(1,100,length=0.1) ib = length(x) int1 = numeric(ib) b = numeric(ib) for(j in 1:ia) { H = function(x) {sin(x + a[j])} for(i in 1:ib) { int = integrate(H, lower = 0, upper
2012 Nov 30
1
can't integrate in loop
Hi guys! I have to compute something and i don't know what i'm doing wrong. my code is a bit complex, but imagine that is something like this: a = c(1 2 3 4) ia = length(a) x = seq(1,100,length=0.1) ib = length(x) for(j in 1:ia) { H = function(x) {sen(x) + a[j]} for(i in 1:ib) { int = function(x) { integrate(H, lower = 0, upper = x[i])} int1[i] = int(1) } end
2008 Dec 18
1
Indicator function for merged times (was: Re: Rr: For and if confusion)
Please start a new thread for a new topic and use a meaningful subject for sake of the archives and everyone trying to follow. Using your Int1, correcting your Int2 and using your Y (which goes to Jul not Aug as per the comment): library(zoo) > as.ts(with(merge.zoo(Int1, Int2, Y, fill = 0), pmax(Int1, Int2))) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1992
2010 May 20
1
Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno)
I am receiving the above error ( full r session output below) the script runs OK in windows. and "genotypes" and "ploidy" are both correct arguments any suggestions would be most welcome Nevil Amos MERG/ACB Monash University School of Biological Sciences > library(Geneland) Loading required package: RandomFields Loading required package: fields Loading required
2011 Feb 24
2
MCMCpack combining chains
Deal all, as MCMClogit does not allow for the specification of several chains, I have run my model 3 times with different random number seeds and differently dispersed multivariate normal priors. For example: res1 = MCMClogit(y~x,b0=0,B0=0.001,data=mydat, burnin=500, mcmc=5500, seed=1234, thin=5) res2 = MCMClogit(y~x,b0=1,B0=0.01,data=mydat, burnin=500, mcmc=5500, seed=5678, thin=5) res3 =
2009 Jun 05
2
[LLVMdev] Int1 to Double Type Conversion
Hello, I would like to know if there is an instruction to convert values from the Int1 type to the Double type in LLVM. I would like to achieve the equivalent of casting a bool value to a double value in C++. Doing the simple CreateSIToFP or CreateUIToFP does not work, it throws an assertion ("invalid cast"). I simply want to avoid branching it's not necessary. What's the
2011 Sep 06
2
[LLVMdev] bitwise AND
Hi, I want to compute the bitwise 'and' between two values of type int1:  %x = and %a, %b  . Which is the LLVM instruction that creates this? I only found the APInt class, whose constructor is:  APInt(unsigned numBits, uint64_t val, bool isSigned = false) and which provides the bitwise AND operation: APInt  llvm::APIntOps::And (const APInt &LHS, const APInt &RHS)   Bitwise
2004 Nov 19
2
Plotting averages of y per x
Hello! I often plot average of y instead of all y values, since one can easily see the trend if there is to many points and/or x might be like 1, 2, 3, 4, 5, ... and you might get a cloud (which can also be informative) and/or columns of points. Anyway, learning with R i get stucked. I have the data in table burnins1, with the following names: names(burnins1) [1] "Model"
2012 Apr 10
1
compare two matrices
Dear Members, I have two estimated transition matrices and I want to compare them. In fact I want to check the hypothesis if they come from the same process. I tried to look for some test but all I found was independence test of contingency tables. The following code shows that the usual chi-squared test statistic does not follow chisq distribution. MCRepl <- 5000 khi12 <- rep(0,MCRepl)
2005 Nov 09
2
About: Error in FUN(X[[1]], ...) : symbol print-name too long
Hi, I??m trying to use the Win2BUGS package from R and I have a similar problem that reurns with the message: Error in FUN(X[[1]], ...) : symbol print-name too long But, there is no stray ` character in the file ( Sugestions given by: Duncan Temple Lang <duncan> Date: Mon, 26 Sep 2005 07:31:08 -0700 ) The progam in R is: library(R2WinBUGS) library(rbugs) dat <-
2003 Apr 18
1
MCMCpack gelman.plot and gelman.diag
Hi, A question. When I run gelman.diag and gelman.plot with mcmc lists obtained from MCMCregress, the results are following. > post.R <- MCMCregress(Size~Age+Status, data = data, burnin = 5000, mcmc = 100000, + thin = 10, verbose = FALSE, beta.start = NA, sigma2.start = NA, + b0 = 0, B0 = 0, nu = 0.001, delta = 0.001) > post1.R <- MCMCregress(Size~Age+Status, data
2005 Jul 13
1
problems with MNP
Hi all, Does anybody have a hint on what may be going wrong in this R code? I mimic the sample code from the MNP developers but I seem unable to get the choice specific variables right. Thanks, Joan Serra > rm(list=ls()) > library(foreign) > small<-read.spss("small.sav") Warning message: small.sav: Unrecognized record type 7, subtype 13 encountered in system file. >
2008 Aug 22
2
WinBUGS with R
Dear Users, I am new to both of things, so do not blame me too much... I am busy with semiparametric regression and use WinBUGS to sample posteriors. The code to call Winbugs is as follows: data <- list("y","X","n","m") #My variables inits.beta <- rep(0,K) inits.beta0 <- 0 inits <-
2007 Mar 09
1
MCMC logit
Hi, I have a dataset with the binary outcome Y(0,1) and 4 covariates (X1,X@,X#,X$). I am trying to use MCMClogit to model logistic regression using MCMC. I am getting an error where it doesnt identify the covariates ,although its reading in correctly. The dataset is a sample of actual dataset. Below is my code: > ####################### > > > #retreive data > # considering four
2012 Nov 26
1
error in plot(table(c('a','a')))
Hi all, there appears to be something strange with the plotting of tables of 1 dimension; if I attempt to make a plot of a table of characters with only 1 value I get an error (Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ). With more than one value I don't get errors, neither with integers (even if only 1 value): tbl.char1 <-
2012 Nov 26
1
error in plot(table(c('a','a')))
Hi all, there appears to be something strange with the plotting of tables of 1 dimension; if I attempt to make a plot of a table of characters with only 1 value I get an error (Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ). With more than one value I don't get errors, neither with integers (even if only 1 value): tbl.char1 <-