similar to: Selections in lists

Displaying 20 results from an estimated 1000 matches similar to: "Selections in lists"

2011 Jun 02
2
Counting occurrences in a moving window
Hi list, based on the following data.frame I would like to create a variable that indicates the number of occurrences of A in the 3 years prior to the current year: DF = data.frame(read.table(textConnection(" A B 8025 1995 8026 1995 8029 1995 8026 1996 8025 1997 8026 1997 8025 1997 8027 1997 8026 1999 8027 1999 8028 1995 8029 1998 8025 1997 8027 1997 8026 1999 8027 1999
2011 Aug 15
1
Selecting section of matrix
Hi, I have a question concerning the selection of data. Let's say that given list h created below, I would like to select a section of the 1999 matrix. For a case (rownames and colnames) I would like to select the cells that have a value > 0. So for case 8025 8025 8026 8027 8025 1 1 1 8026 1 1 1 8027 1 1 1 And for case 8028 8028 8029 8028 1
2011 Aug 22
1
Selecting cases from matrices stored in lists
Hi, I have two lists (c and h - see below) containing matrices with similar cases but different values. I want to split these matrices into multiple matrices based on the values in h. So, I did the following: years<-c(1997:1999) for (t in 1:length(years)) { year=as.character(years[t]) h[[year]]<-sapply(colnames(h[[year]]), function(var)
2011 Apr 29
4
For loop and sqldf
Hi list, Can anyone tell my why the following does not work? Thanks a lot! Your help is very much appreciated. DF = data.frame(read.table(textConnection(" B C D E F G 8025 1995 0 4 1 2 8025 1997 1 1 3 4 8026 1995 0 7 0 0 8026 1996 1 2 3 0 8026 1997 1 2 3 1 8026 1998 6 0 0 4 8026 1999 3 7 0 3 8027 1997 1 2 3 9 8027 1998 1 2 3 1 8027 1999
2011 Apr 14
1
Create matrices for time series
Hi list, I would like to use the following data.frame to generate matrices over a 3 year moving window: DF = data.frame(read.table(textConnection(" A B C 80 8025 1995 80 8026 1995 80 8029 1995 81 8026 1996 82 8025 1997 82 8026 1997 83 8025 1997 83 8027 1997 84 8026 1999 84 8027 1999 85 8028 1995 85 8029 1998"),head=TRUE,stringsAsFactors=FALSE)) Function to be
2011 Jun 14
1
Multiply list objects
Hi, I am trying to use the objects from the list below to create more objects. For each year in h I am trying to create as many objects as there are B's keeping only the values of B. Example for 1999: $`1999`$`8025` B B 8025 8026 8027 8028 8029 8025 1 1 1 0 0 8026 1 0 0 0 0 8027 1 0 0 0 0 8028 0 0 0 0 0 8029
2011 May 26
1
Divide matrix into multiple smaller matrices
Hi list, Using the script below, I have generated two lists (c and h) containing yearly matrices. Now I would like to divide the matrices in c into multiple matrices based on h. The number of matrices should be equal to: length(unique(DF1$B))*length(h). So each unique value in DF1$B get's a yearly matrix. Each matrix should contain all values from c where element cij is 1. An example for
2020 Oct 06
2
Version controlled (git) Maildir generated by Dovecot
Hi Everybody, I'd like to start archiving e-mails by moving them to a server with running Dovecot. I installed "dovecot-core" and "dovecot-imapd" (version 2.3.4.1) on Debian 10. One of a few configurations I made is to use Maildir: # grep '^mail_location = ' /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Maildir I successfully moved some e-mails (at
2003 Feb 06
4
Lost writes upon disk power failure
Hi, I'm encountering a strange situation. I'm writing to an ext3 filesystem mounted like this: /dev/scsi/host2/bus0/target0/lun0/part3 on /tmp/volumes/md0 type ext3 (rw,noatime,data=ordered) with the physical device being a FC-connected RAID (IBM DF4000) no software raid personality is used I'm using 2.4.18-19.7 My test program writes files in a loop, with the essential system
2012 Nov 01
7
Reduce(paste, x) question
I have a question about the Reduce function: x <- list() x[[1]] <- LETTERS[1:5] x[[2]] <- LETTERS[11:15] Reduce(paste, x) [1] "A K" "B L" "C M" "D N" "E O" How do I get this?: [1] "A" "K" [2] "B" "L" [3] "C" "M" [4] "D" "N" [5] "E" "O"
2012 Mar 14
4
Merging fully overlapping groups
Hi, I have data on individuals (B) who participated in events (A). If ALL participants in an event are a subset of the participants in another event I would like to remove the smaller event and if the participants in one event are exactly similar to the participants in another event I would like to remove one of the events (I don't care which one). The following example does that however it
2020 Oct 07
0
Version controlled (git) Maildir generated by Dovecot
Hello Adam, and the dovecot list Just a question, I hate to pollute the thread, so feel free to push these questions into a new thread if deemed necessary. So as you can guess I'm a bit of a newb here, so rather obvious questions are about to arrive.... As you are using GIT for your archive (which is a cool idea by the way) I'm sure you are well aware that not all files types play nicely
2012 Jul 16
2
Finding and manipulation clusters of numbers in a sequence of numbers
Hi, I have the following sequence: in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2) >From this sequence I would like to get to the following sequence: out <- c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 2, 0, 2, 0, 0, 2) Basically,
2012 Jul 06
2
Maximum number of patterns and speed in grep
Hi, I am using R's grep function to find patterns in vectors of strings. The number of patterns I would like to match is 7,700 (of different sizes). I noticed that I get an error message when I do the following: data <- array() for (j in 1:length(x)) { array[j] <- length(grep(paste(patterns[1:7700], collapse = "|"), x[j], value = T)) } When I break this up into 4 chunks of
2005 Oct 01
2
imq + htb
Hi, i am running imq + htb on my router , the situation is like this eth0 = uplink to my provider eth1 = 1st customer eth2 = 2nd customer eth3 = 3th customer eth0 has limit 512 and i want to share this between eth1 eth2 and eth3 , but not working , this is the script i used, \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #!/bin/sh
2012 Jan 24
4
Select elements from text
Hi, I have a series of MS word files and each file contains plain text. From these texts I would like to extract only those elements (read: words) that are between square brackets. Example of a text: Most fundamentally, it has led to an effort to clarify the organizational form concept. According to them [see also Smith, Jones and Carroll 2002], categories emerge as audience members recognize
2008 Apr 22
3
[PATCH 0/3] ia64/pv_ops preparation
Hi. This patchset is preparation patches for ia64/pv_ops support. They are almost trivial and mainly make kernel paravirtualization friendly. thanks, Diffstat: arch/ia64/kernel/irq_ia64.c | 1 - include/asm-ia64/intrinsics.h | 11 +++++++++++ include/asm-ia64/mmu_context.h | 6 +----- include/asm-ia64/smp.h | 2 ++ include/asm-ia64/system.h | 10 ++++++++-- 5 files
2010 Apr 08
1
Linksys/Sipura SPA-3201 FXO/FSA with Asterisk
All, I am looking at a little support on this, as I haven't found it on google yet. I have had this work on Callweaver, but am moving to Asterisk for a variety of reasons. My dial plans, and everything else transferred perfectly, though I am not sure they are 'correct' for Asterisk 1.6.1, with simple things like SIP users outlined in the sip.conf file, not in the users file,
2007 Oct 24
28
random cpu spikes, EBADF errors
In May I had problem with mongrels suddenly consuming huge cpu resources for a minute or two and then returning to normal (load average spikes up to 3.8and then back down to a regular 0.2 over the course of 5 minutes, then again 1/2 hour later. or 4 hours later, no predictable rhythm). I posted to Litespeed forums because I thought the problem was there but didn''t get far. And a week
2010 Apr 29
2
Code in extensions.conf to leave a voice mail in another PBX ?!
Hi Guys, i spent some time to figure this out (since i love how dialplan is written) but i decided to ask for your help guys. i have two asterisk servers one is 1.2 the other is 1.4, from 1.4 (pbx1) to 1.2 (pbx2) i can leave a voice mail without any pb, but from pbx2 to pbx1 it just hang up. in pbx2 extensions.conf: i am using: exten => 8029,1,Dial(IAX2/pbx1/${EXTEN},20,tTWwr) in pbx1, i