Displaying 20 results from an estimated 20 matches for "as_tibbl".
Did you mean:
as_tibble
2023 Oct 17
1
transform a list of arrays to tibble
...e will not be supporting row names and you may want to simply save those names in an additional column or externally.
My first thought was to simply save the names you need and then put them back on the tibble. In your code, something like this:
save.names <- names(my.ret.lst)
result.tib <- as_tibble_col(unlist(my.ret.lst), column_name = 'return')
rownames(result.tib) <- save.names
Unfortunately, I got an error message:
> save.names
[1] "BTCUSDT" "ETHUSDT" "TRXUSDT"
> rownames(result.tib) <- save.names
Warning message:
Setting row names on a...
2023 Oct 17
1
transform a list of arrays to tibble
...uot;Annualized Return", NULL)), TRXUSDT =
structure(10.9, dim = c(1L,
1L), dimnames = list("Annualized Return", NULL)))
Now I can't find how to build a tibble in a specific format (asset
names as row names and observations as column names) .
I can of course run:
> mytb <- as_tibble(unlist(my.ret.lst)
but I loose row and column names.
> as_tibble_col(unlist(my.ret.lst), column_name = 'return')
will give me the wanted column name but row names (in my case asset
names) are missing.
Thank you for help
2017 Nov 08
2
Ggplot error
...2.41-3 yaml_2.1.14
[66] colorspace_1.3-2 rvest_0.3.2 bindr_0.1 haven_1.1.0
> conflicts(detail = TRUE)
$.GlobalEnv
[1] "iris"
$`package:dplyr`
[1] "%>%" "%>%" "add_row" "as_data_frame"
"as_tibble" "data_frame"
[7] "data_frame_" "frame_data" "glimpse" "lst"
"lst_" "tbl_sum"
[13] "tibble" "tribble" "trunc_mat" "type_sum"
"filter&qu...
2017 Nov 08
0
Ggplot error
...2 rvest_0.3.2 bindr_0.1 haven_1.1.0
>
>
> > conflicts(detail = TRUE)
> $.GlobalEnv
> [1] "iris"
>
> $`package:dplyr`
> [1] "%>%" "%>%" "add_row" "as_data_frame"
> "as_tibble" "data_frame"
> [7] "data_frame_" "frame_data" "glimpse" "lst"
> "lst_" "tbl_sum"
> [13] "tibble" "tribble" "trunc_mat" "type_sum"...
2017 Aug 07
1
tidyquant error downloading symbols for Index
...e, base
filter(): dplyr, stats
first(): dplyr, xts
intersect(): lubridate, base
lag(): dplyr, stats
last(): dplyr, xts
setdiff(): lubridate, base
union(): lubridate, base
Attaching package: ?tidyquant?
The following object is masked from ?package:dplyr?:
as_tibble
The following object is masked from ?package:tibble?:
as_tibble
There were 14 warnings (use warnings() to see them)
> tq_index_options()
[1] "RUSSELL1000" "RUSSELL2000" "RUSSELL3000" "DOW" "DOWGLOBAL"
[6] "SP400" &...
2017 Nov 08
1
Ggplot error
...1.3-2? rvest_0.3.2? ? ? ? bindr_0.1? ? ? ? ? haven_1.1.0
>
>
> > conflicts(detail = TRUE)
> $.GlobalEnv
> [1] "iris"
>
> $`package:dplyr`
>? [1] "%>%"? ? ? ? ? "%>%"? ? ? ? ? "add_row"? ? ? "as_data_frame"
> "as_tibble"? ? "data_frame"
>? [7] "data_frame_"? "frame_data"? ? "glimpse"? ? ? "lst"
>? "lst_"? ? ? ? ? "tbl_sum"
> [13] "tibble"? ? ? ? "tribble"? ? ? "trunc_mat"? ? "type_sum"
>...
2020 Nov 21
3
Error in unsplit() with tibbles
Hello,
using the `unsplit()` function with tibbles currently leads to the
following error:
> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
> s <- split(mtcars_tb, mtcars_tb$gear)
> unsplit(s, mtcars_tb$gear)
Error: Must subset rows with a valid subscript vector.
? Logical subscripts must match the size of the indexed input.
x Input has size 15 but subscript `rep(NA, len)` has size 32.
Run `rlang::la...
2017 Nov 28
2
dplyr - add/expand rows
...$record)
>> )
>>
>> ###########################
>>
>
> In a bit more 'base R' mode I did
>
> input$year <- with(input, Map(seq, from, to))
> res0 <- with(input, Map(data.frame, station=station, year=year,
> record=record))
> as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
>
> resulting in
>
> > as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
> station year record
> <fctr> <int> <fctr>
> 1 07EA001 1960 QMS
> 2 07EA001 1961 QMC
> 3 07EA001 196...
2017 Nov 29
0
dplyr - add/expand rows
...sFactors = FALSE)
stations <- rle(d_df$station)
stations$value <- gsub(
" ", "0",
paste0("station", format(1:length(stations$value), width = 6)))
d_df$station <- rep(stations$value, stations$lengths)
## prepare tibble and data.table versions
d_tbl <- as_tibble(d_df)
d_dt <- as.data.table(d_df)
## solutions ##########################
## Bert - by
fun_bert <- function(d) {
out <- by(
d, d$station, function(x) with(x, {
i <- to - from +1
data.frame(record =rep(record,i),
year =sequence(i) -1 + rep(from,...
2017 Nov 08
0
Ggplot error
...1.3-2 rvest_0.3.2 bindr_0.1 haven_1.1.0
>
>
> > conflicts(detail = TRUE)
> $.GlobalEnv
> [1] "iris"
>
> $`package:dplyr`
> [1] "%>%" "%>%" "add_row" "as_data_frame"
> "as_tibble" "data_frame"
> [7] "data_frame_" "frame_data" "glimpse" "lst"
> "lst_" "tbl_sum"
> [13] "tibble" "tribble" "trunc_mat" "type_sum"
>...
2017 Nov 29
2
dplyr - add/expand rows
...e(d_df$station)
> stations$value <- gsub(
> ? " ", "0",
> ? paste0("station", format(1:length(stations$value), width = 6)))
> d_df$station <- rep(stations$value, stations$lengths)
>
> ## prepare tibble and data.table versions
> d_tbl <- as_tibble(d_df)
> d_dt <- as.data.table(d_df)
>
> ## solutions ##########################
>
> ## Bert - by
> fun_bert <- function(d) {
> ? out <- by(
> ??? d, d$station, function(x) with(x, {
> ????? i <- to - from +1
> ????? data.frame(record =rep(record,i),...
2017 Nov 28
0
dplyr - add/expand rows
...= seq(.$from, .$to),
> record = .$record)
> )
>
> ###########################
In a bit more 'base R' mode I did
input$year <- with(input, Map(seq, from, to))
res0 <- with(input, Map(data.frame, station=station, year=year,
record=record))
as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
resulting in
> as_tibble(do.call(rbind, unname(res0)))# A tibble: 24 x 3
station year record
<fctr> <int> <fctr>
1 07EA001 1960 QMS
2 07EA001 1961 QMC
3 07EA001 1962 QMC
4 07EA001 1963 QMC
5...
2017 Nov 29
0
dplyr - add/expand rows
...ations$value <- gsub(
>> " ", "0",
>> paste0("station", format(1:length(stations$value), width = 6)))
>> d_df$station <- rep(stations$value, stations$lengths)
>>
>> ## prepare tibble and data.table versions
>> d_tbl <- as_tibble(d_df)
>> d_dt <- as.data.table(d_df)
>>
>> ## solutions ##########################
>>
>> ## Bert - by
>> fun_bert <- function(d) {
>> out <- by(
>> d, d$station, function(x) with(x, {
>> i <- to - from +1
>>...
2020 Nov 21
2
Error in unsplit() with tibbles
...ject.org> wrote:
>
>
>> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote:
>>
>> Hello,
>>
>> using the `unsplit()` function with tibbles currently leads to the
>> following error:
>>
>>> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
>>> s <- split(mtcars_tb, mtcars_tb$gear)
>>> unsplit(s, mtcars_tb$gear)
>> Error: Must subset rows with a valid subscript vector.
>> ? Logical subscripts must match the size of the indexed input.
>> x Input has size 15 but subscript...
2024 Jul 18
1
Printing digits.secs on data.frame?
...30 15:00:00.000 0.188 0.145 -0.984
#> 2 *2017-10-30 15:00:00.033* 0.180 0.125 -0.988
#> 3 2017-10-30 15:00:00.066 0.184 0.121 -0.984
#> 4 2017-10-30 15:00:00.099 0.184 0.121 -0.992
#> 5 2017-10-30 15:00:00.133 0.184 0.117 -0.988
#> 6 2017-10-30 15:00:00.166 0.184 0.125 -0.988
tibble::as_tibble(df)
#> # A tibble: 6 ? 4
#> time X Y Z
#> <dttm> <dbl> <dbl> <dbl>
#> 1 2017-10-30 15:00:00 0.188 0.145 -0.984
#> 2 *2017-10-30 15:00:00* 0.18 0.125 -0.988
#> 3 2017-10-30 15:00:00 0.184 0.121 -0.984
#> 4 2...
2017 Sep 14
1
Print All Warnings that Occurr in All Parallel Nodes
...--
## RODBC
## -----------------------------------------------------------------------------
## A) MariaDB Connection String
con <- odbcConnect("MariaDB_Tornado24")
invisible(sqlQuery(con, "USE dispoin;"))
# B) Import R Data Directories from MariaDB
DISPOIN_DIR_REL <- as_tibble(sqlFetch(con, "dispoin.t_DISPOIN_DIR_REL"))
odbcClose(con)
# C) Import Zipped CSV data into List of Dataframes, which latter on are compiled as a single dataframe by
# means of rbind
# C.1) parRapply Function Initialization:
parRaplly_Function <- function (DISPOIN_CSV_Row)...
2017 Nov 27
2
dplyr - add/expand rows
try this:
##########################################
library(dplyr)
input <- tribble(
~station, ~from, ~to, ~record,
"07EA001" , 1960 , 1960 , "QMS",
"07EA001" , 1961 , 1970 , "QMC",
"07EA001" , 1971 , 1971 , "QMM",
"07EA001" , 1972 , 1976 , "QMC",
"07EA001" , 1977 ,
2020 Nov 21
0
Error in unsplit() with tibbles
> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote:
>
> Hello,
>
> using the `unsplit()` function with tibbles currently leads to the
> following error:
>
>> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
>> s <- split(mtcars_tb, mtcars_tb$gear)
>> unsplit(s, mtcars_tb$gear)
> Error: Must subset rows with a valid subscript vector.
> ? Logical subscripts must match the size of the indexed input.
> x Input has size 15 but subscript `rep(NA, len)` has s...
2020 Nov 21
0
Error in unsplit() with tibbles
...gt; On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com>
> wrote:
> >>
> >> Hello,
> >>
> >> using the `unsplit()` function with tibbles currently leads to the
> >> following error:
> >>
> >>> mtcars_tb <- as_tibble(mtcars, rownames = NULL)
> >>> s <- split(mtcars_tb, mtcars_tb$gear)
> >>> unsplit(s, mtcars_tb$gear)
> >> Error: Must subset rows with a valid subscript vector.
> >> ? Logical subscripts must match the size of the indexed input.
> >> x Input h...
2017 Jul 10
1
Help documentation of "The Studentized range Distribution"
Well, it is clear enough that the problem is in interpreting the documentation. However, when you claim you tested something, and found it inconsistent with tables, it would be advisable to back it up with examples!
The description in the help files and in the sources is admittedly confusing. The original paper has this, rather more clear, description in the abstract:
"We consider the