Replies: 5 comments 12 replies
-
To add to that: It's important to separate GTFS data (that can be read or written) and additional "analysis data" that gets added to the feed. Additional data in tidytransit is added in a sublist Maybe the standard should rather handle how data is added to a feed, with naming conventions for additional columns, common function prefixes, how to handle replacement functions ( |
Beta Was this translation helpful? Give feedback.
-
Thanks @polettif for starting the discussion, and I think and hope this'll be a great place for us all to work towards common standards. A couple of thoughts in response:
|
Beta Was this translation helpful? Give feedback.
-
Hi, thanks @polettif for creating this discussion.
I don't really like factors either, so apparently that's something we all have in common. And to be honest, I don't think that factors would help us here. I'll give an example. Let's suppose we have an integer vector holding > route_type <- c(1L, 2L, 3L, 3L, 1L)
> route_type
[1] 1 2 3 3 1 It's pretty easy to subset this vector based on a specific Now let's say that we convert this to a factor, where each label is the "meaning" behind each value (I'm assuming this is how you had thought about using the factors). We could do something like this (please, if there's a more clever way of using factors let me know, I really don't have that "intimacy" with this type): > fac <- factor(route_type, labels = c("subway", "rail", "bus"))
> fac
[1] subway rail bus bus subway
Levels: subway rail bus Now the we have to select values based on their labels, not on their "underlying levels" (e.g 1, 2 and 3): > fac[fac == 1]
factor(0)
Levels: subway rail bus
> fac[fac == "subway"]
[1] subway subway
Levels: subway rail bus I see some problems here:
Perhaps that's what @mpadge meant by " |
Beta Was this translation helpful? Give feedback.
-
Another thought that has recently come up to me:
Right now each package deals with them differently. Why is this important? Right now I check for the class of the GTFS object in all |
Beta Was this translation helpful? Give feedback.
-
How about this for a suggestion, by way of solution: We work together by pulling code from our various repos to make a single unifying |
Beta Was this translation helpful? Give feedback.
-
Continuing discussions from gtfs-router#74. Pinging @mpadge, @dhersz, @rafapereirabr, @tbuckl
My thoughts on this:
I honestly don't know enough about this but when working with data.table I can't use the same syntax as I do with tibble and/or data.frame. Are data.table's simply lists of columns? Where does all the modify-by-reference magic happen then?
Beta Was this translation helpful? Give feedback.
All reactions