Questions tagged [tibble]

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.

1309 questions
0
votes
1 answer

Error reading tibbles into the mi package with missing_data.frame command

I have encountered unexpected behaviour (at least, unexpected by me) when working with the brilliant mi package, for missing data imputation, and tibbles. Let's assume a tibble called B. The offending command is :- A <- missing_data.frame(B) The…
astaines
  • 872
  • 2
  • 9
  • 20
0
votes
2 answers

How to write a function with same interface as dplyr::filter but which is doing something different

I would like to implement a function which has the same interface as the filter method in dplyr but instead of removing the rows not matching to a condition would, for instance, return an array with an indicator variable, or attach such column to…
witek
  • 984
  • 1
  • 8
  • 25
0
votes
1 answer

Break apart uneven list into dataframes to use in ggplot2

I have a huge list of various tibbles that I outputted from running a for loop. The tibbles in this list are the result of using count() and group_by_(), and show the number of people by category a who do and do not work at various facilities, but…
jryan14ify
  • 105
  • 1
  • 5
0
votes
1 answer

Return a string by reference from tbl_df of numerics in R

I have a tbl_df (tibble) named 'control.scores' that has a column called "Overall", which is some value between 1.00 and 4.00. # A tibble: 2 x 8 group GOV CORC TMSC AUDIT PPS TRAIN Overall
Zach
  • 1,316
  • 2
  • 14
  • 21
0
votes
1 answer

R: get dataframe row with specific characters

I need to detect rows of a df/tibble containing a specific sequence of characters. seq <- "RT @AventusSystems" is my sequence df <- structure(list(text = c("@AventusSystems Wow, what a upgrade from help of investor", "RT @AventusSystems: A recent…
gabx
  • 472
  • 2
  • 7
  • 18
0
votes
1 answer

How to combine tibbles with common but non-identical columns?

I have two tibbles, each with up to 4 columns. Each column name will either be common to both or missing from one or the other. I need to combine these into one tibble with two rows, and NA in columns where they are missing. I need to do this…
cdmh
  • 3,294
  • 2
  • 26
  • 41
0
votes
1 answer

add_row with group_by nest tibble

I am trying to add_row() to grouped data without using do. library(dplyr) library(tidyr) library(purrr) library(tibble) my.data <- data.frame( supplier = c("a","a","a","a","a","a","b","b","b","b","b","b"), date =…
iboboboru
  • 1,112
  • 2
  • 10
  • 21
0
votes
1 answer

tibble table display issue when using R in jupyter notebook

I just started using R in Jupyter notebook. There seems to be some issue displaying tibble table. for example, mtcars Everything is normal. If mtcars is converted to tibble, car<-as_data_frame(mtcars) car The table displayed is totally…
zesla
  • 11,155
  • 16
  • 82
  • 147
0
votes
0 answers

Distinct creating keep_all column when dtplyr loaded

When I use distinct() with dtplyr, my data table is transformed into a tibble with a new column ".keep_all". I updated all the packages I'm using by running install.packages() and then update.packages(), just for good measure. I also updated…
DataSmith
  • 11
  • 3
0
votes
1 answer

Subset tibble based on column sums, while retaining character columns

I have a feeling this is a pretty stupid issue, but I haven't been able to find the solution either I have a tibble where each row is a sample and the first column is a character variable containing the sample ID and all subsequent columns are…
0
votes
2 answers

Issues trying to subset a tibble

This one should be an easy one but I cant figure out what I'm doing wrong. Probably something stupid... Sigh... SO here it goes, i have a large tibble from which I am trying to remove some observations. I have an index logical vector that I want to…
Mario Reyes
  • 385
  • 1
  • 2
  • 13
0
votes
1 answer

Strange behavior while counting NAs, NANs and Inf's

I wrote a small function that would count the number of NA, NaN an Inf in a tibble data frame as follows: check.for.missing.values <- function(df) { return( sum(is.na(as.matrix(df)) & !is.nan(as.matrix(df))) + #NAs …
Mario Reyes
  • 385
  • 1
  • 2
  • 13
0
votes
1 answer

Managing multiple models and run times in R

I'm building dozens of predictive models in an effort to identify a champion model. I'm working with gigabytes of data, so tracking run time is important. I'd like to build all my models in a list-type format, so I don't have to manage all the…
kputschko
  • 766
  • 1
  • 7
  • 21
0
votes
1 answer

How to apply a "complicated" user defined function on each element of a tibble

I have searched high and low for the answer to this (seemingly simple) problem, but came up empty so I hope someone can help me or point me in the right direction. I have a fairly complicated submodel that I want to apply to a dataset, but if I…
Sylvain
  • 47
  • 5
0
votes
1 answer

Performing a row by row chisq test on a data frame and capturing the result as a tibble

I have a data frame similar to this: df1 <- data.frame(c(31,3447,12,1966,39,3275), c(20,3460,10,1968,30,3284), c(334,3146,212,1766,338,2976), c(36,3442,35,1943,47,3267), …