search for: 21,18

Displaying 20 results from an estimated 37 matches for "21,18".

2024 Jul 19
4
Extract
Hi All, I want to extract new variables from a string and add it to the dataframe. Sample data is csv file. dat<-read.csv(text="Year, Sex,string 2002,F,15 xc Ab 2003,F,14 2004,M,18 xb 25 35 21 2005,M,13 25 2006,M,14 ac 256 AV 35 2007,F,11",header=TRUE) The string column has a maximum of five variables. Some rows have all and others may not have all the five variables. If missing then fill it with NA, Desired result is shown below, Year,Sex,string, S1, S2, S3 S4,S5 2002,F,15 xc...
2024 Jul 19
1
Extract
...at 9:52?AM Val <valkremk at gmail.com> wrote: > > Hi All, > > I want to extract new variables from a string and add it to the dataframe. > Sample data is csv file. > > dat<-read.csv(text="Year, Sex,string > 2002,F,15 xc Ab > 2003,F,14 > 2004,M,18 xb 25 35 21 > 2005,M,13 25 > 2006,M,14 ac 256 AV 35 > 2007,F,11",header=TRUE) > > The string column has a maximum of five variables. Some rows have all > and others may not have all the five variables. If missing then fill > it with NA, > Desired result is shown below, > >...
2024 Jul 21
1
Extract
...t 12:52?PM Val <valkremk at gmail.com> wrote: > > Hi All, > > I want to extract new variables from a string and add it to the dataframe. > Sample data is csv file. > > dat<-read.csv(text="Year, Sex,string > 2002,F,15 xc Ab > 2003,F,14 > 2004,M,18 xb 25 35 21 > 2005,M,13 25 > 2006,M,14 ac 256 AV 35 > 2007,F,11",header=TRUE) > > The string column has a maximum of five variables. Some rows have all > and others may not have all the five variables. If missing then fill > it with NA, > Desired result is shown below, > >...
2024 Jul 21
1
Extract
...even simpler is to use the 'colnames' argument of read.table() for the column names no? string <- read.table(text = dat$string, fill = TRUE, header = FALSE, na.strings = "", col.names = paste0("s", 1:5)) dat <- cbind(dat, string) -- Bert On Sun, Jul 21, 2024 at 10:16?AM Gabor Grothendieck <ggrothendieck at gmail.com> wrote: > > We can use read.table for a base R solution > > string <- read.table(text = dat$string, fill = TRUE, header = FALSE, > na.strings = "") > names(string) <- paste0("S", seq_a...
2024 Jul 19
1
Extract
...: > > > > Hi All, > > > > I want to extract new variables from a string and add it to the dataframe. > > Sample data is csv file. > > > > dat<-read.csv(text="Year, Sex,string > > 2002,F,15 xc Ab > > 2003,F,14 > > 2004,M,18 xb 25 35 21 > > 2005,M,13 25 > > 2006,M,14 ac 256 AV 35 > > 2007,F,11",header=TRUE) > > > > The string column has a maximum of five variables. Some rows have all > > and others may not have all the five variables. If missing then fill > > it with NA, > > D...
2024 Jul 19
1
Extract
...at you asked for, but maybe I was confused somewhere. This approach puts string data into variables in order. In this approach one mixes string and numeric data. The string is not duplicated. library(tidyr) dat <- read.csv(text="Year,Sex,string 2002,F,15 xc Ab 2003,F,14 2004,M,18 xb 25 35 21 2005,M,13 25 2006,M,14 ac 256 AV 35 2007,F,11", header=TRUE, stringsAsFactors=FALSE) # split the 'string' column based on spaces dat_separated <- dat |> separate(string, into = paste0("S", 1:5), sep = " ", fill = "right", extra = "...
2024 Jul 21
1
Extract
Fixing col.names=paste0("S", 1:5) assumes that there will be 5 columns and we may not want to do that. If there are only 3 fields in string, at the most, we may wish to generate only 3 columns. On Sun, Jul 21, 2024 at 2:20?PM Bert Gunter <bgunter.4567 at gmail.com> wrote: > > Nice! -- Let read.table do the work of handling the NA's. > However, even simpler is to use the 'colnames' argument of > read.table() for the column names no? > > string <- read.table(te...
2024 Jul 19
1
Extract
...confused somewhere. This approach puts string data into variables in order. In this approach one mixes string and numeric data. The string is not duplicated. > > library(tidyr) > > dat <- read.csv(text="Year,Sex,string > 2002,F,15 xc Ab > 2003,F,14 > 2004,M,18 xb 25 35 21 > 2005,M,13 25 > 2006,M,14 ac 256 AV 35 > 2007,F,11", header=TRUE, stringsAsFactors=FALSE) > > # split the 'string' column based on spaces > dat_separated <- dat |> > separate(string, into = paste0("S", 1:5), sep = " ", > f...
2024 Jul 21
1
Extract
...s() |> _[4:8] <- paste0("s", 1:5) ## and here's the result: > dat Year Sex string s1 s2 s3 s4 s5 1 2002 F 15 xc Ab 15 xc Ab <NA> <NA> 2 2003 F 14 14 <NA> <NA> <NA> <NA> 3 2004 M 18 xb 25 35 21 18 xb 25 35 21 4 2005 M 13 25 13 25 <NA> <NA> <NA> 5 2006 M 14 ac 256 AV 35 14 ac 256 AV 35 6 2007 F 11 11 <NA> <NA> <NA> <NA> As I noted previously, all columns beyond Sex are character Cheers, Bert On Fri,...
2024 Jul 21
1
Extract
...t;s", 1:5) > > ## and here's the result: > > dat > Year Sex string s1 s2 s3 s4 s5 > 1 2002 F 15 xc Ab 15 xc Ab <NA> <NA> > 2 2003 F 14 14 <NA> <NA> <NA> <NA> > 3 2004 M 18 xb 25 35 21 18 xb 25 35 21 > 4 2005 M 13 25 13 25 <NA> <NA> <NA> > 5 2006 M 14 ac 256 AV 35 14 ac 256 AV 35 > 6 2007 F 11 11 <NA> <NA> <NA> <NA> > > As I noted previously, all columns beyond Sex are character...
2024 Jul 21
1
Extract
...es, it might certainly be improved. dat <- dat$string |> read.table( text = _, fill = TRUE, header = FALSE, na.strings = "") |> (\(x)'names<-'(x,paste0("s", seq_along(x))))() |> (\(x)cbind(dat, x))() -- Bert On Sun, Jul 21, 2024 at 11:30?AM Gabor Grothendieck <ggrothendieck at gmail.com> wrote: > > Fixing col.names=paste0("S", 1:5) assumes that there will be 5 columns and > we may not want to do that. If there are only 3 fields in string, at the most, > we may wish to generate only 3 colu...
2024 Jul 22
3
Extract
...e the S= that is needed with transform (although it allows it had we wanted it). library(dplyr) dat |> mutate(read.table(text = string, header = FALSE, fill = TRUE, na.strings = "") |> rename_with(~ sub("^V", "S", .x)) ) On Sun, Jul 21, 2024 at 3:08?PM Bert Gunter <bgunter.4567 at gmail.com> wrote: > > As always, good point. > Here's a piped version of your code for those who are pipe > afficianados. As I'm not very skilled with pipes, it might certainly > be improved. > dat <- > dat$st...
2016 Nov 02
0
[PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check
...@@ -310,6 +310,8 @@ struct pv_lock_ops { void (*wait)(u8 *ptr, u8 val); void (*kick)(int cpu); + + bool (*vcpu_is_preempted)(int cpu); }; /* This contains all the paravirt structures: we get a convenient diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 921bea7..0526f59 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -26,6 +26,14 @@ extern struct static_key paravirt_ticketlocks_enabled; static __always_inline bool static_key_false(struct static_key *key); +#ifdef CONFIG_PARAVIRT_SPINLOCKS +#define vcpu_is_pree...
2024 Jul 22
1
Extract
...allows it had we wanted it). > > library(dplyr) > > dat |> > mutate(read.table(text = string, > header = FALSE, fill = TRUE, na.strings = "") |> > rename_with(~ sub("^V", "S", .x)) > ) > > > On Sun, Jul 21, 2024 at 3:08?PM Bert Gunter <bgunter.4567 at gmail.com> wrote: > > > > As always, good point. > > Here's a piped version of your code for those who are pipe > > afficianados. As I'm not very skilled with pipes, it might certainly > > be improved. > &g...
2007 Apr 29
0
[983] branches/wxruby2/wxwidgets_282: Make Window#paint work both inside and outside a paint event handler,
...>+# Copyright 2004-2007 by Kevin Smith </ins><span class="cx"> # released under the MIT-style wxruby2 license </span><span class="cx"> </span><span class="cx"> class Wx::Window </span><span class="lines">@@ -21,4 +21,18 @@ </span><span class="cx"> def find_window_by_label(a_label) </span><span class="cx"> Wx:Window.find_window_by_label(a_label, self) </span><span class="cx"> end </span><ins>+ + alias :__old_evt_paint :e...
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...* have not been added to any released version so far. diff --git a/generator/states-newstyle-opt-meta-context.c b/generator/states-newstyle-opt-meta-context.c index 0dc48af..ce878ee 100644 --- a/generator/states-newstyle-opt-meta-context.c +++ b/generator/states-newstyle-opt-meta-context.c @@ -21,18 +21,28 @@ STATE_MACHINE { NEWSTYLE.OPT_META_CONTEXT.START: size_t i, nr_queries; - uint32_t len; + uint32_t len, opt; /* If the server doesn't support SRs then we must skip this group. * Also we skip the group if the client didn't request any metadata - * contexts. +...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things working for manual experimentation. Still to do: - write interop tests for qemu-nbd and nbdkit (including my proposed patch addition of qemu-nbd -A to show qemu:allocation-depth) - figure out if we can make 'nbdinfo --map' use the new API to automatically select all contexts advertised by the server Eric Blake
2014 May 20
14
Re: [PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
On Tuesday 20 May 2014 15:56:16 Richard W.M. Jones wrote: > On Tue, May 20, 2014 at 03:33:31PM +0200, Pino Toscano wrote: > > Resolve the given path within the chroot, so scrub can be invoked > > outside the chroot on an already-resolved path. > > Given that realpath is used, its availability is checked manually, > > since scrub-file already depends on the
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2020 Aug 13
15
[v2v PATCH 00/14] Adaptations to Weblate
We are migrating to Weblate (the Fedora instance, in particular) for translations instead of Zanata. Adapt our tooling a bit to the different workflow: - Weblate takes care of updating the po files whenever a new translation catalog is available, so stop doing that on our own: this meant also tweaking the po4a usage for POD documentations, resulting in simpler rules (IMHO) - ensure that the