similar to: simplify if statement in R ?

Displaying 20 results from an estimated 6000 matches similar to: "simplify if statement in R ?"

2010 Sep 23
2
Error: attempt to apply non-function
This code worked fine for me, then did some cleaning up of formatting using ESS (Emacs) and now I get this error, no idea what is causing it, all the brackets/parentheses seem to be balanced. What have I done wrong? Thanks Jim p0.trial01 <- 0.25 TruOR01 <- 0.80 num.patients.01 <- 50 num.trials.01 <- 5 LOR01.het.in <- 0.00 num.sims <- 1 simLOR01 <-
2010 Dec 15
3
calculating mean of list components
I get a list object from an iterative function. I'm trying to figure out the most efficient way to calculate the mean of one element, across all components of the overall list. I've tried output <- mean (listobject[[1:5]]$element) to get the mean of "element" in the first five components? It doesn't like the $. I'm suspect one of the "apply" functions
2017 Sep 19
1
symbolic computing example with Ryacas
Thanks for the response. Yes, I did study the vignette but did not understand it fully. Anyway, I have tried once again now. I am happy to say that I have got what I wanted. library(Ryacas) x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C") my_func <- function(x,U,x0,C) { return (U/(1+exp(-(x-x0)/C)))} FirstDeriv <-
2017 Sep 19
2
symbolic computing example with Ryacas
Hi all, I am trying to implement the following matlab code with Ryacas : syms U x x0 C d1=diff(U/(1+exp(-(x-x0)/C)),x); pretty(d1) d2=diff(U/(1+exp(-(x-x0)/C)),x,2); pretty(d2) solx2 = solve(d2 == 0, x, 'Real', true) pretty(solx2) slope2=subs(d1,solx2) I have tried the following : library(Ryacas) x <- Sym("x");U <- Sym("U");x0 <-
2009 Jun 19
1
Drawing dendrogram
Dear all, I would like to draw a dendrogram and mark some parts/branches (by using "segments") including their labels. If I draw it without specifying the length of x axix, I am able to do that (as in My dendrogram 1 of the following codes). However, if I want to specify the x axix, I am not able to draw marking line (by using "segments") including labels (as in My dendrogram
2018 Sep 07
2
Construir matriz de distancias
Me encantaría saber pensar así de una. Creo que entiendo bien lo que me decís, pero no lo puedo poner en marcha en mi computadora, por algo que no sé qué será. Cuando llego a: > cosa<-aline(w1=x,w2=y) En RStudio me dice que R sufrió algo. Probé directamente desde la consola linux y también: > cosa<-aline(w1=x,w2=y) *** stack smashing detected ***: /usr/lib/R/bin/exec/R terminated
2017 Sep 19
0
symbolic computing example with Ryacas
Have you studied the "Introduction to Ryacas" vignette that come with the package? Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Sep 19, 2017 at 2:37 AM, Vivek Sutradhara <viveksutra at gmail.com> wrote:
2014 Dec 04
2
[LLVMdev] Optimising bit-flipping code
Hi, I'm compiling a large code base that uses tagged data, with the tag in the two lowest bits. I.e. ints are shifted two steps to the left and have 2 in the tag bits, pointers have 0 in the tag bits, etc. When I compile the code, I notice that there are places where -O3 doesn't remove unnecessary tag bit tests and manipulations, when they are performed with bitwise manipulation (which
2015 Jan 15
2
[LLVMdev] generate llvm.assume calls in GVN?
Would it be wrong to generate the llvm.assume IR suggested below? in GVN? Given more info via the AssumptionCache, InstCombine can then do more optimizing. On Thu, Dec 4, 2014 at 12:10 PM, Philip Reames <listmail at philipreames.com> wrote: > > On 12/04/2014 02:19 AM, Lars Rasmusson SICS wrote: > > Hi, > > I'm compiling a large code base that uses tagged data, with
2007 Apr 08
1
Relative GCV - poisson and negbin GAMs (mgcv)
I am using gam in mgcv (1.3-22) and trying to use gcv to help with model selection. However, I'm a little confused by the process of assessing GCV scores based on their magnitude (or on relative changes in magnitude). Differences in GCV scores often seem "obvious" with my poisson gams but with negative binomial, the decision seems less clear. My data represent a similar pattern as
2001 Dec 18
1
Newbie problems with R and compiled C
I'm a beginer programming C and I have the following problem: I have the following C-code file #include <stdlib.h> void gen(int *n, int *a, int *c, int *m, int *x0, int *x); main(){ int nn = 31; int aa = 3; int cc = 0; int mm = 31; int xx0 = 9; int xx[nn]; int i; gen(&nn,&aa,&cc,&mm,&xx0,xx); for (i = 0; i <= nn-1; i++) printf("%d
2020 Sep 15
2
[EXTERNAL] Re: Simulation of load-store forwarding with MI scheduler on AArch64
Thanks for prompt response, Andy This will work for cases when address is not modified. However this doesn’t seem to work for pre/post increment load stores. Consider data to address forwarding: $x0 = ldr x0, [x1] $x0, $x2 = ldr x2, [x0, 16]! The second instruction will have it’s own latency for address modification ($x0 register). So I don’t see how we can use ReadAdr stuff here. May be
2012 Feb 25
1
Fw: Same problem as last time, with IPv6 off
-----Originalmeddelande----- Fr?n: "Per Gunnarsson" <per at 80-244-81-186.customer.t3.se> Till: per.gunnarsson at lappstockholm.se Datum: 2012-02-25 15:20 ?mne: [Icecast] Same problem as last time, with IPv6 off OK, this is my configuration file: <icecast> ? ?<limits> ? ? ? ?<clients>100</clients> ? ? ? ?<sources>2</sources> ? ? ?
2000 Dec 21
2
Réf. : configure.in: Someone please show me a better way :)
If I remove all the export and change all the ' in ", it does work on SCO 3.2v5.0.4 |--------+-----------------------------> | | Roumen Petrov | | | <Roumen.Petrov at skal| | | asoft.com> | | | | | | 21/12/00 13:10 | | | |
2010 Apr 22
3
using which to select range of values
Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t",arr.ind=TRUE) x0[x2] Thanks. -- Muhammad
2012 Jul 17
1
about different bandwidths in one graph
Thank you in advance. Now I want to make comparison of the different bandwidth h in a normal distribution graph. This is the table of bandwidth h: thumb rule (normal)--0.00205; thumb rule(Epanech.)--0.00452; Plug-in (normal)--0.0009; Plug-in(Epanech.)--0.002. this is the condition: N=1010 data sample is from normal distribution N(0,0.0077^2). The grid points are taken to be [-0.05,0.05] and
2000 Dec 21
1
configure.in: Someone please show me a better way :)
Q: What platform don't run this script: ---------------------------------------- #!/bin/sh export X0='x0' export X1a="$X0/1" export X1b='$X0/1' export X2a="$X1a/2" export X2b='$X1b/2' $SHELL <<EOF_2 $SHELL <<EOF_1 cat <<EOF #define a "$X2a/aa" #define b "$X2b/bb" EOF EOF_1 EOF_2
2020 Sep 14
2
Simulation of load-store forwarding with MI scheduler on AArch64
Hi list, Is it possible to simulate load to store forwarding on aarch64 with MI scheduling model on AArch64? For instance $x0 data latency in the example below should be 1 cycle ldr $x0, [$x1] str $x0, [$x2] But it should be 4 cycles if we have another instruction: ldr $x0, [$x1] add $x0, $x0, 4 For ALU instructions it’s possible to use either ReadAdvance or SchedReadAdvance, but I don’t see
2015 Jan 15
2
[LLVMdev] generate llvm.assume calls in GVN?
On 15 January 2015 at 10:49, Chandler Carruth <chandlerc at google.com> wrote: > On Thu, Jan 15, 2015 at 10:30 AM, Sanjay Patel <spatel at rotateright.com> > wrote: > >> Would it be wrong to generate the llvm.assume IR suggested below? in GVN? >> > > I think so... Because: > > One very small tweak you could make would be to add an llvm.assume inside
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),