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
-1
votes
1 answer

R not saving images programmatically

I am working with R+RStudio and I want to save for different files a ggplot but for each of those, a different filter so I want a plot per subtype I have available. This should be in my opinion something very easy, I know how to save files and I've…
user123
  • 175
  • 4
  • 16
-1
votes
1 answer

R: duplicate row values to new row in dplyr/tidyr

I have successfully added a new blank row 1 “24727.2” but I want to duplicate the values from columns 2:11 named 2009:2018 in row [5] “state=24727” to row 1. Then I want to change the values for columns less than 2016 to NA only in row 1. I can’t…
medjenny
  • 11
  • 1
-1
votes
1 answer

Parsing uneven json as a tibble

How do you converting an uneven json file into tidy data? Here I have an uneven json file, and I'd like to change into tidy data. library(tidyverse) library(jsonlite) read_json("https://api.osf.io/v2/search/?q=*&page=100&format=jsonapi") %>% …
John-Henry
  • 1,556
  • 8
  • 20
-1
votes
1 answer

How do you turn categorical rows into columnd?

I am attempting to convert the rows of org_type into columns. Is there a way to do this I tried spread, but I have not had success. Does anyone know how? Below is a picture. r
-1
votes
1 answer

How do I unnest a list inside an R dataframe keeping both keys and values?

I'm currently working to extract data in JSON format into an R dataframe. The data provided is of the following format: Sample code to create test data: test_input_data <- data.frame(date.x=c("2017-08-17", "2017-07-26", "2017-10-04"),…
-1
votes
3 answers

Eliminate cases based on multiple rows values

I have a base with the following information: edit: *each row is an individual that lives in a house, multiple individuals with a unique P_ID and AGE can live in the same house with the same H_ID, I'm looking for all the houses with all the…
-1
votes
1 answer

comparing dataframe - percentage of mismatched cases

I have two people coding the same variables for a psychological test (more than 400 variables), and I need to compare the datasets. I need two results: I need to see only the specific cases with mismatch and As the final result, I need the…
Ruam Pimentel
  • 1,288
  • 4
  • 16
-1
votes
1 answer

A list contain column names and using the list to reference the tibble in R

The table contain My Name, My Age , My Height. I would like to store in a list to get the summary of the height instead of using test = My Height list<- c("`My Name`" , "`My Age`" , "`My Height`" ) table%>% group_by(`My Name` ,`My Age`,`My Height`…
Jolin
  • 231
  • 3
  • 14
-1
votes
1 answer

R convert column of doubles to logical in a tibble

I have a tibble that has a column of type double, confirmed with type of, containing 0's and 1's. I need to turn these 0's and 1's into true or false my_tibble$column_to_convert <- as.logical(my_tibble$column_to_convert) has not worked. The values…
Jay Wehrman
  • 193
  • 2
  • 10
-1
votes
1 answer

Add the mean of all columns matching a regular expression to a tibble

I'm rather new to the tidyverse, and I want to learn, so this question is specifically about doing this the tibble way, using things like select(), mutate() and the like. I know how to achieve the desired effect with data frames matching column…
user11130854
  • 333
  • 2
  • 9
-1
votes
1 answer

keep rows according to several conditions in R

Given the following data.frame : dput(t2) structure(list(rs. = c("S1A_494392059", "S1A_494392059", "S1A_497201550", "S1A_497201550", "S1A_499864157", "S1A_499864157", "S1B_566171302", "S1B_566171302", "S1B_642616640", "S1B_642616640",…
moth
  • 1,833
  • 12
  • 29
-1
votes
1 answer

barplot grouped by 2 columns

I have a tibble (see below) that I read out of a file. I would want to barplot from the tibble in the following way: The x axis should be grouped by player_name and skill_type should have the same colour. The height of the bar should equal the…
empi75
  • 77
  • 1
  • 7
-1
votes
1 answer

Converting nested tibble to character vector in R

I have a nested dataframe tb which looks like that: >tb # A tibble: 26 x 3 league fdj_data five38_data 1 Ch.D1 Danemark 2 Ch.D1…
swoutch
  • 131
  • 2
-1
votes
1 answer

update tibble within a for loop

I am trying to update a tibble using for loop without any success. Below is my code:- temp <- tibble(field1="",field2="") for (i in 1:2){ for (k in 1:2){ add_row(temp,field1=i,field2=k) }} temp # A tibble: 1 x 2 field1 field2 …
itthrill
  • 1,241
  • 2
  • 17
  • 36
-1
votes
1 answer

Keep tibbles as tibbles after reshape2::dcast

Is there a way to get dcast to output a tibble? (without using as_tibble) df <- tibble(a = letters[c(rep(1:3, 3), 1)], b = 1:10 + .1, c = 11:20 + .1) df %>% class # [1] "tbl_df" "tbl" "data.frame" df %>% dcast(a ~ b) %>% class # [1]…
IceCreamToucan
  • 28,083
  • 2
  • 22
  • 38