About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
State of the Union Addresses
State of the Union addresses given by U.S. Presidents.
The State of the Union address is an annual speech given by the President of the United States of America to a joint session of the United States Congress.
Usage
To use in Observable,
To vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:
To include the bundle in a webpage,
If no recognized module system is present, access bundle contents via the global scope:
(function () {
window.sotu;
})();
script>
sotu( [options] )
Returns State of the Union addresses.
// returns [{...},{...},...]
Each State of the Union address is represented by an object with the following fields:
- year: speech year.
- name: President name.
- party: the President's political party.
- text: speech text.
The function accepts the following options:
- name: a President's name or an
arrayof names. - party: a political party or an
arrayof political parties. - year: a year or an
arrayof years. - range: two-element
arrayspecifying a year range.
To retrieve speeches by one or more Presidents, set the name option.
'name': 'Barack Obama'
});
// returns [{...},{...},...]
speeches = sotu({
'name': [
'Franklin D Roosevelt',
'Barack Obama'
]
});
// returns [{...},{...},...]
To retrieve speeches from Presidents belonging to a particular political party, set the party option.
'party': 'Democratic'
});
// returns [{...},{...},...]
speeches = sotu({
'party': [
'Federalist',
'Democratic'
]
});
// returns [{...},{...},...]
The following parties are recognized:
- Democratic
- Republican
- Democratic-Republican
- Federalist
- National Union
- Whig
- Whig & Democratic
- none
To retrieve speeches from one or more years, set the year option.
'year': 2009
});
// returns [{...}]
speeches = sotu({
'year': [
1942,
2009
]
});
// returns [{...},{...}]
To specify a range of consecutive years, set the range option, where the first element corresponds to the starting year and the second element corresponds to the final year.
'range': [ 2009, 2016 ]
});
// returns [{...},{...},...]
Notes
- The dataset includes the addresses given by newly inaugurated presidents to a joint session of Congress in Washington during their first year in office, even though these are technically not State of the Union addresses.