# Read R-Model (k-prototype)

**URL:** <https://forum.knime.com/t/read-r-model-k-prototype/49509>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [December 1, 2022, 5:14pm UTC](https://forum.knime.com/t/read-r-model-k-prototype/49509 "2022-12-01T17:14:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrebernal12](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/e47774/32.png) [@andrebernal12](https://forum.knime.com/u/andrebernal12)\
**Post date:** [December 1, 2022, 5:14pm UTC](https://forum.knime.com/t/read-r-model-k-prototype/49509/1 "2022-12-01T17:14:44Z")

</div>

Hello! I used R extension in particular R Snippets to do clustering with kproto from the [clustMixType] packages. I saved some models using nodes R Learner and R Model Writer. These models are saved in .zip folders as when you save models when you do kmeans, for example. However when I use R Model Reader and try to get results in a table, I get this error:

_Error: no applicable method for ‘pmml’ applied to an object of class “kproto”_

I am interested in getting back the labeled clusters back to my data in knime. Any ideas or hints?

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 1, 2022, 5:33pm UTC](https://forum.knime.com/t/read-r-model-k-prototype/49509/2 "2022-12-01T17:33:27Z")

</div>

@andrebernal12 welcome to the KNIME forum. One way should be to store you model as a ZIP file like a model and read it back into the KNIME R node like in this example:

![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/8/d8e3cb2fe7acc2d66502413ea0e0c01ab38c9e56.png)

> **[Simple example to make a random forest (rpart) model with R in KNIME using...](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_r_iris~BEc4mEVyO07SDveM)**
>
> Simple example to make a random forest (rpart) model with R in KNIME using the iris dataset. And saving an reusing the model with PMML

then it is always possible to store R objects in rds or rdata frames that you could re-use in other R nodes.

> **[R Language Tutorial =\> Rds and RData (Rda) files](https://riptutorial.com/r/example/3650/rds-and-rdata--rda--files)**
>
> Learn R Language - Rds and RData (Rda) files

> **[various methods to export data and graphics from KNIME with R – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_r_export_data_rdata/k_001_r_export_data~jKkSUaKxnFPhUto6)**
>
> You could toy around with R and KNIME exports either using the generic KNIME ports or just export from inside the R nodes into graphic files, CSV files, .RDS r…

Maybe you could give a small example of what you want to do with dummy data so one could explore.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 1, 2023, 5:33pm UTC](https://forum.knime.com/t/read-r-model-k-prototype/49509/3 "2023-03-01T17:33:34Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
