search for: setas

Displaying 20 results from an estimated 117 matches for "setas".

Did you mean: seta
2017 Dec 14
2
help with recursive function
Hi, I need some help with running a recursive function. I like to run funlp2 recursively. When I try to run recursive function in another function named "calclp" I get this "Error: any(!dat2$norm_sd) >= 1 is not TRUE". I have never built a recursive function before so having trouble executing it in this case. I would appreciate any help or guidance to resolve this issue.
2017 Dec 14
0
help with recursive function
You seem to have a typo at this expression (and some others like it) Namely, you write any(!dat2$norm_sd) >= 1 when you possibly meant to write !( any(dat2$norm_sd) >= 1 ) i.e. I think your ! seems to be in the wrong place. HTH, Eric On Thu, Dec 14, 2017 at 3:26 PM, DIGHE, NILESH [AG/2362] < nilesh.dighe at monsanto.com> wrote: > Hi, I need some help with running a
2017 Dec 14
2
help with recursive function
My own typo ... whoops ... !( any(dat2$norm_sd >= 1 )) On Thu, Dec 14, 2017 at 3:43 PM, Eric Berger <ericjberger at gmail.com> wrote: > You seem to have a typo at this expression (and some others like it) > > Namely, you write > > any(!dat2$norm_sd) >= 1 > > when you possibly meant to write > > !( any(dat2$norm_sd) >= 1 ) > > i.e. I think your !
2017 Dec 14
2
help with recursive function
Hi, I accidently left out few lines of code from the calclp function. Updated function is pasted below. I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is not TRUE? I would appreciate any help. Nilesh dput(calclp) function (dataset) { dat1 <- funlp1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>%
2017 Dec 14
0
help with recursive function
Eric: Thanks for taking time to look into my problem. Despite of making the change you suggested, I am still getting the same error. I am wondering if the logic I am using in the stopifnot and if functions is a problem. I like the recursive function to stop whenever the norm_sd column has zero values that are above or equal to 1. Below is the calclp function after the changes you suggested.
2017 Dec 14
0
help with recursive function
The message is coming from your stopifnot() condition being met. On Thu, Dec 14, 2017 at 5:31 PM, DIGHE, NILESH [AG/2362] < nilesh.dighe at monsanto.com> wrote: > Hi, I accidently left out few lines of code from the calclp function. > Updated function is pasted below. > > I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is > not TRUE? > > >
2017 Dec 14
3
help with recursive function
If you are trying to understand why the "stopifnot" condition is met you can replace it by something like: if ( any(dat2$norm_sd >= 1) ) browser() This will put you in a debugging session where you can examine your variables, e.g. > dat$norm_sd HTH, Eric On Thu, Dec 14, 2017 at 5:33 PM, Eric Berger <ericjberger at gmail.com> wrote: > The message is coming from
2017 Dec 14
0
help with recursive function
Eric: I will try and see if I can figure out the issue by debugging as you suggested. I don?t know why my code after stopifnot is not getting executed where I like the code to run the funlp2 function when the if statement is TRUE but when it is false, I like it to keep running until the stopifnot condition is met. When the stopifnot condition is met, I like to get the output from if statement
2017 Dec 14
1
help with recursive function
Your code contains the lines stopifnot(!(any(data1$norm_sd >= 1))) if (!(any(data1$norm_sd >= 1))) { df1 <- dat1 return(df1) } stop() "throws an error", causing the current function and all functions in the call stack to abort and return nothing. It does not mean to stop now and return a result. Does the function give
2015 May 28
2
La ejecución de mi script R es muy lenta
En el correo anterior se me olvidó mencionar que trabajo con Rstudio El 28 de mayo de 2015, 15:18, MªLuz Morales <mlzmrls en gmail.com> escribió: > Hola, > soy nueva en esta lista y también en R. Yo he realizado un script en R > que carga dos archivos csv, uno de ellos con casi 2 millones de filas. El > programa carga esos archivos a data frame, y se trata simplemente de >
2015 May 29
3
Mi script R es muy lento
Hola, quiero compartir con vosotros mi problema y la solución que me han planteado. Mi programa carga Outcomes.csv y Set-A.csv (descargados de http://garrickadenbuie.com/blog/2013/04/11/visualize-physionet-data-with-r/, apartado Getting Started --> the code and the data set) de unos 50MB entre los dos. Mi código era: # Transforma csv a data frame seta <- read.csv('Set-A.csv');
2015 May 28
2
La ejecución de mi script R es muy lenta
Hola, Si no tienes inconveniente en compartir tu conjunto de datos (puedes dejarlo en un Dropbox y compartir enlace) o incluir una salida de la variables: "seta" y "outcomes" (función "save.image()") con eso podemos darte alguna solución mucho más rápida que la que planteas. En tu código con un bucle estás tratando de rellenar una lista que son los diferentes
2015 Jun 01
2
Mi script R es muy lento
Hola Carlos, bueno la verdad es que mi pregunta era algo general, cuando no has usado data.table no parece muy intuitivo pasar de la forma de programar a la que estás más acostumbrado (bucles, notación matricial...) a esa otra. Aun no tengo un cálculo complejo concreto pero lo tendré que hacer... solo quería saber si se puede, y parece que sí, asi que será cuestión de empaparse un poco de
2008 Mar 17
1
setAs vs setIs
Hi the list I am fighting with the twins setAs and setIs... Here are some questions and comments (comments to myself but that migth be wrong, it is why I am posting them) 1. Very surprising : using setIs define 'is', 'as<-' but not 'as' ??? 2. Using setAs define 'as', 'as<-' but not 'is'.....
2020 Oct 05
2
S4 - inheritance changed by order of setClassUnion and setAs()
Dear colleagues, there is a behaviour with S4 (virtual) classes that I find very hard to understand: Depending on the position of setAs(), the tree of inheritance changes. This is my baseline example that defines the classes "grandma", "mother", "daughter" and a virtual class "mr_x". For a new instance if "daughter", "mr_x" is betweeen "mother" and "grandma...
2005 Mar 29
0
setAs between a new S4 class and "POSIXlt"
...Tue Mar 22), but got no answer. Now I do not know if the formulation of my question was unclear or the question is not so easy to answer or to easy (what I do not hope). My problem: I create a new S4 class, containing one slot, data (of class POSIXlt). I tried to define a transformation via setAs() between the new S4 class and the existing "POSIXlt" class that is virtual S4 Class with subclass "POSIXt". Then using as() gives an error message (see code below) when I transform from "POSIXlt" to the new class. Then I defined another as()...
2020 Oct 06
0
S4 - inheritance changed by order of setClassUnion and setAs()
...n tell (/conjecture), this is because the list of classes a particular class inherits from directly is appended to as needed, and so the order that a class extends others isd refined by the order that those connections are defined. We can see this with two setClassUnion calls, rather than required setAs: > setClass("grandma", slots = c(a = "character")) > setClass("mother", slots = c(b = "matrix"), contains = "grandma") > setClass("daughter", slots = c(c = "list"), contains = "mother") > setClassUnion(n...
2004 Nov 26
1
Namespaces, coercion and setAs
I'm trying to resolve a small problem that has arisen from introducing a NAMESPACE for the package SparseM. Prior to the namespace I had a class "matrix.diag.csr" that consisted of diagonal sparse matrices. It was defined to have the same attributes as the matrix.csr class and setAs was used to define how to coerce integers and vectors into this form: setClass("matrix.diag.csr","matrix.csr") setAs("numeric","matrix.diag.csr",function(from){ if(length(from)==1){ n <- as.integer(from) if(n&gt...
2005 Mar 22
0
setAs between a new S4 class and "POSIXlt"
...t;POSIXlt". I did the following: ## Definition of the new class: setClass("dtime", representation(data = "POSIXlt"), prototype(data = as.POSIXlt("2004/06/01"))) ## Transformation between the new class "dtime" and "POSIXlt": setAs("dtime", "POSIXlt", def = function(from) { from at data }) setAs("POSIXlt", "dtime", def = function(from) { new("dtime", data = from) }) ## Create a new "dtime" object: (x1 <- new("dtime")) str(x1) ## Transformation to &q...
2003 Sep 28
1
infinite recursion during package installation with methods, setAs
...eta of R. I think I can reproduce it with a simple example. I have package called `testpkg' in directory testpkg/. In the R/ subdirectory of testpkg/ I have a file called testpkg.R which contains the following two lines: setClass("testpkg", representation(pts = "list")) setAs("testpkg", "numeric", function(from, to) as.numeric(unlist(from))) Then, in the main testpkg/ directory I have an empty `install.R' file and a dummy DESCRIPTION file (as well as an empty man/ subdirectory). When I run `R CMD INSTALL testpkg' I get the following output...