Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

Why does the function modal() get stuck when used with summarise in R? [closed]

$
0
0

Context:

I have a data frame of bird gps fixes (~48million rows) to which I have assigned the ID of a grid cell that each fix intersects. I also have timestamp for each fix among other attributes. I need to calculate the modal week for each grid cell to highlight when the most fixes are recorded in particular regions.

Question:

Does anyone have any idea why the modal function would fail to complete as parts of a summarise by group operation? It worked previously but now seems to get stuck, no error but never completes.

Modal_Week <- df >%> group_by (ID) >%> summarise(num_ind = length(unique(individual_id)),  modal_week = modal(df$week, na.rm = true))

Modal(df$week) seems to work ok but calculating the modal week occuring within a particular feature seems to get stuck.

Does anyone know why this might be and what my options are?

Thanks.


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>