search for: fun3

Displaying 20 results from an estimated 22 matches for "fun3".

Did you mean: fun
2011 Oct 01
1
error using ddply to generate means
Dear list, I encounter an error when I try to use ddply to generate means as follows: fun3<-structure(list(sector = structure(list(gics_sector_name = c("Financials", "Financials", "Materials", "Materials")), .Names = "gics_sector_name", row.names = structure(c("UBSN VX Equity", "LLOY LN Equity", "AI FP Equity&q...
2002 Aug 01
6
update() can not find objects (PR#1861)
Full_Name: Yi-Xiong Zhou Version: 1.5.1 OS: win2000pro Submission from: (NULL) (64.169.249.42) Update() can not find objects when it is used in a function, which is in turn being called by another function. Here is a R script to show the problem: ######## begin of the test script ########## fun1 <- function() { x <- matrix(rnorm(500), 20,25) y <- rnorm(20) oo <- lm(y~x)
2011 Apr 09
1
loop and sapply problem, help need
...uot;PR4", "PR5", "PR6", "PR7", "PR8", "PR9", "PR10") fun11 <- function(x){ smpool <- c(1,2,3,3) x <- sample(smpool, 10, replace= TRUE) } newd <- sapply (pvec, fun11) # function to recode this new generated data fun3 <- function(x) { (if ( x ==1){ x = lcd1 }else if (x ==2){ x = lcd2 } else if ( x ==3 ){ x = lcd3 } else x = NA ) return(x) } Applying the function: pn <- sapply (newd, fun3) I am getting 10 x 100 matrix, in contras...
2012 Aug 12
3
Error in if-command
Hello everybody, I don't understand what I'm doing wrong. But it isn't possible that each element of the if-condition is tested for each vector element? y <- c(1:20) > y [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 > if (y == c(4,5,9,11,17)) { print("yes") } else { print("no")} [1] "no" warning: In if (y == c(4, 5, 9, 11,
2020 May 02
1
issues with environment handling in model.frame()
...B but this doesn't: fun2 <- function(x, y) model.frame(x, warpbreaks, y) fun2(~wool, with(warpbreaks, breaks < 15)) #> Error in eval(substitute(subset), data, env): object 'y' not found model.frame is used by xtabs() and aggregate() so the following won't work either: fun3 <- function(x, y) xtabs(x, warpbreaks, y) fun3(~wool, with(warpbreaks, breaks < 15)) #> Error in eval(substitute(subset), data, env): object 'y' not found fun4 <- function(x, y) aggregate(x, warpbreaks, length, subset = y) fun4(breaks ~ wool, with(warpbreaks, breaks < 15)) #...
2011 Nov 23
2
How to increase precision to handle very low P-values
...## rho01 = 0.5 rho105 = 0.5 rho005 = 0.5 t = 8 z = 2 w0=(rho005-rho01*rho105)/(1-rho01^2) w1=(rho105-rho01*rho005)/(1-rho01^2) fun1=function(t,z){ return(pnorm((t-rho01*z)/sqrt(1-rho01^2))*dnorm(z)) } fun2=function(t,z){ return(pnorm(((t-w0*z)/w1-rho01*z)/sqrt(1-rho01^2))*dnorm(z)) } fun3=function(t,z){ return(pnorm((-t-rho01*z)/sqrt(1-rho01^2))*dnorm(z)) } asy=function(t){ z1=2*integrate(function(z){fun1(t,z)},lower=0,upper=t*(1-w1)/w0,subdivisions=1000)$value z2=2*integrate(function(z){fun2(t,z)},lower=t*(1-w1)/w0,upper=t,subdivisions=1000)$value z3=-2*integrate(function(z){fu...
2007 May 17
1
use loop or use apply?
...; # transpose is needed } else if (method == 4) { C <- t(apply(A, MARGIN=1, FUN="FUN2", BB=B)) } } FUN1 <- function(aa, BB) return(rowSums( (matrix(aa, nrow=nrow(BB), ncol=ncol(BB), byrow=TRUE) - BB)^2) ) FUN2 <- function(aa, BB) return(apply(BB, MARGIN=1, FUN="FUN3", aa=aa)) FUN3 <- function(bb,aa) return(sum((aa-bb)^2)) ### With these methods and the following intitializations, a <- 100; b <- 1000; d <- 100; n.loop <- 20; A <- matrix(rnorm(a*d), ncol=d) B <- matrix(rnorm(b*d), ncol=d) all.times <- matrix(0,nrow=5,ncol=4) row...
2009 Jun 03
0
Problems with conditional importFrom in NAMESPACE
...jects of a class defined in pkg2 (class2), for those users who actually have both packages installed. I think this should be possible to solve by having a conditional importFrom in NAMESPACE of pkg2: if ("pkg1" %in% rownames(utils:::installed.packages()) { importFrom(pkg1,fun1,fun2,fun3) S3method(fun1,class2) S3method(fun2,class2) S3method(fun3,class2) } What causes trouble for me is that the dependency of pkg1 seems to be defined at the time of building a binary of pkg2 for Windows users, not when the package is loaded (using R CMD BUILD -binary pkg2, R-version 2.9.0 an...
2007 Jan 06
1
listing all functions in R
...highlighting file for GeSHi [*] for a website I am currently putting together. The syntax file needs a list of keywords to highlight. How can I generate a list of all the functions in a base R installation? Ideally the list would be formatted like this: "'fun1', 'fun2', 'fun3'" when printed to the screen so I can copy and paste it into the syntax file. I'm sure this has been asked before, but I stupidly didn't save that email and I couldn't come up with a suitable query parameter for Jonathan Baron's search site to return results before timin...
2009 Jun 09
0
Dependency between packages for Windows-binaries
...would be the easiest solution, but it is a bad solution as most users will only be interested in one of the packages. I thought this could be solved by including the following in NAMESPACE of pkg2: if ("pkg1" %in% rownames(utils:::installed.packages()) { importFrom(pkg1, fun1, fun2, fun3) S3method(fun1, class2) S3method(fun2, class2) S3method(fun3, class2) } Unfortunately, this doesn't seem to work as I expected, particularly when I try to build a binary for Windows-users (R CMD build -binary pkg2). It seems for me that the dependency between pkg2 and pkg1 is defined at...
2012 Nov 11
2
changing the signs in rows or columns in matrices and check them if they are identical
Dear R users, i have this problem with matrices i want to check between two matrices if they are isomorphic i will give an example for what excactly i want   1 -1  1                                 -1  1   1 -1   1  -1                                1  -1  -1   1  1   -1                                1   1  -1 this two matrices are isomorphic beacause if i change the first 2 columns the matrices
2002 Apr 12
1
Problems with memory
...it is started by the command: Rterm --min-vsize=10M --max-vsize=100M --min-nsize=500k --max-nsize=1M I've been had problems when executing a loop like: attach("data.Rdata") for (i in 1:n) { object1<-fun1(data...) object2<-fun2(...object1) object3<-fun3(...object2) object4[,i]<-fun4(...object3) rm("object1","object2","object3") } After few interactions it stops with the message: "Error: cannot allocate vector of size 7890 Kb In addition: Warning message: Reached total allocation of 127Mb: see...
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to create two separated samples with the same number os firms where #one firm in the first have a corresponding
2020 Apr 22
3
how to add my own passes to LTO pass
Hi, I have a module pass and I hope to use it to optimize a real-world program. I need LTO,and I have got LTO plugin. But How can I add my passes to LTO Pass. I can't find solution. What should I do? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200422/76d2b046/attachment.html>
2009 Jun 30
1
Conditional dependency between packages
...g1 would be the easiest solution, but it is not preferred as most users will only be interested in one of the packages. I thought this could be solved by including the following in NAMESPACE of pkg2: if ("pkg1" %in% rownames(utils:::installed.packages()) { importFrom(pkg1, fun1, fun2, fun3) S3method(fun1, class2) S3method(fun2, class2) S3method(fun3, class2) } Unfortunately, this doesn't seem to work as I expected, particularly when I try to build a binary for Windows-users (R CMD build -binary pkg2 or R CMD INSTALL --build pkg2). It seems for me that the dependency between...
2007 Nov 13
2
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...the same memory cell (if %x == -2) define void @fun2(i32 %x) { entry: %c = getelementptr %ty1* @G, i32 0, i32 1, i32 %x %d = bitcast %ty1* @G to i8* ret void } ; alias(%e, %f, 1, 1) returns NoAlias, ; although they may point to the same memory cell (if %z == 2) define void @fun3(i32 %z) { entry: %e = getelementptr %ty2* @H, i32 0, i32 1, i32 0 %f = getelementptr %ty2* @H, i32 0, i32 0, i32 1, i32 %z ret void } --- Should we treat this as a bug (I may attempt to prepare a patch then)?. I suppose these are real corner cases, rather improbable to occu...
2007 Nov 13
0
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...void @fun2(i32 %x) { > entry: > %c = getelementptr %ty1* @G, i32 0, i32 1, i32 %x > %d = bitcast %ty1* @G to i8* > ret void > } > > ; alias(%e, %f, 1, 1) returns NoAlias, > ; although they may point to the same memory cell (if %z == 2) > define void @fun3(i32 %z) { > entry: > %e = getelementptr %ty2* @H, i32 0, i32 1, i32 0 > %f = getelementptr %ty2* @H, i32 0, i32 0, i32 1, i32 %z > ret void > } > --- > > Should we treat this as a bug (I may attempt to prepare a patch > then)?. > I suppose these...
2011 Aug 03
2
r-help
Hey, Is there any function plotting several "implicit functions" (F(x,y)=0) on the same fig. Is there anyone who has an example code of how to do this? The contour3d function in the misc3d package only work with the functions with three dimensions. Thanks a lot. Many thanks for your help. KnifeBoot [[alternative HTML version deleted]]
2013 Apr 24
3
[LLVMdev] [PROPOSAL] per-function optimization level control
...is only run at OptLevel > 1 Given the following scenario where: - the global optimization level is set equal to 2 and - there are two IR functions, namely Fun1 and Fun2, where: * Fun1 does not override the default optimization level; * Fun2 overrides the optimization level to -O0; * Fun3 overrides the optimization level to -O1. The table below describes the relationship between functions and passes that are expected to be run on them. Boxes with an 'X' in them represent the pass being allowed to run on the function. \ A B C D E +---+---+---+---+...
2012 Nov 17
3
transform input argument (matrix) of function
Dear list!   I would like to write a function to transform matrix, which is input argument of a written function. It is easy with new matrix (see below), but my idea is to transform input argument (matrix) of function without any additional matrixes. Here is an example: fun1 <- function(xy) { xy <- cbind(xy[,1], xy[,2], xy[,1] + xy[,2]) return(xy) }   df1 <- matrix(c(1,2,3,1,2,3), ncol =