similar to: effective way to return only the first argument of "which()"

Displaying 20 results from an estimated 7000 matches similar to: "effective way to return only the first argument of "which()""

2014 Mar 02
1
internal copying in R (soon to be released R-3.1.0
Dear core group, Which operation in R guarantees to get a true copy of an atomic vector, not just a second symbol pointing to the same shared memory? y <- x[] #? y <- x y[1] <- y[1] #? Is there any function that returns its argument as a non-shared atomic but only copies if the argument was shared? Given an atomic vector x, what is the best official way to find out whether other
2012 Dec 27
3
Retrieve indexes of the "first occurrence of numbers" in an effective manner
Hi, That sounds simple but I cannot think of a really fast way of getting the following: c(1,1,2,2,3,3,4,4) would give c(1,3,5,7) i.e., a function that returns the indexes of the first occurrences of numbers. Note that numbers may have any order e.g., c(3,4,1,2,1,1,2,3,5), can be very large, and the vectors are also very large (which prohibits any loop). The best I could think of is: tmp =
2012 May 15
2
Transfering data from R list to other document format
Dear users, I want to transfer a list of results from R to some practical format, from where I can continue manipulating, copying,... the values, e.g. : list1 <- list("My first list", matrix(1:6, ncol=3), c(1,2,3,4,5,6) ) # Imagining I forgot something and want to add it to the list like: list1[[4]] <- list(c(4,4,4), "This is it") # Now I want to transfer the list to
2017 Jun 03
2
New var
Thank you all for the useful suggestion. I did some of my homework. library(data.table) DFM <- read.table(header=TRUE, text='obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004',stringsAsFactors = FALSE) DFM DFM$D =as.numeric(difftime(as.Date(DFM$end,format="%m/%d/%Y"),
2012 May 02
6
Quickest way to make a large "empty" file on disk?
R-helpers: What would be the absolute fastest way to make a large "empty" file (e.g. filled with all zeroes) on disk, given a byte size and a given number number of empty values. I know I can use writeBin, but the "object" in this case may be far too large to store in main memory. I'm asking because I'm going to use this file in conjunction with mmap to do parallel
2017 Jun 04
2
New var
Thank you Jeff and All, Within a given time period (say 700 days, from the start day), I am expecting measurements taken at each time interval;. In this case "0" means measurement taken, "1" not taken (stopped or opted out and " -1" don't consider that time period for that individual. This will be compared with the actual measurements taken (Observed-
2023 Aug 30
2
[libnbd PATCH 0/2] (Attempt to) fix Rust on BSD-based builds
I managed to get a build of the async Rust handle compiling on FreeBSD (although the cirrus CI appears to not actually run 'make check' on non-Linux machines, at least when run on my fork): https://gitlab.com/ebblake/libnbd/-/jobs/4985192286 However, I'd really like Tage's review on patch 2 to see if my Rust makes sense. Eric Blake (2): maint: Favor 4-space indent in .rs files
2023 Aug 30
1
[libnbd PATCH v9 5/7] rust: async: Add a couple of integration tests
On Wed, Aug 30, 2023 at 12:16:07PM -0500, Eric Blake wrote: > > error[E0425]: cannot find value `EPOLL_CTL_ADD` in crate `libc` > > https://www.reddit.com/r/rust/comments/65kflg/does_rust_have_native_epoll_support/ > mentions how epoll is Linux-specific, and has comments about tokio > trying to build on top of mio in order to be platform-independent (mio > uses epoll on Linux
2017 Jun 04
0
New var
# read.table is NOT part of the data.table package #library(data.table) DFM <- read.table( text= 'obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004 ',header = TRUE, stringsAsFactors = FALSE) # cleaner way to compute D DFM$start <- as.Date( DFM$start, format="%m/%d/%Y" ) DFM$end
2006 Apr 24
9
A Stylesheet for a database app
Hi to all, I''m a new subscriber of this list and a new user of RoR. I''m looking for a stylesheet to make a simple database app nicer, a css to start working with. I have to do some simple apps and I want them to be the more uniform on the presentation side. I know I can do it for myself, but a nice stylesheet is not so easy to perform for a non-grafic geek like me, and so
2009 Jan 02
2
powerware 5110 and openbsd
Hello all! I've been trying to get my UPS working with my OpenBSD stable box and I haven't had any luck yet. dmesg shows that I have something from Powerware usb0 at uhci0: USB revision 1.0 uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1 biomask f5fd netmask fffd ttymask ffff ugen0 at uhub0 port 1 "Powerware Powerware UPS" rev 0.20/0.50 addr 2 nut version
2015 Oct 06
2
After update from 3.5.x to 3.6.23 all printers configured in CUPS they are no longer shared
Il giorno mar, 06/10/2015 alle 16.23 +0100, Rowland Penny ha scritto: > OK, from the smb.conf manpage: > > To use the CUPS printing interface set printcap name = cups. > This should be supplemented by an addtional setting printing = > cups in the [global] section. printcap name = cups will > use the "dummy" printcap created by CUPS, as specified in your > CUPS
2012 Jun 15
1
Divide all rows of a data frame by the first row.
Folks, I call the function calcAmorts like so: calcAmorts(prevAm, amort, myDates) Note that I use the package lubridate. The last line where do.call is called to first divide all the rows by the first row and then rbind gives the following error: Error in do.call("rbind", apply(amortsByYears, 1, "/", amortsByYears[, : second argument must be a list By contrast if
2017 Jun 04
0
New var
Since the number of choices is small (6), how about this? Starting with Jeff's initial DFM: DFM <- structure(list(obs = 1:6, start = structure(c(16467, 14710, 13152, 13787, 15126, 12696), class = "Date"), end = structure(c(17167, 14975, 13636, 13879, 15340, 12753), class = "Date"), D = c(700, 265, 484, 92, 214, 57), bin = structure(c(6L, 3L, 5L, 1L, 3L, 1L), .Label
2011 Jul 30
3
Problem with effects package
Dear List, Several times I use this package I get the error message shown below. When I work out simple examples, it turns out to be fine, but when working with real and moderate size data sets I always get the same error. Do you know what could be the cause of the problem? Error in apply(mod.matrix[, components], 1, prod) : subscript out of bounds Error in
2012 Jul 22
4
Facter fact length?
This is a bit of a leading question, but is there a limitation as far as length/size of facts on a node? I have a need to perform one way sync of user accounts (non-Puppet managed users) on many pairs of servers. Thus far, it''s been done with scripts from primary -> backup server, and has been problematic. I''d like to create a fact that returns user:password_hash pairs,
2015 Oct 02
5
Samba 4 PDC and Windows Join
As far as i know, as of samba 4, i dont do any registry changes anymore. And thinking.. even with samba 3 i did not set these on my win 7 systems. I still have few win 7 pc's connect to samba 3.6 PDC, without registry changes. But it all depends on correct dns / dns domainname /wins settings. ( for samba also, i always use "dns proxy = yes" ) If these arent correct, then the
2017 Aug 19
4
My very first loop!! I failed. May I have some start-up aid?
Dear all, I have a data similar to this: myframe<- data.frame (ID=c("Ernie", "Ernie","Ernie","Ernie"), Timestamp=c("24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00", "25.09.2012 10:00"), Longitude=c("8.481","8.482","8.483","8.481"),
2017 Aug 19
0
My very first loop!! I failed. May I have some start-up aid?
Thank you for providing the example code... for the request of running it multiple times it would have helped if you could have confirmed that the example ran through without errors... there were a lot of mistakes in it. Look into using the reprex package to check your example next time. I don't do this kind of analysis... I really don't know what to expect from the functions. The
2012 Apr 23
2
.rda vs. .RData
Are they the same with .RData being the newer format?? Thanks, ...Tao