File Too Large¶
Here are suggestions for what to do if you get a file-too-large error when opening a file in CoCalc.
You may see the following warning when opening a Jupyter notebook:
A possible cause for a file-too-large error with a Jupyter notebook is creating an image file from a plot that exceeds the size limit. Here are some suggestions:
If you are using a CoCalc Jupyter notebook (which we generally recommend), it may be possible to open the notebook with the classical jupyter server or JupyterLab. Once you have the file open, you can modify the code to produce a smaller plot. Then you can go back to using the CoCalc notebook.
You could revert the notebook to an earlier version, before the large plot was created. Click the Backups button in the file listing and copy over an earlier version, then modify your code to produce a smaller plot.
The default image file format for plots with the “R (R Project)” Jupyter kernel is SVG. For large plots, smaller files may be produced if the format is set to PNG, because SVG plots (the default) grow in size proportionally to the data they are supposed to show, wherease PNG plots are rasterized, so file size does not have the same proportionality relationship to amount of data. To set image output format in an R Jupyter notebook to PNG, run the following in a compute cell before creating the plot:
options(jupyter.plot_mimetypes = c('text/plain', 'image/png'))