similar to: if(){} else{}

Displaying 20 results from an estimated 10000 matches similar to: "if(){} else{}"

2010 Nov 30
1
more flexible "ave"
Hi all, I would like to calculate the percent of the total per group for this data.frame: df <- data.frame(site = c("a", "a", "a", "b", "b", "b"), gr = c("total", "x1", "x2", "x1", "total","x2"), value1 = c(212, 56, 87, 33, 456, 213)) df
2015 Oct 28
4
RFC: Supporting macros in LLVM debug info
Hi, I would like to implement macro debug info support in LLVM. Below you will find 4 parts: 1. Background on what does it mean to debug macros. 2. A brief explanation on how to represent macro debug info in DWARF 4.0. 3. The suggested design. 4. A full example: Source -> AST -> LLVM IR -> DWARF. Feel free to skip first two parts if you think you know the background.
2015 Nov 03
3
RFC: Supporting macros in LLVM debug info
> Do we really need to touch the AST? Or would it be reasonable to wire up the CGDebugInfo directly to the PPCallbacks, if it isn't already? (perhaps it is already wired up for other reasons?) This sound as a good idea, I will check that approach. PPCallbacks is only an interface, has nothing connected to it, but we will create a new class, which implement PPCallbacks, for macros. So we can
2011 Sep 12
1
nested anova<-R chrashing
Hi, I tried to do a nested Anova with the attached Data. My response variable is "survivors" and I would like to know the effect of (insect-egg clutch) "size", "position" (of clutch on twig) and "clone" (/plant genotype) on the survival of eggs (due to predation). Each plant was provided with three different sizes of clutches (45,15,5) and had
2015 Nov 03
2
RFC: Supporting macros in LLVM debug info
> Not necessarily, if we kept the macros in order in the list of macros attached to the CU, which I imagine we would. OK, now I understand what you are aiming for. I really do not favor one on the other. But, can you explain what is the advantage of the parent approach over the children approach? If any, the children approach seems to be the one reduces the LLVM IR size, is not it? Regards,
2023 Mar 02
1
transform.data.frame() ignores unnamed arguments when no named argument is provided
Thanks and good point about unspecified behavior. The way it behaves now (when it doesn't ignore) is more consistent with data.frame() though so I prefer that to a "warn and ignore" behaviour: data.frame(a = 1, b = 2, 3) #> a b X3 #> 1 1 2 3 data.frame(a = 1, 2, 3) #> a X2 X3 #> 1 1 2 3 (and in general warnings make for unpleasant debugging so I prefer
2015 Nov 05
2
RFC: Supporting macros in LLVM debug info
> Right - I was wondering if CGDebugInfo already implemented PPCallbacks or was otherwise being notified of PPCallback related things, possibly through a layer or two of indirection. I checked the approach of skipping representing macros in AST, and communicate them directly from Parser to CGDebugInfo. However, I could not find a way to initialize this communication. The only interface
2010 Dec 17
4
How to arrange the data
Dear R helpers I have one data as given below. date                     value1          value2             value3 30-Nov-2010           100                 40                 61 25-Nov-2010           108                 31                 88 14-Sep-2010            11                 180               56 I want the following output date                 name       amount 30-Nov-2010      value1
2012 Oct 15
1
How to read XML in UTF-8 format?
How to read xml in UTF-8 format. I have one XML file but i want to read it in UTF-8 format. How this is possible? <barplot> <cd> <name>?</name> <value1>3</value1> <value2>2.9</value2> </cd> <cd> <name>?</name>
2008 May 02
2
Accesing data frame members from within functions
I am writing a simple R program to execute a t-test repeatedly on data contained in a data frame. My data looks like this: Category Value1 Value2 1 .5 .8 1 .3 .9 . . . . . . . . . 2
2012 Nov 28
4
remove NA or 0 values
Dear R users, I want to remove zero's or NA values after this model. year value1 value2 1854 0 12 1855 0 13 1866 12 16 1877 11 24 year value1 value2 1 12 12 2 11 13 3 16 4 24 Thank you! -- --- Catalin-Constantin ROIBU Forestry engineer, PhD Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53
2015 Nov 13
2
RFC: Supporting macros in LLVM debug info
On Mon, Nov 9, 2015 at 4:00 AM, Aboud, Amjad <amjad.aboud at intel.com> wrote: > I found a way to skip representing macros in AST and create them directly > in CGDebugInfo through PPCallbacks during preprocessing. > > To do that, I needed to extend ASTConsumer interface with this extra > method: > > > > /// If the consumer is interested in notifications from
2012 Nov 08
3
Beginner help about output in R
Dear R experts, I am a beginner with R and I have a question regarding the output of a function. Basically, I created 2 functions, value1 and value2, that calculate two values, and I would like to print those two values to an output datafile. I tryed the following function: function (x) {write.table(data.frame(value1(x),value2(x)),file=output.txt)} My problem is that I would like to calculate
2011 Jul 14
2
cbind in aggregate formula - based on an existing object (vector)
Hello! I am aggregating using a formula in aggregate - of the type: aggregate(cbind(var1,var2,var3)~factor1+factor2,sum,data=mydata) However, I actually have an object (vector of my variables to be aggregated): myvars<-c("var1","var2","var3") I'd like my aggregate formula (its "cbind" part) to be able to use my "myvars" object. Is it
2011 Oct 24
1
Creating data frame with residuals of a data frame
Dear experts, I am trying to create a data frame from the residuals I get after having applied a linear regression to each column of a data frame, but I don't know how to create this data frame from the resulting list since the list has differing numbers of rows. So for example: age<- c(5,6,10,14,16,NA,18) value1<- c(30,70,40,50,NA,NA,NA) value2<- c(2,4,1,4,4,4,4) df<-
2013 Feb 11
2
How to plot doubles series with different location using plotCI
Dear list members, I would like to create two series of plotted mean values and error bars, yet with different locations along the x-axis. Plotting of first series using plotCI with the standard arguments goes without any problem. However I do not succeed to add the second series in the same plot, which should be horizontally shifted from the first series along the x-axis. The “add=TRUE”
2005 Sep 19
3
Lists and data frames (PR#8143)
Full_Name: Frank Wagner Version: R 2.1.1 OS: Windows Submission from: (NULL) (193.174.73.34) Hi, The pdf file R-intro descripe on page 27 that lists can be extended by adding numbers. Unfortunately, it's not working ## example : # if i did not declare the variable an error occurs : object not found mylist <- list() mylist[1] <- list(value1=3, value2=5) ## Error Can you please help
2010 Jun 17
1
big big problem
Dear list, I'll try to be more clear in explaining my problem. I have a data frame like this called X: CLUSTER YEAR variable value1 value2 M1 2005 EC01 NA NA M1 2006 EC01 2 5 M1 2007
2015 Nov 13
2
[cfe-dev] RFC: Supporting macros in LLVM debug info
On Fri, Nov 13, 2015 at 2:41 PM, Richard Smith <richard at metafoo.co.uk> wrote: > On Fri, Nov 13, 2015 at 10:21 AM, David Blaikie via cfe-dev < > cfe-dev at lists.llvm.org> wrote: > >> On Mon, Nov 9, 2015 at 4:00 AM, Aboud, Amjad <amjad.aboud at intel.com> >> wrote: >> >>> I found a way to skip representing macros in AST and create them
2011 May 05
3
Alter a line in a file.
Hi all R users Ive got a file that contains diffrent settings in the manor of: setting1="value1" setting2="value2" setting3="value3" setting4="value4" . . . What I want to do is open the file and change the value of a specific setting like wanna change setting4="value4" -> setting4="value5" and then save the file again.