Histogram in Julia: Distributed.ProcessExitedException - julia

I'm running Julia 1.7.2 in a Pluto notebook on an M1 chip.
I have a vector of integers between 1 and 9, and would like to make a histogram showing which integers are most frequent.
I thought I had done this successfully by using Plots and then calling histogram on the appropriate vector. At one point I had even generated a plot that I liked doing this.
I then tried to replicate this procedure (i.e. using Plots, and then call histogram) in a different Pluto notebook I had written.
I don't know if it was conflicting with other packages, but I began to get Distributed.ProcessExitedException errors in this other notebook when I ran histogram.
In another fail mode, I created a cell that contained only the following code
begin
using Plots
histogram(vector)
end
When I run the notebook with this code, all the other cells evaluate, but then this last cell lags forever and does not evaluate.
Frustrated, I went back to the first notebook where I had gotten the plotting to work, but now I get Distributed.ProcessExitedException error there too!
I am just posting to see if anyone has any ideas as to what might be going on.
In particular,
is there a link between Plots and Distributed?
is there anything that would cause an error in one notebook to cause a different notebook that had previously been working to fail?
The packages I was using in the first notebook that worked, and then didn't work) were
begin
using DataFrames
using BSON
using Revise
using FileIO
using CSV, HDF5, NRRD
# Statistics
using StatsBase: mean, nquantile, percentile
using LinearAlgebra: norm, mul!
using HypothesisTests
using Plots
using Random
# Tensors
using Tullio: #tullio
# Algorithms
import Flux
import Flux: update!
using Flux: RMSProp
end
The packages I was using in the second notebook that never worked were
begin
using DataFrames
using FileIO
using CSV, HDF5, NRRD
# Statistics
using StatsBase: mean, nquantile, percentile
using LinearAlgebra: norm, mul!
using HypothesisTests
# Tensors
using Tullio: #tullio
# Algorithms
import Flux
import Flux: update!
using Flux: RMSProp
end

Related

Is it possible to benchmark an entire JupyterLab Notebook?

I'm not sure if this is a CV question or SO, so I apologize if it falls within the CV domain.
Problem
I know it's possible to microbenchmark specific chunks of R code, but is there any benchmark-ing tool for an entire Jupyter Notebook? I could just run the entire notebook and time it manually, but I'd like more statistics and precision on the timing for which the microbenchmark package provides (I'm trying to make a case for automation of data analyses and visualizations).
The other dilemma (an overall issue with notebooks) is that my notebook is divided into many individual cells, so the option of benchmark-ing in the Jupyter environment might be inefficient (forcing me to export all code and then running a microbenchmark on it say in R Studio).
Desired Solution
An efficient way to benchmark an entire, multi-celled JupyterLab Notebook.

Julia Plots has no output in Jupyter notebook

I'm trying to plot a geometric sum (for teaching purposes), and am getting no output for certain input values.
This is run using Julia 1.3 on MacOS Mojave 10.14.5 using an up-to-date version of Chrome
Here is the code:
using Plots
geom_series(x,n)=sum([x.^m for m in 0:n])
n=14
x=LinRange(-2.0,4.0,1001)
y=geom_series(x,n)
plot(x,y, ylims=(-10,10))
This plots fine in Jupyter notebook for n in 1:13. Thereafter, it plots for any odd n, but for no even n. It will also plot if I reduce the domain (e.g. x= LinRange(-2.0,2.0,1001)) or if I remove the ylims from the plot statement.
This involves some very large y-values, for both odd and even n. I've checked for NaNs, but there aren't any.
It also runs perfectly well if I run the code in the REPL.
Also no problems if I use PyPlot instead of Plots, so it is not a serious issue for me.
But does anyone have some idea of what might be going on?

Drawing a clinical study subjects flow chart directly in R within a Jupyter notebook

I'm using R (3.x) within Jupyter to perform some statistical analysis of a clinical study.
The flow of subjects is pretty complex and I would like to draw the Patient flow chart directly in my notebook. Like this one :
Why ?
To make sure the subjects count is consistent with the code, and not having to maintain sync between the R code and this figure.
I've tried DiagrammeR (won't install for some reason), RGrahpviz (too complex and doesn't meet the requirements).
A perfect solution might come from mermaid but I couldn't find a way to have it integrated with my Jupyter/R notebooks.
I'm not using a python Jupyter notebook but a R notebook.
You have mentioned that DiagrammeR won't install, but I would still provide one solution using DiagrammeR anyway--in case you have solved the installation issue. Suppose after you have made the graph using DimagrammeR and obtained a grViz object named myGraph. To display it under jupyter notebook, I use the following
require('DiagrammeR')
require('DiagrammeRsvg') #export grViz objects to svg
require('IRdisplay')
mySVG<-export_svg(myGraph)
display_svg(data=mySVG)

How to use DWD R package in order to remove biases and merge two microarray datasets

I am trying to find a way to use distance weighted discrimination method (DWD) to remove biases from multiple microarray datasets.
My starting point is this. The problem is that Matlab version runs only under Windows, needs excel 5 format as input (where data appears to be truncated at line 65535 - matlab error is:
Error reading record for cells starting at column 65535. Try saving as Excel 98.
). Java version runs only with caBIG support, which, if I understood, has been shut down recently.
So I searched a lot and I find R/DWD package but from example I could not get how to provide the two datasets to merge to kdwd function.
Does anybody know how to use it?
Thanks
Try this, it has a DWD implementation
http://www.bioconductor.org/packages/release/bioc/html/inSilicoMerging.html

how to convert Matlab scripts in R

I would like to run some Matlab scripts. Nevertheless we don't have the Matlab licence so it is necessary a conversion from Matlab to R language. Unfortunately I'm totally new in Matlab but not in R. Is it possible to read Matlab scripts using R or is there an easy way to translate Matlab scripts in R?
Rewriting from one language to another can be a painstaking process, especially because your have to take great care that the outcomes of both sets of codes are the same. I see roughly four approaches:
Digest the goal of the scripts, put aside the matlab code, and rewrite in R
Try and mimic the matlab code in R
Run the matlab code in octave, and interface with R
Run the code in Octave entirely
These are roughly in order of amount of work. If you just want to get the Matlab code working, definitely use Octave, which should run the code with minimal changes. If you want to convert the code to R, and continue developing in R, I would go for the first option. In that way you can leverage the real strenghts of R, as R is quite different (link with info, comparison R and matlab). But it does take the largest amount of time. Even if you reimplement in R, I would recommend getting the code running in Octave to be able to see if your results in R fit with the Matlab code.

Resources