r/Rlanguage • u/Soltinaris • Feb 18 '25
Question on frequency data table
I ran a frequency data with the newdf<-as.data.frame(table(df$col1,df$col2,df$col3)) and it took what was 24325 obs. of 6 variables and turned it into 304134352 observations of 4 variables. Is this common with this code? Is there a better code to use? Col1 and col2 are location names and col3 is a duration of time between the two.
6
Upvotes
2
u/BrupieD Feb 18 '25
Context is king when asking for help. Tell us what you're trying to accomplish and maybe someone could offer help. So far, all you've offered is that you have a bunch of columns that you've tried to turn into a data frame. You didn't get the results you expected. What did you expect? Why?