similar to: ifelse and "&&" vs "&"

Displaying 20 results from an estimated 2000 matches similar to: "ifelse and "&&" vs "&""

2009 Jan 31
3
This site may harm your computer - Google warning about cran website
This is extremely annoying (and it smells of rat). As of this time (1013 am ET), Google issues the following nasty warning: "This site may harm your computer" when I try to visit any of the CRAN package repository sites or CRAN task view. The funny thing is that Google's Safe Browsing Diagnostic page (it gives diagnostics about any page that it may contain Malware) does not seem
2010 Apr 14
1
Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)
Hi, I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can select the order of the derivative penalty. For my particular problem the order of the penalty (parameter "m" inside the "s" terms of the formula argument) appears to have a larger effect on the AIC/deviance of the estimated model than the
2009 Mar 19
1
Generalized Extreme Value Distribution (LMOM package) and Frechet Distribution
Dear R helpers I have some data and through some other software, it is understood that I can fit the Frechet Distribution to it. However, I need to fit the distribution using R code only. I have searched many R packages and one R helper has suggested some sites too, but unfortunately parameters couldn't be estimated. Using LMOM package, I know how to estimate the parameters of Generalized
2010 Jun 23
3
integrate dmvtnorm
Hello, everyone, I have a question about integration of product of two densities. Here is the sample code; however the mean of first density is a function of another random variable, which is to be integrated. ## f=function(x) {dmvnorm(c(0.6, 0.8), mean=c(0.75, 0.75/x))*dnorm(x, mean=0.6, sd=0.15)} integrate(f, lower=-Inf, upper=Inf) ## error message Error in dmvnorm(c(0.6, 0.8), mean = c(0.75,
2010 Jun 11
1
Documentation of B-spline function
Goodmorning, This is a documentation related question about the B-spline function in R. In the help file it is stated that: "df degrees of freedom; one can specify df rather than knots; bs() then chooses df-degree-1 knots at suitable quantiles of x (which will ignore missing values)." So if one were to specify a spline with 6 degrees of freedom (and no intercept) then a basis
2009 Jan 06
5
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang
2007 Apr 29
2
how to code the censor variable for "survfit"
Dear r-helpers, This is my first time to run survival analysis. Currently, I have a data set which contains two variables, the variable of time to event (or time to censoring) and the variable of censor indicator. For the indicator variable, it was coded as 0 and 1. 0 represents right censor, 1 means event of interest. Now I try to use "survfit" in the package of "survival". I
2010 Jun 20
6
Popularity of R, SAS, SPSS, Stata...
Hi All, I've been fiddling around with various ways to estimate the popularity of R, SAS, SPSS, Stata, JMP, Minitab, Statistica, Systat, BMDP, S-PLUS, R-PLUS and Revolution R. It's not an easy task. You can see what I've come up with so far at http://r4stats.com/popularity . I'm sure people will have plenty of ideas on how to improve this, so please let me know what you think.
2010 Jun 19
1
Extracting P-values from the lrm function in the rms library
Hello again R users, I have a devilishly hard problem, which should be very simple. I hope someone out there will have the answer to this on the tip of their tongue. Please consider the following toy example: x <- read.table(textConnection("y x1 x2 indv.1 bagels 4 6 indv.2 donuts 5 1 indv.3 donuts 1 10 indv.4 donuts 10 9 indv.5 bagels 0 2 indv.6 bagels 2 9 indv.7 bagels 8 5 indv.8
2010 Apr 30
2
deriving mean from specific cases
Hi all, I have a large dataset that has >10k entries. The dataset is stored in a dataframe with the headers: SubID Condition1 Condition2 Result1 Result2 There are multiple entries for a given SubID(Subject ID). Condition 1 has 3 levels and condition2 has 2 levels (therefore there are 6 possible combinations all together e.g. Cond1 Level1 x Cond2 Level 1 etc.) and i need to compute for 1. The
2007 Sep 25
5
Am I misunderstanding the ifelse construction?
I have a function like this: changedir <- function(dataframe) { dir <- dataframe$dir gc_content <- dataframe$gc_content d <- ifelse(dir == "-", gc_content <- -gc_content,gc_content <- gc_content) return(d) } The goal of this function is to be able to input a data frame like this: > lala dir gc_content 1 + 0.5 2 - 0.5 3 +
2008 Nov 05
2
Simple rep() question duplicating times and dates.
I want to create a data.frame of time and date for a year. I started with the idea of simply producing two vectors (time and date) The first part ( time) is easy. rep(1:24, 365) But how do I get a series of 24 dates for O1 January 2005 and repeat this to 31 December 2005. It should be easy but I don't see it. Thanks
2006 Dec 08
2
Aggregate?
Hi All, I think i'm failing to undersatnd how aggregate() is supposed to work. example: test1<-sample(c(0,1),100,replace=T) test2<-sample(letters,100,replace=T) aggregate(test1,list(test2),sum) Error in data.frame(w, lapply(y, unlist, use.names = FALSE)) : arguments imply differing number of rows: 26, 0 I thought this would give me a list containing the number of ones that
2009 Dec 14
6
write.csv and header
Dear list, I would like to export a matrix to a TXT-File by using write.csv (not necessarily). Is there a way to add a header (with additional informations concerning the project) spanning multiple lines to this file before the actual data are listed up? Should look like this: date: filename: number of permutations: ------------ data (as a matrix) Any suggestions? Thnx in advance.
2010 May 08
1
matrix cross product in R different from cross product in Matlab
Hi all, I have been searching all sorts of documentation, reference cards, cheat sheets but can't find why R's crossprod(A, B) which is identical to A%*%B does not produce the same as Matlabs cross(A, B) Supposedly both calculate the cross product, and say so, or where do I go wrong? R is only doing sums in the crossprod however, as indicated by (z <- crossprod(1:4)) # = sum(1 +
2008 Feb 16
4
Weird SEs with effect()
Hi all, Im a little bit confused concerning the effect() command, effects package. I have done several glm models with family=quasipoisson: model <-glm(Y~X+Q+Z,family=quasipoisson) and then used results.effects <-effect("X",model,se=TRUE) to get the "adjusted means". I am aware about the debate concerning adjusted means, but you guys just have to trust me - it
2008 Oct 17
2
using ifelse with surprising results
Thanks for the gracious assistance in advance I'm working on a non-metric scaling problem and am calculating the distance for input to isoMDS Here is the code library(MASS) vegdata <- tapply(Percent, list(PRIMARY_VE, MASTERID), sum) x.mat <- matrix(x, nrow=40, ncol=2750, byrow=TRUE, dimnames = c(dimnames(x)[1], dimnames(x)[2])) vegdata.dd <- dist(x) vegdata.dd <-
2008 Jan 09
7
An "R is slow"-article
Hi all, Reading the wikipedia page on R, I stumbled across the following: http://fluff.info/blog/arch/00000172.htm It does seem interesting that the C execution is that much slower from R than from a native C program. Could any of the more technically knowledgeable people explain why this is so? The author also have some thought-provoking opinions on R being no-good and that you should write
2012 Nov 11
2
Djjlölkjhfyn kb noknkkkkokljjyikkk hyjjjjjkjjjjkjkkpooololåååååååååååååååääääkkuiivjkoööklopipållällnbbbn mml ömmmm
M P?opklpnlbyj?nvnmm M. ?plppkbkv??k? knbnnnnnn??????llp?????tx hikkkhgxxx vj jul?l Sent from my iPhonejukuj?b?mjl jnmnmmm Sorry for keeping things short Gustaf Granath (phd) Plant Ecology Uppsala University
2010 Jun 22
1
New errors with difftime()-objects in 2.11.1 (was Re: Request: difftime method for cut())
On Thu, Jun 10, 2010 at 3:39 PM, Gustaf Rydevik <gustaf.rydevik at gmail.com> wrote: > Hi all, > > The recent change in 2.11 that made as.numeric() return false on > difftime-objects broke some of my code that calculated age classes of > individuals using cut(). While this was no big thing to fix for me, it > might be wise > to provide a cut.difftime method to ?stop