Displaying 6 results from an estimated 6 matches for "rename_with".
2024 Jul 22
3
Extract
...ransform:
dat |>
transform(S = read.table(text = string,
header = FALSE, fill = TRUE, na.strings = "")) |>
list(x = _) |>
with( setNames(x, sub("\\.V", "", names(x))) )
dplyr. Alternately use dplyr in which case we can make use of
rename_with . In this case read.table(...) creates column names V1,
V2, etc. and mutate does not change them so simply replacing V with S
at the start of each column name in the output of read.table will do.
Also we can pipe the read.table output directly to rename_with using a
nested pipeline, i.e. the second...
2024 Jul 22
1
Extract
...ransform(S = read.table(text = string,
> header = FALSE, fill = TRUE, na.strings = "")) |>
> list(x = _) |>
> with( setNames(x, sub("\\.V", "", names(x))) )
>
> dplyr. Alternately use dplyr in which case we can make use of
> rename_with . In this case read.table(...) creates column names V1,
> V2, etc. and mutate does not change them so simply replacing V with S
> at the start of each column name in the output of read.table will do.
> Also we can pipe the read.table output directly to rename_with using a
> nested pipel...
2024 Jul 21
1
Extract
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$string |>
read.table( text = _, fill = TRUE, header = FALSE, na.strings = "") |>
(\(x)'names<-'(x,paste0("s", seq_along(x))))() |>
2024 Dec 12
1
Cores hang when calling mcapply
...quot;)))
}
keeptabs <- bind_rows(keeptabs)
out1 <- dcast(keeptabs, ID_Key ~ column1, fun.aggregate = length, value.var = "column1")
out2 <- dcast(keeptabs, ID_Key ~ column2, fun.aggregate = length, value.var = "column2")
out1 <- setDT(out1 |> rename_with(~ paste0("column1_name_", .x, recycle0 = TRUE), -ID_Key))
out2 <- setDT(out1 |> rename_with(~ paste0("column2_name_", .x, recycle0 = TRUE), -ID_Key))
all_cols <- unique(c(names(out1), names(out2)))
out1_missing <- setdiff(all_cols, names(out1))
out2_m...
2024 Dec 12
1
Cores hang when calling mcapply
...eeptabs <- bind_rows(keeptabs)
>
> ? ? out1 <- dcast(keeptabs, ID_Key ~ column1, fun.aggregate = length, value.var = "column1")
> ? ? out2 <- dcast(keeptabs, ID_Key ~ column2, fun.aggregate = length, value.var = "column2")
> ? ? out1 <- setDT(out1 |> rename_with(~ paste0("column1_name_", .x, recycle0 = TRUE), -ID_Key))
> ? ? out2 <- setDT(out1 |> rename_with(~ paste0("column2_name_", .x, recycle0 = TRUE), -ID_Key))
> ? ? all_cols <- unique(c(names(out1), names(out2)))
> ? ? out1_missing <- setdiff(all_cols, names(ou...
2024 Dec 11
1
Cores hang when calling mcapply
How is the server configured to handle memory distribution for individual users. I see it has over 700GB of total system memory, but how much can be assigned it each individual user?
AAgain - just curious, and wondering how much memory was assigned to your instance when you were running R.
regards,
Gregg
On Wednesday, December 11th, 2024 at 9:49 AM, Deramus, Thomas Patrick <tderamus at