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
1 answer
Need little help converting a htmltab to a tibble
Trying to help out a friend with data munging a Miami Dolphins football schedule into a tibble
library(htmltab)
library(tidyr)
library(tibble)
url <- "http://www.espn.com/nfl/team/schedule/_/name/mia"
data <- htmltab(doc = url, which = 1, header =…

Isaiah
- 1
- 1
0
votes
1 answer
Simulate many datasets in tidyr
I want to end up with a tidy data structure like the one below:
N | r | data | stat
---------------------------------
10 | 0.2 | | 0.5
20 | 0.3 | | 0.86
...
data is generated from the parameters in the first…

Jonas Lindeløv
- 5,442
- 6
- 31
- 54
0
votes
0 answers
Using tidyr::unite on a database
I am trying to use the tidyr::unite function on a tibble from a SQLite query. I get the following error:
Error in UseMethod("unite_") :
no applicable method for 'unite_' applied to an object of class "c('tbl_dbi', 'tbl_sql', 'tbl_lazy',…
0
votes
1 answer
Create tibble from list elements in R
So I have this list of lists and inside each list I have elements that are vectors of equal lengths and a single value in one element. I want to create a tibble of the vectors and store the tibble in the list of lists.
>…

Simon
- 25
- 4
0
votes
0 answers
Date format changes while using levels in R
I have an df in r which is like the following :
# A tibble: 70 x 2
value Month_considered
dbl>
24.8 Apr 2017
47.0 Apr 2017
35.2 Apr 2017
19.4 Apr 2017
30.9 Apr 2017
6.64 Apr 2017 …

SNT
- 1,283
- 3
- 32
- 78
0
votes
1 answer
Iterating over values in character vector with dplyr functions
I have several variables (id.type and id.subtype in this example) I would like to check for distinct values in a tibble all.snags using the dplyr package. I would like them sorted and all values printed out in the console (a tibble typically prints…

GForce
- 153
- 2
- 9
0
votes
2 answers
How to convert xml2::xml_find_all() element into tibble format
I have the following code:
library(tidyverse)
library(xml2)
xmlfile <- paste0("https://www.uniprot.org/uniprot/Q9NSI8.xml")
xml_doc <- read_xml(xmlfile)
xml_find_all(xml_doc, "//d1:reference")
#> {xml_nodeset (12)}
#> [1] \n …

littleworth
- 4,781
- 6
- 42
- 76
0
votes
1 answer
Printing a single tibble row over multiple lines of text
It is sometimes desirable to print a string in a tibble over multiple lines. Example: https://github.com/ropensci/drake/issues/489. drake plans with long commands are hard to read.
library(drake)
pkgconfig::set_config("drake::strings_in_dots" =…

landau
- 5,636
- 1
- 22
- 50
0
votes
1 answer
Change all array columns of a data.frame into lists
I use dplyr, which requires that all dataframe or tibble columns be 1d atomic vectors or lists. But sometimes I have data frames with numeric array columns, like this:
d<- data.frame(x=c(1,2,3,4))
y= matrix(c(1,2,3, 11,12,13, 20,21,22, 23,24,25)…

Alex Holcombe
- 2,453
- 4
- 24
- 34
0
votes
1 answer
Converting a Cosine Similarity Matrix to JSON in R
I have a Cosine similarity matrix (csm), which looks like this:
csm<-matrix( c(1,0,0.4,0.6, 0,0,1, 0.1,0.4,0.7,0.4,0.1,1,0.9,0.5,0.6,0.4,0.9,1,0.6,0,0.7,0.5,0.6,1),nrow=5,ncol=5)
rownames(csm) <- c("AAB","AAC","AAD","AAE","AAF")
colnames(csm) <-…

road
- 479
- 3
- 20
0
votes
0 answers
Use expand.grid/crossing() to find combinations of single values and vectors, without separating the vector by elements?
I am trying to create a data frame using the expand.grid to find all possible combinations of two variables with numeric values and two vectors. However, I don't want the vectors to be split into their individual elements during the combination…

Marissa Hegy
- 11
- 1
0
votes
1 answer
R: How to get the levels from a tibble column
The overall goal:
I have a tibble with a column of country names, a column that contains either the characters "Military" or "Economic", and a column of numbers (that were imported as characters). I need to aggregate the military spending for each…

Addem
- 3,635
- 3
- 35
- 58
0
votes
0 answers
Error loading library (ggplot2) & (tibble) & (tidyverse) in R
I was trying to load the following and retrieved this error. I also tried loading tibble since the error messages references it but have a similar error message. I have tried installing the packages and uninstalling as well to no conclusion. Any…

BobbyK
- 1
- 2
0
votes
0 answers
What is different about tibbles and data.frames after a group_by statement
If I take a tibble and try to sample it, it works fine,
dft <- tibble(a=rnorm(200),b=seq.int(1,200),c=sample(LETTERS[1:26],200,replace = T))
sample_frac(dft,.5)
# A tibble: 100 x 3
a b c
1 -0.233 58 S
2 …

Kevin Mc
- 477
- 4
- 14
0
votes
1 answer
Convert NaN to NA in a tibble
I have used the readr package to import a .csv (let's call it x) which produced a tibble.
EDIT: As there was confusion between the actual tibble generated by readr and the problems(x)-tibble posted below, here is the beginning of the actual tibble…

Dom42
- 147
- 11