1,381 questions
4 votes
4 answers
296 views
How to expand printing of tibble's nested data types (list columns)?
When printing a tibble, how do I print the cells with nested data types (in list columns)? Let's have a look at two examples: 1. call data type b <- tibble(a = 1, prior = list(call("rnorm"...
-1 votes
1 answer
132 views
Convert a flextable into a dataframe
After something like: library(tidyverse) df <- tibble(a=c(1,2,3), b=c(4,5,6)) tbl <- df %>% flextable::flextable() Is there a way to get back df from tbl?
1 vote
2 answers
133 views
Why does spec() return NULL after subsetting a tibble? (And how do I avoid that?)
After reading in my data using read_csv() from readr, the command spec() returns "full column specification" for the resulting tibble: > spec(steps) cols( duration = col_double(), ...
1 vote
0 answers
172 views
How can I globally print all data frames as tibbles in R?
I'm working with a variety of data frames across multiple projects. For better readability and a concise overview in the console, I prefer the tibble format, which shows only the first few rows along ...
1 vote
1 answer
43 views
Object missing or new axis labels made using ggpubr::stat_pvalue_manual on violin plot with fill aspect
I have ran into a problem with using ggpubr::stat_pvalue_manual with a ggplot2 violin plot that has a fill aspect. There is either an issue of the fill aspect group not being found as an object or the ...
2 votes
2 answers
85 views
merging irregular time ser
I want to merge multiple (>2) time series into a single object. For example, here are multiple time series (w missing data, incomplete, and irregular): library(tidyverse) library(zoo) set.seed(123)...
3 votes
5 answers
189 views
Convert a specific warning type into an error
Consider the following code: > df <- tibble(gender=c(1,1,0)) > df$male Warning: Unknown or uninitialised column: `male`. NULL How can I convert this specific warning type into an error? I ...
1 vote
2 answers
58 views
Reading large multi-part table from file and combing its parts into one tibble
I have this huge file (> 25 Mb) of the following structure: ITEM: TIMESTEP 0 ITEM: NUMBER OF ATOMS 14748 ITEM: BOX BOUNDS ss ss ss -1.3314357502021994e+02 1.1517122459132779e+02 -1....
0 votes
1 answer
80 views
Conditional coloring in the Flextable in R
I have tibble (data frame) in R called table_factors that at the end will be a flextable. I want to conditionally color the columns Results based on multiple and complex condition. For example the ...
0 votes
1 answer
131 views
Font color in flextable text
I have a tibble in R that has text (string) in the 3rd column that its cells has character and number.I want the number only to be colored but the text to remain black. Is that possible to do that in ...
1 vote
0 answers
68 views
Specify the column of types of only some variables when importing data with readxl::read_excel()
I have an Excel spreadsheet called "my_data". I can recreate the spreadsheet in R as follows: library(tibble); library(readxl) tibble(x = c(1L, 2L, 3L), y = c("A", "B", &...
0 votes
0 answers
38 views
Convert class sjmisc_descr to tibble
The sjmisc package provides summary stats. I need it to a column for each summary statistic to a tibble. But instead it does something strange and adds a single column and seemingly sub-columns within ...
3 votes
0 answers
44 views
How to merge rows based on set of conditions?
I'm working with IPUMS microdata that looks like the sample below. For every March case, I have one from the ASEC survey (ASECFLAG == 1) and one from the basic CPS survey (ASECFLAG == 2). Each unique ...
-1 votes
1 answer
64 views
Histograms from columns of a tibble: Why does this work for some columns and not others? [closed]
I have a tibble containing 24 columns, each with 107 observations. Each column is a variable describing the bone specimen in a CT image, and all values within the columns are type "double." ...
3 votes
1 answer
65 views
dplyr::group_by drops custom class
I am trying to implement a subclass of a tibble which comes with a custom printing method. I figured that dplyr::group_by silently drops my custom class with the effect that my S3 printing methods are ...