R is a wonderful language for working with textual data. One useful tool when working with textual data is to determine the sentiment of the text you are evaluating. Using the packages Tidyverse and Sentimentr, we can fetch the sentiment of a text without even reading it!

Photo by Edurne Chopeitia on Unsplash

Lets jump straight in and evaluate the three following sentences:

  1. “Everything is neutral and ordinary in this sentence.”

Obviously, the first sentence has a neutral sentiment, the second has a positive sentiment and the third sentence has a negative sentiment. Using the package sentimentr in R, we can obtain sentiment score for each of the respective sentences with the following code:

The sentiment scores from each of the sentences are the following:

When interpreting the output, we can see that all text…


Linear Programming is a great tool for determining optimal solutions in minimization and maximization problems given a set of constraints. By applying Monte Carlo simulations to such programs, we can see how optimal solutions changes with random shocks.

Photo by Edge2Edge Media on Unsplash

We will do the following:
> Construct a deterministic linear programming problem using PuLP
> Apply Monte Carlo simulations on the problem
> Interpret the results using data visualization

The linear programming problem we are going to solve is the following:

A manufacturer of specialized industrial windows has three products in its product line, and these are called ‘Small’, ‘Medium’ and ‘Large’. We get the following data:

1. The associated operating profits pr. product is 12, 12.5 and 12 respectively. 2. The working hours needed pr. product is 2.5, 3 and 8 respectively with a total of 1000 hours available…

Tellef Solberg

Business Analyst/Data Scientist in a leading Aquaculture company in Norway. Very curious about data-driven and autonomous decision making.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store