Create OSM-File with only specifc key,value pairs.

For a statisitcal analysis (just fooling around) I want to create a OSM-File wich only contains OSM-Data of a certain type.
I have the data of road accidents in the uk ( and i want to find out if there is an accumulation of accidents with children involved near playgrounds.
Hence the OSM-File of GB is Huge (~8gb) and merly suitable for processing with the software (R and the package osmar) and I only need the ways and points with


it would be great to create such an OSM-File.

osmfilter should be the right tool for this job.