Skip to content
Prev 385370 / 398506 Next

filter() question

Eric, Rasmus,

thank you very much,

	 ALLPAP  %>%
		 group_by(Provider) %>%
		 mutate( minDt=min(CollectionDate),
			 maxDt=max(CollectionDate)) %>%
		 summarize( minDt = min(minDt),
			 maxDt = max(maxDt), .groups="keep" ) %>%
		 ungroup() %>%
		 mutate(MAX_MIN_DATE = max(minDt),
			 MIN_MAX_DATE = min(maxDt)) %>%
		 distinct(MAX_MIN_DATE, MIN_MAX_DATE)

gives me

	 # A tibble: 1 x 2
		MAX_MIN_DATE MIN_MAX_DATE
		<chr>        <chr>       
	 1 2010-02-05   2019-08-30  

which is correct, and what I wanted.

This is so cool :-)-O

el
On 21/08/2020 11:41, Eric Berger wrote:
[...]
[...]
[...]
-- 
Dr. Eberhard W. Lisse   \         /       Obstetrician & Gynaecologist 
el at lisse.NA             / *      |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \      /  If this email is signed with GPG/PGP
10007, Namibia           ;____/ Sect 20 of Act No. 4 of 2019 may apply