import { from } from'rxjs';import { map } from'rxjs/operators';import { mean } from'@buccaneer/rxjs-stats';// create a data sourceconstpirate$=from([ {name:'Henry Morgan', numShipsInFlotilla:36, numOfCrew:1900, numCannons:240}, {name:'Captain Crunch', numShipsInFlotilla:1, numOfCrew:1, numCannons:1}, {name:'BlackBeard', numShipsInFlotilla:2, numOfCrew:400, numCannons:48},]);// describe calculationsconstaverageShipCount$=pirate$.pipe(map(pirate =>pirate.numShipsInFlotilla),mean());// run the pipeline and do something with the resultsaverageShipCount$.subscribe(console.log);