tibble could refer to an R class (tbl_df class), which is an improved data frame with stricter checking and better formatting. tibble could also refer to an R package providing functions to create and manipulate a tibble.
Questions tagged [tibble]
1309 questions
0
votes
2 answers
Collapsing ranked information into single column
I have a survey where people rank some schools. The survey results in multiple columns with 1s and 2s. I need to colapse these into a persons first and second choice.
Here is an exampe of the data that I have.
df1 <- tibble(Person = c(1 , 2 , 3 ,…

Robert Carlisle
- 15
- 4
0
votes
1 answer
How to execute sum if selection returns no element in R?
I have an if loop over multiple data.frame-s. I subset the data based on one of the variables and sum the entries based on another variable. My problem is that the selection sometimes returns a zero element tibble and so the sum function throws an…

Enoana
- 55
- 2
- 6
0
votes
0 answers
how to import tibble in a package
So I have a function that creates a tibble from a couple of vectors. It works fine but when I try to run devtools::check() to check my package I get the following errors:
If I put no @importFrom statement and just a Depends for tidyverse I get the…

Sebastian Zeki
- 6,690
- 11
- 60
- 125
0
votes
0 answers
R: lapply and tibble not working as expected in two loop
I have a set of code that loops through all possible scenarios that I use for a drilldown feature in my shiny application. However, the Level_3_Drilldowns isn't working as expected as I am not getting my defined tibble names.
Below is a single…

Kevin
- 1,974
- 1
- 19
- 51
0
votes
0 answers
as_tibble.matrix() failures at tibble 2.0.1
I have the following tibble and I get a warning below. I have tried the .name_repair options but it steel gives a warning.
Please advise.
> as_tibble(diag(3), validate = TRUE)
`as_tibble.matrix()` requires a matrix with column names or a…

SteveS
- 3,789
- 5
- 30
- 64
0
votes
1 answer
Percentage of Duration of deactivation in R
I want to compute the percentage of the durations a system is deactivated.
The activation is given in a column "Active" where 1 means Activation and 0 means deactivation. The observations (rows) correspond to different readings from different…

MarGa
- 711
- 3
- 10
- 23
0
votes
1 answer
get frequency based on two columns
A snippet of my large dataframe that looks this way :
MARKERS.IN.HAPLOTYPES BASE rs. alleles chrom pos GID marker trial
1A.12 C S1A_494392059 C/G 1A 494392059 GID7173723 2 ES26-38
…

moth
- 1,833
- 12
- 29
0
votes
0 answers
Dplyr's filter function doesn't work after Re-installation of R (3.5.2)
Due to some bug, I had to re-install R and R-studio.
I noticed that after the re-installation, some scripts that were running fine previously don't work anymore.
For example:
d1 <- tibble(Age = sample(seq(100, 200), 50))
(tibble: because apparently…

Omry Atia
- 2,411
- 2
- 14
- 27
0
votes
0 answers
Is it possible to have expressions in dplyr tibbles?
I'm using dplyr, kabble, and kableextra to create some tables in R. I'm converting the tibble outputs from dpylr chains for tables in a report. I'd like to have the rank included as a column in a tibble that I then pipe into a kabble table. Is there…

elliot
- 1,844
- 16
- 45
0
votes
2 answers
Hour/minute adds one hour from datetime with lubridate
I would like to extract the hour/minute/second from a datetime. Example dataframe:
df <- structure(list(Study_date_time_PACS = structure(c(1515146548, 1515146548, 1514970658, 1514970658, 1515151732, 1515151732, 1517476589, 1517476589, 1543848246,…

xhr489
- 1,957
- 13
- 39
0
votes
2 answers
Distinct in dplyr does not work (sometimes)
I have the following data frame which I have obtained from a count. I have used dput to make the data frame available and then edited the data frame so there is a duplicate of A.
df <- structure(list(Procedure = structure(c(4L, 1L, 2L, 3L), .Label…

xhr489
- 1,957
- 13
- 39
0
votes
1 answer
How to randomly generate observations for a tibble while respecting existing columns types?
Assume I have an empty tibble my_tbl (0 rows) but whose column types are given. For example:
library(tibble)
library(lubridate)
my_tbl <- tibble(
x = integer(),
y = character(),
w = ymd(),
z = list()
)
How to randomly populate my_tbl…

Ramiro Magno
- 3,085
- 15
- 30
0
votes
1 answer
Mutate on nested column to results in unsupported class (data.frame)
I currently have a motif search working in a series of for loops and would like to move to a nested tibble to improve speed and simplicity (ish). However, I cannot figure out how to store a tibble within a tibble so I can then unnest it. If that's…

GenesRus
- 1,057
- 6
- 16
0
votes
1 answer
ifelse changes the results of Jacquard calculated column?
Here is my df:
df <- structure(list(keysData_userId = c("28875270", "28875270", "28875270",
"28875270", "02745556", "02745556"), userData_ssids = list(list(
"pw+eOP8BWvqpqwqsq+4uEw==", "2vqQgSqaNZzVefr57EAFnA==", "DIIwsI+SsRtz38608KdyIQ==",
…

SteveS
- 3,789
- 5
- 30
- 64
0
votes
1 answer
How to fix the use of 'nest' to cause a list of list column?
I'm working with a base data frame which contains some information, this information it is used to generate a new column which is a data frame.
I have tried to use the map2 function but the results are not good, the closer results to what I expect…

Roga Lu
- 162
- 1
- 3
- 14