similar to: If Statement with more than one condition

Displaying 20 results from an estimated 8000 matches similar to: "If Statement with more than one condition"

2010 Feb 16
1
difftimes; histogram; memory problems
Hi All: Let's say I have two dataframes (Condition1 and Condition2); each being on the order of 12,000 and 16,000 rows; 1 column. The entries contain dates. I'd like to calculate, for each possible pair of dates (that is: Condition1[1:10,000] and Condition2[1:10,000], the number of days difference between the dates in the pair. The result should be a matrix 12,000 by 16,000. Really,
2012 Nov 24
2
Performing operations only on selected data
I spent some time on this simple question, also searched the forum, eventually hacked my way to an ugly solution for my particular problem but I would like to improve my coding: I have data of the form: df <- expand.grid(group=c('copper', 'zinc', 'aluminum', 'nickel'), condition1=c(1:4)) I would like to add a new data column "condition2", with values
2010 May 20
1
Mixed Effects Model on Within-Subjects Design
Dear R Experts, I am attempting to run a mixed effects model on a within-subjects repeated measures design, but I am unsure if I am doing it properly. I was hoping that someone would be able to offer some guidance. There are 5 independent variables (subject, condition, difficulty, repetition) and 1 dependent measure (value). Condition and difficulty are fixed effects and have 3 levels each
2011 Dec 08
1
prop.test() and the simultaneous confidence interval for multiple proportions in R
Dear list members, I want to perform in R the analysis "simultaneous confidence interval for multiple proportions", as illustrated in the article of Agresti et al. (2008) "Simultaneous confidence intervals for comparing binomial parameter", Biometrics 64, 1270-1275. If I am not wrong the R function implementing the Agresti et al. method is prop.test(). I ask an help because I
2008 Aug 25
1
lattice : using both strip and strip.left
Dear all, I'm routinely using lattice and ggplot2, I wish to create a lattice theme that looks not too dissimilar to ggplot's defaults so I can include both graphs in a document with a consistent look. To illustrate my questions, consider the following example: > library(ggplot2) > library(lattice) > > # example data > x <- seq(0, 10, len = 100) > y1 <-
2008 Aug 13
3
conditional IF with AND
Hi everyone, I'm trying to create an "if" conditional statement with two conditions, whereby the statement is true when condition 1 AND condition 2 are met: code structure: if ?AND? (a[x,y] <condition1>, a[x,y] <condition2>) I've trawled through the help files, but I cannot find an example of the syntax for incorporating an AND in a conditional IF statement.
2010 May 31
1
Post-hoc tests for repeated measures in balanced experimental design
Hi, I am performing experiments in the field of visual perception where we often apply balanced designs. Within a group of normal subjects, we vary different stimulus conditions (like contrast, luminance, temporal frequency of stimulation) and derive some psychophysical or electrophysiological results from our subjects. Often, the main question is to test the effect of these parameters
2007 Nov 27
2
rearrange data: one line per subject, one column per condition
Dear R-list, Is there a way to convert the typical long R data-format to a 1-line per subject format? I have data formatted as: Group subj condition variable 1 1 1 746.36625 2 2 1 1076.152857 1 3 1 1076.152857 2 4 1 657.4263636 1 5 1 854.1266667 2 6 1 1191.676154 1 7 1 1028.175385 1 1 2 46.36625 2 2 2 76.152857 1 3 2 76.152857 2 4 2 57.4263636 1 5 2 54.1266667 2 6 2 191.676154 1 7 2 028.175385
2014 Sep 25
5
[LLVMdev] New type of smart pointer for LLVM
Hello everyone, I bring to discussion the necessity/design of a new type of smart pointer. r215176 and r217791 rise the problem, D5443 <http://reviews.llvm.org/D5443> is devoted to the solution. r215176 applies several temporary ugly fixes of memory leaks in TGParser.cpp which would be great to be refactored using smart pointers. D5443 <http://reviews.llvm.org/D5443> demonstrates
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
2011 Dec 13
1
[LLVMdev] Changing the operands in the CallInst
I implement the following function,which gets CallInst * and should perform the following: 1. Change the value of the argument if condition1 takes place 2. Change the type of the argument if condition2 takes place 3. Add addition argument/s if condition3 takes place void argChange(CallInst * I) { for (unsigned index = 0; index < I->getNumOperands(); ++index) {
2009 Mar 06
1
a general question
Hi everyone, Although this question is more related to ChIP and ChIP-seq, it could be probably anchored in a more general statistical context. The question is : what method is better to assess the significance of the change in a signal (the signal can be DNA binding, for instance) given the background and 2 conditions. <. condition1 (eg no treatment) : background = 1;
2007 Nov 05
1
Should numeric()/character() etc initialize with NA instead of 0 or ""?
Wouldn't it make programming more error-resistant if vectors were initialized with missing data, instad of zeroes or ""? That way, if you assign values to a vector elementwise and you miss some elements (because their indices were not selected or because the assignment didn't work out, see below for code examples) this would be immediately obvious from the value of the vector
2010 Sep 17
7
removing specific rows from array
I'm attempting to create an array of treatment comparisons for modelling data generation. This involves comparison of one treatment (c2) with another (c3), relative to a common comparator (c1). Attached code gives me the correct array but need to remove duplicates. Duplicates relate only to c2 and c3 such that I need to remove r3 because c2 and c3 are same as r1 with c2 and c3 swapped r5
2011 Mar 17
3
Flexible rbind
Dear All, I am trying to create a empty structure that I want to fill gradually through the code. I want to use something like rbind to create the basic structure first. I am looking for a possibility to do an rbind where the columns names dont match fully (but the missing columns can be defaulted to either zero or n/a) (my actual data has a lot of columns). Please see the data frames below I
2014 Sep 25
2
[LLVMdev] New type of smart pointer for LLVM
On Thu, Sep 25, 2014 at 1:44 AM, Renato Golin <renato.golin at linaro.org> wrote: > On 25 September 2014 06:16, David Blaikie <dblaikie at gmail.com> wrote: > > I can go & dredge up some examples if we want to discuss the particular > > merits & whether each of those cases would be better solved in some other > > way, but it seemed pervasive enough in the
2010 Oct 14
5
Replacing N.A values in a data frame
Hello, I have a data frame as below ... in cases where I have N.A. I want to use an average of the past date and next date .. any help? 13/10/2010 A 23 13/10/2010 B 12 13/10/2010 C 124 14/10/2010 A 43 14/10/2010 B 54 14/10/2010 C 65 15/10/2010 A 43 15/10/2010 B N.A. 15/10/2010 C 65 ---------------------------------------------------------------------------- -------------------------- Thanks
2010 Nov 03
4
Drawing circles on a chart
Dear Group, I have the following data matrix which is a timeseries. > dput(tData) structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09, 0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01, 0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06, -0.08, -0.07), D = c(-0.15, -0.05, -0.1, -0.03, -0.13, -0.04, -0.1, -0.04, -0.15), E = c(-0.17, -0.16, -0.08, -0.07, -0.09,
2010 Nov 09
3
Row-wise recurive function call
Dear Group, I have a following dataset: > a A B C D 1 22 3 31 40 2 26 31 36 32 3 3 7 49 16 4 24 40 27 26 5 20 45 47 0 6 34 43 11 18 7 48 48 24 2 8 3 16 39 48 9 20 49 7 21 10 17 36 47 10 > dput(a) structure(list(A = c(22L, 26L, 3L, 24L, 20L, 34L, 48L, 3L, 20L, 17L), B = c(3L, 31L, 7L, 40L, 45L, 43L, 48L, 16L, 49L, 36L), C = c(31L, 36L, 49L, 27L, 47L, 11L, 24L,
2008 Dec 17
4
passing arguments to subset from a function
Hello R-helpers, I'm writing a long function in which I manipulate a certain number of datasets. I want the arguments of said function to allow me to adapt the way I do this. Among other things, I want my function to have an argument which I will pass on to subset() somewhere inside my function. Here is a quick and simplified example with the iris dataset. myfunction<-function(table,