Displaying 20 results from an estimated 20 matches for "fn3".
Did you mean:
fn
2013 Jan 01
1
Behavior or as.environment in function arguments/call (and force() behaviors...)
...ue.
The term used in that doc is 'search list', which is ambiguous, but the
see also section mentions search(), so I would *think* that is what is
intended. Either way Fn1() below can't really be explained.
Major question is what in the world is Fn1 doing, and why is Fn2 not equal
to Fn3? [ Fn3/Fn4 are doing what I want. ]
Fn1 <- function(x="test",pos=-1,env=as.environment(pos)) {
ls(env)
}
Fn2 <- function(x="test",pos=-1,env=as.environment(pos)) {
force(env)
ls(env)
}
Fn3 <- function(x="test",pos=-1,env=as.environment(pos)) {
# should be...
2006 Jul 17
10
String manipulation and formatting
I'm trying to write a simple function that does the following:
[command] xify(5.2)
[output] XXX.XX
[command] xify(3)
[output] XXX
Any simple solutions (without using python/perl/unix script/...)?
Thanks,
Saghir
---------------------------------------------------------
Legal Notice: This electronic mail and its attachments are i...{{dropped}}
2017 Aug 04
3
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...ement_t *b_ptr, unsigned char changed) {
if (a_ptr && b_ptr && a_ptr->idx == b_ptr->idx) {
if (!changed && dst_ptr && dst_ptr->idx == a_ptr->idx) {
/* Do something */
} else {
changed = 1;
if (!dst_ptr)
dst_ptr = fn3();
else
dst_ptr->idx = a_ptr->idx;
/* Do something. */
}
} else {
changed = fn4();
}
return changed;
}
unsigned char fn1 (element_t *a_ptr, element_t *b_ptr) {
unsigned char changed = 0;
while (b_ptr) {
if (!a_ptr || a_ptr->idx == b_ptr...
2011 May 07
1
Printing a title for an object in the console when writing a function XXXX
Hello everyone,
What is the best way to have R print a title and then skip a line (both
without the [1] line preffix) when writing a function that prints an object
(to the console)? Simplified example:
fn3<-function(x,y){
c1<-cov(x,y)
print(c1)}
data1<-data.frame(age=rnorm(50),weight=rnorm(50))
attach(data1)
fn3(age,weight)
=====
How do I have R print a nicely formatted title when printing c1 to the
console?
Thanks,
Dan
[[alternative HTML version deleted]]
2008 Aug 25
0
[LLVMdev] Proposal : Function Notes
...fine void @fn2() notes("opt-size=2") { ... }
>
> The function fn2() is aggressively optimized for size. The code
> generator may
> sacrifice performance while selecting instructions. The inliner will
> aggressively
> reduce inlining threshold.
>
> define void @fn3() notes("noinline") { ... }
> define void @fn4() notes("always_inline") { ... }
> define void @fn5() notes("noinline,always_inline") { ... }
>
> Here the inliner is instructed to not inline function fn3() anywhere
> and inline
> function fn4() every...
2007 Apr 10
1
Memory management
...t curious how memory management works in R... I need to run an
optimization that keeps calling the same function with a large set of
parameters... so then I start to wonder if it's better if I attach the
variables first vs passing them in (coz that involves a lot of copying.. )
Thus, I do this
fn3 <- function(x, y, z, a, b, c){ sum(x, y, z, a, b, c) }
fn4 <- function(){ sum(x, y, z, a, b, c) }
rdn <- rep(1.1, times=1e8)
r <- proc.time()
for (i in 1:5)
fn3(rdn, rdn, rdn, rdn, rdn, rdn)
time1 <- proc.time() - r
print(time1)
lt <- list(x = rdn, y = rdn, z = rdn, a = rdn, b...
2017 Aug 07
3
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...onst element_t *b_ptr, unsigned char changed) {
if (a_ptr && b_ptr && a_ptr->idx == b_ptr->idx) {
if (!changed && dst_ptr && dst_ptr->idx == a_ptr->idx) {
/* Do something */
} else {
changed = 1;
if (!dst_ptr)
dst_ptr = fn3();
else
dst_ptr->idx = a_ptr->idx;
/* Do something. */
}
} else {
changed = fn4();
}
return changed;
}
unsigned char fn1 (element_t *a_ptr, element_t *b_ptr) {
unsigned char changed = 0;
while (b_ptr) {
if (!a_ptr || a_ptr->idx == b_ptr->idx) {...
2017 Aug 04
4
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...a_ptr && b_ptr && a_ptr->idx == b_ptr->idx) {
> if (!changed && dst_ptr && dst_ptr->idx == a_ptr->idx) {
> /* Do something */
> } else {
> changed = 1;
> if (!dst_ptr)
> dst_ptr = fn3();
> else
> dst_ptr->idx = a_ptr->idx;
> /* Do something. */
> }
> } else {
> changed = fn4();
> }
> return changed;
> }
>
> unsigned char fn1 (element_t *a_ptr, element_t *b_ptr) {
>...
2008 Aug 22
10
[LLVMdev] Proposal : Function Notes
...r() will be the
deciding factor.
define void @fn2() notes("opt-size=2") { ... }
The function fn2() is aggressively optimized for size. The code
generator may
sacrifice performance while selecting instructions. The inliner will
aggressively
reduce inlining threshold.
define void @fn3() notes("noinline") { ... }
define void @fn4() notes("always_inline") { ... }
define void @fn5() notes("noinline,always_inline") { ... }
Here the inliner is instructed to not inline function fn3() anywhere
and inline
function fn4() everywhere. The function fn5() is...
2017 Aug 07
2
[RFC][InlineCost] Modeling JumpThreading (or similar) in inline cost model
...if (!changed && dst_ptr && dst_ptr->idx ==
> a_ptr->idx) {
> /* Do something */
> } else {
> changed = 1;
> if (!dst_ptr)
> dst_ptr = fn3();
> else
> dst_ptr->idx = a_ptr->idx;
> /* Do something. */
> }
> } else {
> changed = fn4();
> }
> return changed...
2008 Aug 25
2
[LLVMdev] Proposal : Function Notes
...t-size=2") { ... }
>>
>> The function fn2() is aggressively optimized for size. The code
>> generator may
>> sacrifice performance while selecting instructions. The inliner
>> will aggressively
>> reduce inlining threshold.
>>
>> define void @fn3() notes("noinline") { ... }
>> define void @fn4() notes("always_inline") { ... }
>> define void @fn5() notes("noinline,always_inline") { ... }
>>
>> Here the inliner is instructed to not inline function fn3()
>> anywhere and inline
>&...
2008 Apr 17
1
Help with using 'get' function and variable scope
...larify?
Thanks,
Peter
p.s. when I define t.fn to be:
t.fn<- function() {
for ( j in sys.nframe():0 ) cat( j,":",ls( sys.frame( j ) ), "\n" )
}
and call that in t.fn2(), I do eventually see the 'i' variable, i.e.
> t.fn2()
2 : j
1 : i
0 : test t.fn t.fn2 t.fn3
[[alternative HTML version deleted]]
2009 Mar 23
4
newton method
Hi R-users,
Does R has a topic on newton's method?
Thank you for the info.
2008 Aug 25
0
[LLVMdev] Proposal : Function Notes
...fine void @fn2() notes("opt-size=2") { ... }
>
> The function fn2() is aggressively optimized for size. The code
> generator may
> sacrifice performance while selecting instructions. The inliner will
> aggressively
> reduce inlining threshold.
>
> define void @fn3() notes("noinline") { ... }
> define void @fn4() notes("always_inline") { ... }
> define void @fn5() notes("noinline,always_inline") { ... }
>
> Here the inliner is instructed to not inline function fn3() anywhere
> and inline
> function fn4() every...
2015 Jul 13
0
Re: Migrate Win2k3 to KVM
...de77H7NNHSuX9QU/3Z2RFMLLT5Hx0ywElDLYJI/
aYiQgD1+bEp8T6frpmaowj1jXt7OraLnblaa92md4vwMm0Bl/Oui7y+kr5XO1gjD
yri+YxAtptdge6nm2evLorQFrRi5DaVbjx0WPPHY2UJActo9lCHMciCyzAnUpsz3
c99Vlvk8jc2gTywst/rRgs7Ww9S+rxIRJZ6vck/lIjMjviIViH3aN0sQRB0cynLp
DPhkB/Yedmj8PpNQstl8srg1D34Itir80Ve/uk7/vdlZp1D1670r7nXN6p46IGh5
Fn3/SNUE5Hfa0DBSqo9o
=ovns
-----END PGP SIGNATURE-----
2011 May 07
1
Evaluating a multivariable function XXXX
>
> Hello everyone,
>
> I have the following R code for a multivariable function:
>
>
> > fn2<-function(x,y,z){(y+2*z)/(5*y-x*z)}
> >
> > fn2(-5,-2,3)
> [1] 0.8
>
>
>
> No problems.
>
> ===
>
> If, however, I call the function using a vector substitution for the
> arguments, R sees this as 3 separate calls to the function while
2010 Jul 05
3
data.frame: adding a column that is based on ranges of values in another column
Dear List,
I've been looking tirelessly for a solution to this dilemma but without success. Perhaps someone has an idea that will guide me in the right direction.
Suppose I have the following data.frame:
DF = data.frame(X = c(114.5508, 114.6468, 114.6596, 114.6957, 114.6828, 114.8903, 114.9519, 114.8842,
114.8579, 114.8489), Y = c(47.14094, 46.98874, 46.91235, 46.88265, 46.80584, 46.67022,
2010 Oct 18
1
Icecast relay/fallback problem
Hi list,
I'm having some problems with my new Icecast setup and I was hoping you can
help me with it. My Icecast setup looks like this:
[encoder] [encoder]
\ /
[back-end node]
| | | |
[fn1][fn2][fn3][fn4]
I have two active encoders, one is encoding to the active mount and one is
encoding to the fallback mount on the back-end node. Configuration of the
mounts is as follows:
<mount>
<mount-name>/activemount.mp3</mount-name>
<fallback-mount>/fallb...
2015 Jul 11
8
Re: Migrate Win2k3 to KVM
Hi,
The error line is:
*** STOP: 0x0000007B (0xF789AA94, 0xC0000034, 0x00000000, 0x00000000)
Nothing more! (Of course there are some inrelevant text line about chkdsk,
etc.)
> Basically, what's required is the "STOP:" line + the image where it
> fails (so, the line below). Image being likely to be NTOSKRNL.EXE
>
Nothing about NTOSKRNL.EXE on the blue screen!
> >
2014 Jun 24
3
[PATCH 1/2] Drop dosutil/mdiskchk.com
...3e&DHeSf|5CHw`T-xuDqc0J*+Vp at ik&7j}2
zE^l?Q9J+9lVzNU}?#gpBW9e^lzFRY_C at viHmJf+zYHMHlp^1te=Nm0kpdHk+RgHl4
z+XAF+XoVX&Idjz8CEJC%?{qh2iL#6BgKJoUKzuAxsLuBK>KOi2%vucUaeEo;`C-u<
zMwe>J2l*jalbPC-gUnFM=>AV33t*-r+Yt$~XIsz9y>~pp0Qka5B8Q-n%odkvN&Vyw
zt144icaTy_8ryKU=h=cfWu?3(Fn3=5Y^EROSC%)0!~RaSVkz!h0|>y3luS9vo~7pN
zt<qJ;GbNNTmIBElnf+#D7flx)*aI9ctO at IRdLKU@87okN4P>Q00pP$t*HrTF59wJ_
zhfB-Pk6G%owVGu0px<1x-rJkAt(tMzmr1Z45LRd7$Hq&%Vf|MSicyh;V_Li-n#@^%
zwoJAD_m9!^=+bVX%K(h at ig*dae@{KT>fUmH at zA@0>#$DaGP8Xn;K?ea1*3WYX<Oy7
zXOXJkI$<Yn=W^Yyu)aWF03R...