<jupyter_start><jupyter_text>Prepare the datasets<jupyter_code>movies = as.data.frame(ggplot2movies::movies)
head(movies, 3)
genres = colnames(movies)[18:24]
genres<jupyter_output><empty_output><jupyter_text>Convert the genre indicator columns to use boolean values:<jupyter_code>movies[genres] = movies[genres] == 1
t(head(movies[genres], 3))<jupyter_output><empty_output><jupyter_text>To keep the examples fast to compile we will operate on a subset of the movies with complete data:<jupyter_code>movies[movies$mpaa == '', 'mpaa'] = NA
movies = na.omit(movies)<jupyter_output><empty_output><jupyter_text>Utility for changing output parameters in Jupyter notebooks ([IRKernel kernel](https://github.com/IRkernel/IRkernel)), not relevant if using RStudio or scripting R from terminal:<jupyter_code>set_size = function(w, h, factor=1.5) {
    s = 1 * factor
    options(
        repr.plot.width=w * s,
        repr.plot.height=h * s,
        repr.plot.res=100 / factor,
        jupyter.plot_mimetypes='image/png',
        jupyter.plot_scale=1
    )
}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12140871177015755, 'fraction_numerical': 0.013901760889712697, 'mean_word_length': 5.545454545454546, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '156617', 'license': 'MIT', 'n_tokens_mistral': 402, 'n_tokens_neox': 390, 'n_words': 78, 'path': 'vignettes/Prepare_R.ipynb', 'repo_name': 'CyrilLagger/complex-upset', 'size': '1079'}