Methods
(private) __checkWorldAverageCites(area, year, worldAverageCitesByArea) → (nullable) {Number}
Parameters:
Name | Type | Description |
---|---|---|
area |
String | The subject-area to check |
year |
Number | The year to check for the subject-area |
worldAverageCitesByArea |
Object | The JSON file with all the subjec-areas in which to do the checking |
Returns:
Returns the worldAverageCite of the subject-area passed in or null if its not present
- Type
- Number
(private) __fixSubjectArea(subjectArea) → {String}
Fixes all those areas where the subject-area field is not a category, but a general area, that does not have a corresponding average number of cites per year. The fix is done replacing the areas called XXXX (all) with General XXXX
Parameters:
Name | Type | Description |
---|---|---|
subjectArea |
String | The area to fix |
Returns:
The fixed area or the original one if there's no need to fix it
- Type
- String
(private) __fixYear(year) → {Number}
This function fixes a year that need to be used to find the worldAverageCites of a subject-area. If the year is not in the 2006-2016 range, it needs to be fixed to the nearest year in the range.
Parameters:
Name | Type | Description |
---|---|---|
year |
Number | The year to fix |
Returns:
The fixed year or the original year if it's in the correct range
- Type
- Number
(private) __iT(variable) → {boolean}
Short for "isTrue". This functions tests validity of a variable. We need to use it since 0 returns false in tests, which could happen with vars like citesAverage, citesCount, etc. and we need to return true in these cases
Parameters:
Name | Type | Description |
---|---|---|
variable |
any | Variable to test |
Returns:
true
if the variable is valid and false
in other cases
- Type
- boolean
areasPublished(authorData) → (nullable) {Array}
Returns an array with the name, abbreviature and code of each area in which the author has published. The result has the following format:
[...{
Parameters:
Name | Type | Description |
---|---|---|
authorData |
Object | Raw data of the author |
Returns:
An array with each area and its name, abbreviature and code or null if there are no subject areas fot that author
- Type
- Array
areaWorldAverageCitesAtYear(area, year, worldAverageCitesByArea) → (nullable) {Number}
Returns the world average cites for the requested year and area
Parameters:
Name | Type | Description |
---|---|---|
area |
String | The area to look for in the world average cites object |
year |
Number | The year to look for citations in the world average cites object |
worldAverageCitesByArea |
Object | The object with all the world average cite information |
Returns:
The world average cites or null if the area or year are not in the world average cites object
- Type
- Number
averageProperty(object, property) → {Object}
Calculates the average of a given property in an object
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Object containing |
property |
String | Name of the property to be averaged |
Returns:
Same object passed in, but without property
(array) and with property+Average
(number)
- Type
- Object
bestPercentiles(areasArray, publicationsGrouped, worldAverageCitesByArea) → {Object}
Return the best percentile of each publication and the area in which the publication has that percentile.
If more than one area is found, returns the one with lowest world average cites. If a publication does
not have cite score data for its publication year, or if the area code with best percentile cannot be converted
to an area name, null
is returned in percentile
and area
.
Parameters:
Name | Type | Description |
---|---|---|
areasArray |
Array | Array with the possible areas of the publications. It is used for converting area code to area name |
publicationsGrouped |
Object | A JSON with a property year and a property publications with the ones from that year |
worldAverageCitesByArea |
Object | JSON object containing all subject areas as keys, each of them with a number of years as keys too, whose values are the average number of cites in that year |
Returns:
Object with the same structure as the one passed as parameter but with an array of each publication's best percentile.
If a publication has no percentile or area for its year, null
is returned in the corresponding field. Example:
{
year: Number,
publications: [...
{
publicationID: string,
percentile: Number?,
area: string?
}
]
}
- Type
- Object
mostPublishedArea(publicationsOfYear, worldAverageCitesByArea) → {Object}
Receives an object containing a year and a set of publications, and computes the area in which most publications are. If there is more than one mostPublishedArea, the one whose worldAverageCites is the lowest is chosen. In case the year associated to that subject-area is not between 2006 & 2016 (inclusive) these values are respectively taken to choose the mostPublishedArea
Parameters:
Name | Type | Description |
---|---|---|
publicationsOfYear |
Object | Object containing year and array of publications |
worldAverageCitesByArea |
Object | JSON object containing all subject areas as keys, each of them with a number of years as keys too, whose values are the average number of cites in that year |
Returns:
Same object passed in, but without publications and with two new properties, optimalMostPublishedArea
and
mostPublishedAreas
- Type
- Object
normalizedImpact(publicationsOfYear, averageCites, mostPublishedArea, worldAverageCitesByArea) → {Object}
Computes the normalized impact per year
Parameters:
Name | Type | Description |
---|---|---|
publicationsOfYear |
Object | Object containing a year and an array of publications |
averageCites |
Number | Number of average cites for the year passed in publicationsOfYear |
mostPublishedArea |
String | Area in which most publications are |
worldAverageCitesByArea |
Object | JSON object containing all subject areas as keys, each of them with a number of years as keys too, whose values are the average number of cites in that year |
Returns:
New object containing the year and the normalized impact
- Type
- Object
percentOverTotal(object, property, totalCount) → {Object}
Given an object, which contains an array, computes the percentage of elements over the total
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Object with several properties, including the array |
property |
String | Name of the property where to calculate percentage |
totalCount |
Number | Total number of elements, counting all objects in the array passed |
Returns:
Same object passed in, but substituting the array by the percentage of its elements over the total
- Type
- Object
publicationsInQn(publications, qNumber) → {Number}
Parameters:
Name | Type | Description |
---|---|---|
publications |
Array.<Object> | Array with all the publications' best percentiles, grouped by year returned by bestPercentiles |
qNumber |
Number | The Q you want to know how many publications have. Has to be a number between 1 and 4 |
Returns:
The number of publications in the Q you asked for
- Type
- Number
publicationsOverPercentile(publications, percentile) → {Number}
- Source:
- See:
Returns the number of publications that are above the required percentile number
Parameters:
Name | Type | Description |
---|---|---|
publications |
Array.<Object> | Array with all the publications' best percentiles, grouped by year returned by bestPercentiles |
percentile |
Number | The number over which the publications percentile have to be above |
Returns:
The number of publications that are above percentile
- Type
- Number
q1PublicationsPercent(publications, qualitySource) → {Number}
Given an array of publications, it computes the Q1 publications percent by looking at the property
percentile${qualitySource}
placed at first level in every publication object
Parameters:
Name | Type | Description |
---|---|---|
publications |
Array | Array with all publication objects |
qualitySource |
String | Quality source (JCR, SCIE, etc.) used to compute percentile of a publication |
Returns:
Percent of Q1 publications out of the total number of publications
- Type
- Number
removeDuplicatesSubjectAreas(areasArray) → {Array}
This function receives an array of areas and return an array with unique areas
Parameters:
Name | Type | Description |
---|---|---|
areasArray |
Array | The array with duplicates areas |
Returns:
Array containing only unique areas
- Type
- Array
sumProperties(object, property) → {Object}
Receives an object containing an array property and substitutes it by a new property with the sum of the elements in the array
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Object containing publications, cites, etc., and other properties |
property |
String | Name of the property that needs to be sumed |
Returns:
Same object passed in, but without property
(array) and with property+Count
(sum of the elements in the array)
- Type
- Object
sumPropertyLength(object, property) → {Object}
Receives an object containing an array property and substitutes it by a new property with the length of that array
Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Object containing publications, cites, etc., and other properties |
property |
String | Name of the property that needs to be sumed |
Returns:
Same object passed in, but without property
(array) and with property+Count
(length of the array)
- Type
- Object
sumTotal(array, property) → {Number}
Receives an array of objects and a property name and returns the sum of the values of the property for every array element
Parameters:
Name | Type | Description |
---|---|---|
array |
Array.<Object> | Array of objects with several properties each |
property |
String | Name of the property to be sumed |
Returns:
Sum of all the values called property
in the passed array
- Type
- Number
weightedImpact(normalizedImpactPerYear, publicationsPercentPerYear) → {Array.<Object>}
Computes an array with the weighted impact per year
Parameters:
Name | Type | Description |
---|---|---|
normalizedImpactPerYear |
Array.<Object> | Array of objects containing year and normalizedImpact |
publicationsPercentPerYear |
Array.<Object> | Array of objects containing year and percentOfPublications per year over the total |
Returns:
Array containing year and weighted impact per year
- Type
- Array.<Object>
worldAverageCites(publicationsGrouped, worldAverageCitesByArea) → {Array.<Object>}
Returns the world average cites for an area, a year.
Parameters:
Name | Type | Description |
---|---|---|
publicationsGrouped |
Object | A JSON with a property year and an array of publications from that year |
worldAverageCitesByArea |
Object | JSON containing the world average cites of each area |
Returns:
An object with the same year as the passed in, the area with most publications that year in the publications
array of publicationsGrouped
and the world average citation for that area. Example:
{
year: Number,
area: String,
worldAverageCites: Number
}
- Type
- Array.<Object>