similar to: RFC: sapply() limitation from vector to matrix, but not further

Displaying 20 results from an estimated 20000 matches similar to: "RFC: sapply() limitation from vector to matrix, but not further"

1999 Jan 16
1
Core dump on sapply misuse
Developers: I hope this is the appropriate place to post this request. I am getting a core dump in an application of sapply. A simplified example is the following. Because simplify=TRUE is the default for sapply and tapply, the following works x <- 1:5; sapply(x,list) but the following dumps core with an access violation x <- 1:5; myf <- function(x) list(x,x); sapply(x,myf)
2008 Jan 07
2
reducing the number of x-axis lables in a bwplot while plotting all boxes
I apologize if this is somewhere in the archives, but I can't seem to find a solution to this question. I've been trying to plot a bwplot: print( bwplot( n.pareto ~ as.factor(gen) | mut.rate * n.pop, data=p6, horizontal=FALSE, box.ratio=0.75, cex=0.6, xlim=c(-1,51), ylim=c(-1,500),
2013 May 03
0
[LLVMdev] [Polly] GSoC Proposal: Reducing LLVM-Polly Compiling overhead
Dear Tobias, Thank you very much for your very helpful advice. Yes, -debug-pass and -time-passes are two very useful and powerful options when evaluating the compile-time of each compiler pass. They are exactly what I need! With these options, I can step into details of the compile-time overhead of each pass. I have finished some preliminary testing based on two randomly selected files from
2013 May 02
2
[LLVMdev] [Polly] GSoC Proposal: Reducing LLVM-Polly Compiling overhead
On 04/30/2013 04:13 PM, Star Tan wrote: > Hi all, [...] > How could I find out where the time is spent on between two adjacent Polly passes? Can anyone give me some advice? Hi Star Tan, I propose to do the performance analysis using the 'opt' tool and optimizing LLVM-IR, instead of running it from within clang. For the 'opt' tool there are two commands that should help
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs? I have the following problem! I have a function that calls one or more functions, depending on the input parameters. I am searching for the fastest way to select and execute the selected functions and return their results in a list. The number of possible functions is 10, however usually only 2 are selected (although sometimes more, even all). For examples, if I have function
2013 May 03
2
[LLVMdev] [Polly] GSoC Proposal: Reducing LLVM-Polly Compiling overhead
On 05/03/2013 11:39 AM, Star Tan wrote: > Dear Tobias, > > > Thank you very much for your very helpful advice. > > > Yes, -debug-pass and -time-passes are two very useful and powerful > options when evaluating the compile-time of each compiler pass. They > are exactly what I need! With these options, I can step into details > of the compile-time overhead of each pass.
2011 Feb 22
1
Discrepancies in run times
Dear R-users, I am in the process of creating new custom functions and am quite puzzled by some discrepancies in execution time when I run some R scripts that call those new functions. So here is the situation: - let's assume I have created two custom functions, called myg and myf; - myg is mostly a plotting function, which makes a heavy use of grid and lattice functions; - myf is a function
2018 May 03
0
Calling the curve function with a character object converted into an expression
Sebastian: This is somewhat arcane, perhaps even a bug (correction on this welcomed). The problem is that the "expr" argument to curve() must be an actual expression, not a call to parse that evaluates to an expression. If you look at the code of curve() you'll see why (substitute() does not evaluate expr in the code). Another simple workaround other than sticking in the eval()
2012 Nov 06
1
how Can make function for selecting the products
HI. I make this code: getdata<-function('a','b','c' ,'d','e','f'){ drv <- dbDriver("SQLite") con<-dbConnect(drv, "sqlite.db") lt<-dbListTables(con) myf<-data.frame(NULL) for (i in 1:length(lt)) { myfile<-dbReadTable(con,lt[i]) myfile1<-myfile[-c(14:44)] myfile1$MODEL<-gsub(" ",
2018 May 03
1
Calling the curve function with a character object converted into an expression
Typo: should be NULL not NUL of course An alternative approach closer to your original attempt is to use do.call() to explicitly evaluate the expr argument: w <- "1 + x^2" do.call(curve, list(expr = parse(text = w), ylab ="y")) Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus
2018 May 03
2
Calling the curve function with a character object converted into an expression
Hi, Down a cascade of function calls, I want to use the curve function with an expression that is a variable. For various reason, this variable must be a character object and cannot be an expression as required by the curve function. How do I convert my variable into a expression that is accepted by curve? Thanks in advance for your help. ## The following attempts do not work myf <-
2005 Nov 23
3
Infinite recursion in S3 methods crashes R on windows (related to PR#8203?)
Hi, Infinite recursion in S3 methods seem to crash R on Windows 2000 (R terminating with the ("Rgui.exe has generated errors...") message, rather than throwing an error. This happens with both Rgui and Rterm. The following toy example triggers this: myf <- function(x, ...) UseMethod("myf") myf.default <- function(x, ...) myf(x) myf(1) ...R crashes... Which I
2010 May 28
4
vlookup in R?
Hi R-users,   I would like to search for the values of seq that match my rand values.  In excel I will use =VLOOKUP(G2,$E$2:$F$32,2).  For example, for rand=.262 it will give me approximately seq=120 and rand=0.964293344, seq=460 and etc.   E           F     G cdf         seq   rand 0.00E+00    0     0.262123478 1.56E-03    20    0.964293344 1.55E-02    40    0.494827113 5.30E-02    60   
2011 Feb 03
1
Getting variable names in function output
Dear R-users, I would like to have some advises about a problem illustrated by the following snippet. Within myf, I need to evaluate a piece of R code that is passed as a character argument and then return the objects that are created by this code. The difficulty comes from the fact that the content of the code is variable and unknown to me (obviously not in this illustration!). With the
2023 Mar 27
1
Cambiar orden top-down stacked area ggplot2
Buenos días, con el código de abajo obtengo un agregate que empieza por abajo con la categoría C7 y termina arriba por la C1. Me gustaría que fuera al revés, que la C1 estuviera abajo y ascendiera hasta tener la C7 arriba. Gracias, Manuel year<-c(rep(1990, times=7),rep(2018, times=7),rep(2040, times=7),rep(2060, times=7),rep(2080, times=7),rep(2100, times=7))
2010 May 28
1
something like vlookup in R?
Hi r users,   I would like sort of   cdf         seq   rand 0.00E+00    0     0.262123478 1.56E-03    20    0.964293344 1.55E-02    40    0.494827113 5.30E-02    60    0.733726005 1.16E-01    80    0.800408948 1.97E-01    100   0.925748466 2.88E-01    120   0.047578356 3.80E-01    140   0.266060366 4.68E-01    160   0.125522629 5.48E-01    180   0.701193274 6.18E-01    200   0.915799432
2024 Jan 11
4
arrow on contour line
Hello, I am drawing contour lines for a function of 2 variables at one level of the value of the function and want to include a small arrow in any direction of increase of the function. Is there some way to do that? Below is an example that creates the contour lines. How do I add one small arrow on each line in the direction of increase of the function (at some central point of the contour
2004 Apr 05
3
Evaluation of functionals
Suppose I have f1 <- function(x) x f2 <- function(x) x^2 funlist <- list(f1,f2) Then I would like to evaluate funlist such that when x is 10 I should get a list with 10 and 100. A naive way of doint this is myf <- funlist[[1]] do.call(paste(quote(myf)), list(x=10)) myf <- funlist[[2]] do.call(paste(quote(myf)), list(x=10)) - but there has to be much
2007 Nov 29
1
Prorating scale items
Hello, I am hoping for some advice as to how I can prorate a number of scale items that comprise a score. At least 69 of 159 cases have at least 1 value missing (65 cases have H7 missing). The maximum number of missing is 5. I want to compute a total score, a score for the H items, the R items and C items. H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, C1, C2, C3, C4, C5, R1, R2, R3, R4, R5 I am
2006 Dec 14
1
Reverse order of grouping factor in grouppedData
I created the following groupedData object (nlme library): gd <- groupedData(Conc ~ Time | Subj, order.groups=T, FUN = myf, data=mydata) The idea of the myf function is to reverse the order of the grouping factor Subj (or better, reorder from largest to smallest). In the mydata data set, Subj is an integer that gets converted into a factor in the groupedData object. Does anyone