Dear both,
I created the following reprex based on my data.
library(tidyverse)
income_rep <-
structure(
list(
document.id = c(1L, 1L, 1L, 1L, 1L, 1L),
array.id = 1:6,
Value = c(
"Sales - 1% benefit from com clients",
"0.00",
"14.93",
"15.91",
"6.41",
"39.84"
),
..JSON = list(
list(Value = "Sales - 1% benefit from com clients",
Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "0.00", Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "14.93", Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "15.91", Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "6.41", Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "39.84", Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
))
)
),
row.names = c(NA, 6L),
class = c("tbl_json",
"tbl_df", "tbl", "data.frame")
)
income_titles_rep <-
structure(
list(
document.id = 1:6,
rowtitle = c(
"Sales - 1% benefit from com clients",
"Sales - Buying office",
"Sales - Commission from Suppliers",
"Sales - Incubation - Hosting & management",
"Sales - Incubation - Operation expenses",
"Sales - Incubation - Other projects"
),
..JSON = list(
list(Value = "Sales - 1% benefit from com clients",
Attributes = list(
list(Value = "c62dc423-f365-4acf-a594-5c82d9b8d272",
Id = "account")
)),
list(Value = "Sales - Buying office",
Attributes = list(
list(Value = "0e15a197-cee1-43e3-948e-6f066cf96718",
Id = "account")
)),
list(Value = "Sales - Commission from Suppliers",
Attributes = list(
list(Value = "9554f275-d867-4142-9297-a0be6e3e5916",
Id = "account")
)),
list(Value = "Sales - Incubation - Hosting & management",
Attributes = list(
list(Value = "45a2030d-f64b-47c0-b576-4b3ca1ce298f",
Id = "account")
)),
list(Value = "Sales - Incubation - Operation expenses",
Attributes = list(
list(Value = "edc92a15-d1e2-42a0-b05e-3e4a27641502",
Id = "account")
)),
list(Value = "Sales - Incubation - Other projects",
Attributes = list(
list(Value = "eca48138-950b-4d73-ab3f-91b022f96b0f",
Id = "account")
))
)
),
row.names = c(NA, 6L),
class = c("tbl_json",
"tbl_df", "tbl", "data.frame")
)
header_rep <-
structure(
list(
array.id = 2:7,
Month = c(
"30 Jun 21",
"30 May 21",
"30 Apr 21",
"30 Mar 21",
"28 Feb 21",
"30 Jan 21"
),
..JSON = list(
list(Value = "30 Jun 21"),
list(Value = "30 May 21"),
list(Value = "30 Apr 21"),
list(Value = "30 Mar 21"),
list(Value = "28 Feb 21"),
list(Value = "30 Jan 21")
)
),
row.names = c(NA,
6L),
class = c("tbl_json", "tbl_df", "tbl", "data.frame")
)
#
income_rep %>% left_join(income_titles_rep, by = "document.id")
income_rep %>% left_join(income_titles_rep, by = "document.id") %>% left_join(header_rep, by = "array.id")
income_rep %>% left_join(header_rep, by = "array.id")
income_rep %>% left_join(header_rep, by = "array.id") %>% left_join(income_titles_rep, by = "document.id")
library(tidyjson)
income_rep %>% left_join(income_titles_rep, by = "document.id")
income_rep %>% left_join(income_titles_rep, by = "document.id") %>% left_join(header_rep, by = "array.id")
income_rep %>% left_join(header_rep, by = "array.id")
income_rep %>% left_join(header_rep, by = "array.id") %>% left_join(income_titles_rep, by = "document.id")
Building this reprex, it now seems as though the issue comes from a bug in tidyjson.
Before loading tidyjson, the pure tidyverse version works as expected. I just need to get rid of the the json columns which I haven't been able to do.
How could I drop the tbl_json format of these objects to create a simple tibble?