Displaying 15 results from an estimated 15 matches for "b_flag".
Did you mean:
f_flag
2017 Nov 22
6
assign NA to rows by test on multiple columns of a data frame
Given this data frame (a simplified, essential reproducible example)
A<-c(8,7,10,1,5)
A_flag<-c(10,0,1,0,2)
B<-c(5,6,2,1,0)
B_flag<-c(12,9,0,5,0)
mydf<-data.frame(A, A_flag, B, B_flag)
# this is my initial df
mydf
I want to get to this final situation
i<-which(mydf$A_flag==0)
mydf$A[i]<-NA
ii<-which(mydf$B_flag==0)
mydf$B[ii]<-NA
# this is my final df
mydf
By conside...
2017 Nov 22
0
assign NA to rows by test on multiple columns of a data frame
Do you mean like this:
mydf <- within(mydf, {
is.na(A)<- !A_flag
is.na(B)<- !B_flag
}
)
> mydf
A A_flag B B_flag
1 8 10 5 12
2 NA 0 6 9
3 10 1 NA 0
4 NA 0 1 5
5 5 2 NA 0
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
--...
2017 Nov 23
1
assign NA to rows by test on multiple columns of a data frame
...arpa.veneto.it>
Cc: "r-help" <r-help at r-project.org>
Inviato: Mercoled?, 22 novembre 2017 17:32:33
Oggetto: Re: [R] assign NA to rows by test on multiple columns of a data frame
Do you mean like this:
mydf <- within(mydf, {
is.na(A)<- !A_flag
is.na(B)<- !B_flag
}
)
> mydf
A A_flag B B_flag
1 8 10 5 12
2 NA 0 6 9
3 10 1 NA 0
4 NA 0 1 5
5 5 2 NA 0
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
--...
2017 Nov 22
1
assign NA to rows by test on multiple columns of a data frame
...e 2017 11:49:08
Oggetto: Re: [R] assign NA to rows by test on multiple columns of a data frame
Hello,
Try the following.
icol <- which(grepl("flag", names(mydf)))
mydf[icol] <- lapply(mydf[icol], function(x){
is.na(x) <- x == 0
x
})
mydf
# A A_flag B B_flag
#1 8 10 5 12
#2 7 NA 6 9
#3 10 1 2 NA
#4 1 NA 1 5
#5 5 2 0 NA
Hope this helps,
Rui Barradas
On 11/22/2017 10:34 AM, Massimo Bressan wrote:
>
>
> Given this data frame (a simplified, essential reproducible example)
>
>
>
>...
2017 Nov 22
0
assign NA to rows by test on multiple columns of a data frame
Hello,
Try the following.
icol <- which(grepl("flag", names(mydf)))
mydf[icol] <- lapply(mydf[icol], function(x){
is.na(x) <- x == 0
x
})
mydf
# A A_flag B B_flag
#1 8 10 5 12
#2 7 NA 6 9
#3 10 1 2 NA
#4 1 NA 1 5
#5 5 2 0 NA
Hope this helps,
Rui Barradas
On 11/22/2017 10:34 AM, Massimo Bressan wrote:
>
>
> Given this data frame (a simplified, essential reproducible example)
>
>
>
>...
2017 Nov 22
1
assign NA to rows by test on multiple columns of a data frame
...ressan at arpa.veneto.it> wrote:
>
>>
>>
>> Given this data frame (a simplified, essential reproducible example)
>>
>>
>>
>>
>> A<-c(8,7,10,1,5)
>>
>> A_flag<-c(10,0,1,0,2)
>>
>> B<-c(5,6,2,1,0)
>>
>> B_flag<-c(12,9,0,5,0)
>>
>>
>>
>>
>> mydf<-data.frame(A, A_flag, B, B_flag)
>>
>>
>>
>>
>> # this is my initial df
>>
>> mydf
>>
>>
>>
>>
>> I want to get to this final situation
>>
>>
&...
2017 Nov 22
0
assign NA to rows by test on multiple columns of a data frame
...Wed, Nov 22, 2017 at 5:34 AM, Massimo Bressan <
massimo.bressan at arpa.veneto.it> wrote:
>
>
> Given this data frame (a simplified, essential reproducible example)
>
>
>
>
> A<-c(8,7,10,1,5)
>
> A_flag<-c(10,0,1,0,2)
>
> B<-c(5,6,2,1,0)
>
> B_flag<-c(12,9,0,5,0)
>
>
>
>
> mydf<-data.frame(A, A_flag, B, B_flag)
>
>
>
>
> # this is my initial df
>
> mydf
>
>
>
>
> I want to get to this final situation
>
>
>
>
> i<-which(mydf$A_flag==0)
>
> mydf$A[i]<-NA
>
&g...
2008 Dec 01
7
DIF content is invalid?
...t;b_blkno,
self->size]/
{
this->elapsed = timestamp - start[self->pid, self->name,
args[0]->b_edev, args[0]->b_blkno, self->size];
printf("%5u %10s %58s %2s %8u %8u %3d.%03d\n", self->pid,
args[1]->dev_statname,
self->name, args[0]->b_flags & B_READ ? "R" : "W",
args[0]->b_bcount, self->size,
this->elapsed / 1000000, (this->elapsed / 1000) % 1000);
start[self->pid, self->name, args[0]->b_edev, args[0]->b_blkno,
self->size] = 0;
self->pid = 0;
s...
2005 Sep 22
0
io provider and files in a forceddirectio mounted filesystem
...rget::_aiodone:return
{
self->doit = 0;
}
io:::start
/self->doit || execname == "oracle"/
{
block[args[2]->fi_pathname, args[0]->b_blkno ] = timestamp;
}
io:::done
/block[args[2]->fi_pathname, args[0]->b_blkno]/
{
self->action = (args[0]->b_flags & B_READ) ? "R" : "W";
@countem[args[1]->dev_pathname, args[2]->fi_pathname, self->action ] =
count();
@elapsed[args[1]->dev_pathname, args[2]->fi_pathname, self->action ] =
sum(timestamp - block[args[2]->fi_pathname, args[0]->b_blk...
2008 Dec 21
0
Profiling a recoll stress-test
...com/software/solaris/howtoguides/dtracehowto.jsp#3
#!/usr/sbin/dtrace -qs
BEGIN
{
printf("%10s %58s %2s\n", "DEVICE", "FILE", "RW");
}
io:::start
{
printf("%10s %58s %2s\n", args[1]->dev_statname, args[2]->fi_pathname,
args[0]->b_flags & B_READ ? "R" : "W");
}
#!/usr/sbin/dtrace -s
syscall::write:entry
{
@[ustack()]=count();
}
Do you know how I could proceed ?
Watching the size of the write ?
Thanks,
- Benjamin
--
This message posted from opensolaris.org
1999 Nov 19
0
How can I add a NT PDC to WINS tables?
...so clients on the SI domain can find the PCD via the WINS-server. Some
SI-clients are on another subnet.
I have tried adding this to lmhosts:
192.38.49.60 SI#1c
but namelist.debug shows this entry
Subnet 192.38.49.33
----------------------
Name = SI<1c> Source = LMHOSTS_NAME
b_flags = 4 death_time = PERMANENT refresh_time = Fri Nov 19 15:04:23 1999
number of IPS = 1 192.38.49.60
but nothing for the other subnets I have.
Using nmblookup I do not get an answer through the x.y.z interface:
~> nmblookup 'SI#1c'
querying SI on x.y.z.255...
2011 May 03
8
Is it possible for the ext4/btrfs file system to pass some context related info to low level block driver?
Currently, some new storage devices have the ability to do performance optimizations according to the type of data payload - say, file system metadata, time-stamps, sequential write in some granularity, random write and so on.
For example, the latest eMMC 4.5 device can support the so-called ''Context Management'' and ''Data Tag Mechanism'' features. By receiving
2008 Jan 18
33
LatencyTop
I see Intel has released a new tool. Oh, it requires some patches to
the kernel to record
latency times. Good thing people don''t mind patching their kernels, eh?
So who can write the equivalent latencytop.d the fastest? ;-)
http://www.latencytop.org/
--
cburgess at qnx.com
2003 Apr 11
14
PATCH: Forcible delaying of UFS (soft)updates
...hu Jan 30 08:19:59 2003
+++ dev/ata/ata-disk.c Sat Apr 12 00:31:26 2003
@@ -294,6 +294,7 @@ adstrategy(struct buf *bp)
struct ad_softc *adp = bp->b_dev->si_drv1;
int s;
+ stratcalls++;
if (adp->device->flags & ATA_D_DETACHING) {
bp->b_error = ENXIO;
bp->b_flags |= B_ERROR;
--- /usr/src/sys.org/kern/vfs_subr.c Sun Oct 13 18:19:12 2002
+++ kern/vfs_subr.c Sat Apr 12 01:56:16 2003
@@ -116,6 +116,10 @@ SYSCTL_INT(_vfs, OID_AUTO, reassignbufme
static int nameileafonly = 0;
SYSCTL_INT(_vfs, OID_AUTO, nameileafonly, CTLFLAG_RW, &nameileafonly, 0, "&q...
1999 Nov 21
3
SAMBA digest 2314
...INS-server. Some
> SI-clients are on another subnet.
>
> I have tried adding this to lmhosts:
> 192.38.49.60 SI#1c
>
> but namelist.debug shows this entry
>
> Subnet 192.38.49.33
> ----------------------
> Name = SI<1c> Source = LMHOSTS_NAME
> b_flags = 4 death_time = PERMANENT refresh_time = Fri Nov 19 15:04:23 1999
>
> number of IPS = 1 192.38.49.60
>
> but nothing for the other subnets I have.
>
> Using nmblookup I do not get an answer through the x.y.z interface:
>
> ~> nmblookup &...