Consider a map $m: \mathbb{N} \to \mathbb{N}$ (we call it an integer map). Let $E_r$ be the set $m^{-1}(\{r\})$.
Let $H$ be the Hilbert space $\ell^2(\mathbb{N})$ and consider the densely defined operator associated to $m$: $$M : c_{00}(\mathbb{N}) \subset H \to H, \ Me_r = e_{m(r)}, \ \forall r \in \mathbb{N}.$$ It is closable iff its adjoint $M^{\star}$ is densely defined, if (and only if?) the set $E_r$ is finite, $\forall r \in \mathbb{N}$; because then $c_{00}(\mathbb{N}) \subset D(M^{\star})$ as $M^{\star}$ is given by $$ M^{\star}e_r = \sum_{s \in E_r} e_s. $$ Then, let $\overline{M} = M^{\star \star}$ be the closure of $M$. Let $\mathcal{M}$ be the smallest von Neumann algebra that $\overline{M}$ is affiliated with. We can call it $vN(m)$, the von Neumann algebra generated by the integer map $m$.
Question: Is $\mathcal{M}$ a von Neumann algebra of type ${\rm I}$?
If no: What is a counter-example? Is there one with $M$ a bounded operator?
The operator $M$ is bounded iff $\exists k \forall r $, $|E_r|<k$ (then $\Vert M \Vert^2<k$ and $\mathcal{M} = W^{\star}(\overline{M})$).
The von Neumann algebra $\mathcal{M}$ is abelian iff $\overline{M}$ is normal, iff $m$ is bijective (see the proof below), iff $\overline{M}$ is unitary. The map $m$ is a proper injection iff the operator $\overline{M}$ is a proper isometry, only if ${\rm C}^{\star}(\overline{M})$ is the Toeplitz algebra (by Coburn's theorem) and $\mathcal{M}$ of type ${\rm I}$.
So we are reduced to consider non-injective map. The Euler's totient function $\varphi$ is neither injective nor surjective, its associated operator is densely defined and closable. What is $vN(\varphi)$?
Related question: Is $\mathcal{M}$ a hyperfinite von Neumann algebra?
Lemma 1: The operator $\overline{M}$ is normal iff $m$ is bijective.
Proof: Observe that $$(MM^{\star}-M^{\star}M)e_r = |E_r|e_r-\sum_{s \in E_{m(r)}} e_s$$ so $\overline{M}$ is a normal iff $\forall r \in \mathbb{N}$, $E_{m(r)} = \{r\}$ and $|E_r| = 1$, iff $m$ is bijective. $\square$
Corollary: The von Neumann algebra $\mathcal{M}$ is abelian iff $m$ is bijective.
Proof: Immediate from Lemma 1 and Kadison-Ringrose 5.6.18 (for the unbounded case). $\square$