Displaying 20 results from an estimated 2284 matches for "cleverly".
2005 Jul 12
2
Puzzled at ifelse()
I have a situation where this is fine:
> if (length(x)>15) {
clever <- rr.ATM(x, maxtrim=7)
} else {
clever <- rr.ATM(x)
}
> clever
$ATM
[1] 1848.929
$sigma
[1] 1.613415
$trim
[1] 0
$lo
[1] 1845.714
$hi
[1] 1852.143
But this variant, using ifelse(), breaks:
> clever <- ifelse(length(x)>15, rr.ATM(x, maxtrim=7), rr.ATM(x))
2018 Jan 04
3
silent recycling in logical indexing
Hmm.
Chuck: I don't see how this example represents
incomplete/incommensurate recycling. Doesn't TRUE replicate from
length-1 to length-3 in this case (mat[c(TRUE,FALSE),2] would be an
example of incomplete recycling)?
William: clever, but maybe too clever unless you really need the
speed? (The clever way is 8 times faster in the following case ...)
x <- rep(1,1e6)
2004 Apr 08
2
Clever R syntax for extracting a subset of observations
I know that if:
x = seq(1,10)
d = c(7,3,2)
and if I say
y = x[d]
then I get the vector y as (7,3,2). Very clever! This idea is used
intensively with the boot library.
Now consider the following code (which works):
---------------------------------------------------------------------------
library(boot)
sdratio <- function(D, d) {
return(sd(D$x[d])/sd(D$y[d]))
}
x =
2023 Dec 01
5
adding "Page X of XX" to PDFs
OS X
R 4.3.1
Colleagues
I often create multipage PDFs [pdf()] in which the text "Page X" appears in the margin. These PDFs are created automatically using a massive R script.
One of my clients requested that I change this to:
Page X of XX
where XX is the total number of pages.
I don't know the number of expected pages so I can't think of any clever way to do this. I
2006 Feb 11
6
DHH Interviewed by MySQL
I didn''t see anyone post a link to David''s Interview by Lenz here on the list so I decided to post it.
The interview can be accessed here:
http://dev.mysql.com/tech-resources/interviews/david-heinemeier-hansson-rails.html
I was very happy to see the interview on PlanetMySQL as just the other day I was talking about RubyOnRails on my MySQL blog which is syndicated
2011 Jul 11
2
[LLVMdev] RegAllocFast uses too much stack
On Jul 11, 2011, at 3:41 PM, Dan Gohman wrote:
> On Jul 11, 2011, at 3:06 PM, Eli Friedman wrote:
>
>> On Mon, Jul 11, 2011 at 2:44 PM, Eric Christopher <echristo at apple.com> wrote:
>>>
>>> On Jul 11, 2011, at 1:48 PM, Nick Lewycky wrote:
>>>
>>> This seems odd. I'd think that fast-isel should be able to materialize the constants when
2008 Apr 19
3
Feature Request External label resolution
...ore complex, and Images has a bunch of sub
directories.
site/
Images
header_rotate
inventory_pix
misc
Business
Home
When this happens I have to change the link for every pic
on every page. If I use an image in 6 places, I have to
change it in 6 places.
HOWEVER
Suppose I cleverly used the footnote form of links.
I.e:
[Image alt text][LABEL]
Suppose that markdown was clever enough to reference an external
file (in .markdownrc of course) for the resolution of LABEL.
NOW when I re-arrange the universe, I only have to change the
reference in this one file, NOT in every fil...
2006 Jun 15
0
Too clever for my own good.
I just spent a couple of hours trying to track down a maddening tricky
problem.
Here''s the backstory...
I''m developing in OSX using locomotive and rails 1.1.2
My application suddently started behaving very inconsistently. I would
go to a controller and the first time I went there, everything would
work fine. If I refreshed, or hit another action, I would start getting
2005 Sep 20
1
Is there a clever way to page a group of extensions?
I want to be able to dial a 'pager' extension from an phone on my
asterisk server, and have it ring all other extensions *except* the
extension from which I am calling (because call waiting is enabled on
most extensions by default) - effectively giving me the ability to
page all other extensions from any phone. The solutions I've come up
with so far (individual contexts for each
2009 Apr 27
2
Who has the clever Polycom upgrade system?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I remember someone wrote a great document concerning Polycom server
provisioning that provided a way to ensure that updates to the firmware
did not overwrite customizations. I'll be damned if I can remember
where I saw it. It may have been discussed during a VUC session or may
have been on this list.
Either way, I'm unable to google my way
2009 Nov 18
1
clever ways to "share" an extension between sip and fxs
Using Asterisk 1.6.1.9, I'm looking for a way to "share an extension"
between a SIP phone (Cisco 7940) and a SLT on a FXS port of a Cisco 1760
(via sip) -- at any given time I want to be able to pick up either phone
and it should be "bridged" to the other - just like having two SLTs on the
same copper pair.
The goal is to have a cheap cordless telephone sit right next
2001 Sep 02
2
Wine or AOL being so clever?
Just installed Aim for win 98 using Wine, and it ended up putting a nice
Aim icon on my KDE desktop with the wine command in to start aim - i.e.
wine "/mnt/win98/Pro...."
This is getting really smooth!
Simon
2007 Apr 20
1
SELinux and daemons - clever way to change default locations?
I'm sure you've seen this before:
You need to slightly tweak the default installation of a major daemon -
let's say you're running a big MySQL database and you need to put it on
a different filesystem, mounted (for example) as /db
So you move /var/lib/mysql to /db/mysql (and preserve all the file
attributes, including SELinux), change /etc/my.cnf accordingly, start
mysqld -
2010 Aug 06
3
image plot but data not on grid.
Hi,
Would like to make an image
however the values in z are not on an uniform grid.
Have a dataset with
length(x) == length(y) == length(z)
x[1],y[1] gives the position of z[1]
and would like to encode value of z by a color.
looking for something like
plot(x,y, col = z)
where col for z is cleverly chosen from a colorscale.
Hope I made clear what I am looking for.
Thanks
Eryk
2007 Apr 27
1
how to be clever with princomp?
Hi all,
I have been using princomp() recently, its very useful indeed, but I have
a question about how to specify the rows of data you want it to choose.
I have a set of variables relating to bird characteristics and I have been
using princomp to produce PC scores from these.
However since I have multiple duplicate entries per individual (each bird
had a varying number of chicks), I only want
2008 Jul 02
5
multiplication question
folks,
is there a clever way to compute the sum of the product of two vectors such that the common indices are not multiplied together?
i.e. if i have vectors X, Y, how can i compute
Sum (X[i] * Y[j])
i != j
where i != j
also, what if i wanted
Sum (X[i] * Y[j] * R[i, j])
i != j
where R is a matrix?
thanks,
murali
2006 Jun 15
3
Need help creating a clever route
What I want to do is wrap all the scaffolded administrated pages for my
webapp into an admin folder in the controllers and views folders.
So...
/app
/controllers
/admin
issue_controller.rb
article_controller.rb
topic_controller.rb
... etc. ...
/views
/admin
/issue
_form.rhtml
edit.rhtml
list.rhtml
new.rhtml
2004 Apr 11
9
pasting results into Word/Excel
Is there some clever way of pasting results from R into Excel or Word, as
tab limited format so they are easy to turn into a formatted table.
Or is there some other way of doing this to avoid the time spent
reformatting the output for presentation.
If different, I am also interested in an answer to the same question but
using S-Plus.
Many thanks,
Graham
2010 Jul 12
2
findInterval and data resolution
Hello Wise Ones...
I need a clever way around a problem with findInterval. Consider:
vec1 <- 1:10
vec2 <- seq(1, 10, by = 0.1)
x1 <- c(2:3)
a1 <- findInterval(x1, vec1); a1 # example 1
a2 <- findInterval(x1, vec2); a2 # example 2
In the problem I'm working on, vec* may be either integer or numeric, like
vec1 and vec2. I need to remove one or more sections of this vector;
2024 Jul 21
1
Using the pipe, |>, syntax with "names<-"
If you object to names(x)[2]<- ... then use replace:
z |> list(x = _) |> within(replace(names(x), 2, "foo")) |> _$x
On Sun, Jul 21, 2024 at 11:10?AM Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> hmmm...
> But note that you still used the nested assignment, names()[2] <-
> "foo", to circumvent R's pipe limitations, which is exactly