code: function getRankedApps (apps) {
      const findRank = (list, app) => (list.indexOf(app.appId) + 1) || undefined;
  
      const queries = R.uniq(apps.map(store.getCollectionQuery));
      const queryIndex = queries.map((q) => [q.collection, q.category]);
      return Promise.all(queries.map(store.list))
        .then(R.map(R.map(R.prop('appId'))))
        .then(R.zipObj(queryIndex))
        .then(function (listMap) {
          // for each app, get its collection/category list and find its rank in there
          const findList = (app) => listMap[[store.getCollection(app), store.getGenre(app)]];
          return apps.map((app) => findRank(findList(app), app));
        })
        .then(R.reject(R.isNil))
        .then(function (results) {
          if (!results.length) {
            return {count: 0, avgRank: undefined, score: 1};
          }
  
          const stats = {
            count: results.length,
            avgRank: R.sum(results) / results.length
          };
  
          const countScore = calc.zScore(apps.length, stats.count);
          const avgRankScore = calc.iScore(1, 100, stats.avgRank);
          const score = calc.aggregate([5, 1], [countScore, avgRankScore]);
          return R.assoc('score', score, stats);
        });
    }
docs: /*
  For each of the keyword's top apps, get the ranking for its category and check
  what rank (if any) it has in that list.