Dimensional Table/Fact in R

Asked

Viewed 23 times

0

Currently I have 4 data.frames that have ID and other data, and I intend to use dimensional model (known as star) to create a fact table with all the Ids. But the only way I thought about developing this was to manually create all the bonds more in a very ineffective way. Is there a library or a usual way to create fact tables in R?

## Exempo
di_tabela1 = c(id_1, nome, endereco)
di_tabela2 = c(id_2, descricao)
di_tabela3 = c(id_3, local, cep)
di_tabela4 = c(id_4, zz, xx, codigo)

## Forma grotesca, so jogando os ids
fato_tabela = c(id_1,id_2,id_3,id_4)
  • i didn’t understand what you need, but it has the function expand.grid if you need all combinations of something, try to write a reprex with an expected result pf

  • In fact, I want to create a new data.frame (fato_table) with the Ids, from the other tables, because I’m going to record this in a Postgres database, and the way I’m going to record these Ids, needs to be in a way that respects the rules of integration between the tables. I researched a lot about and did not find any library focused on tables fact, I am thinking of creating all the rules in a manual way even(with ifs, mutate, etc)

  • but you need the unique combination of ids?

  • This, because it will be carried out in the BI analysis, and it will do the references by the Ids, and if I create this fact table, will have a higher performance in the queries.

  • Okay, do you have these df on any list or Tibble? That’s why I asked reprex to solve this problem very fast but without the formator of your data is difficult

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.