# Problem with RDataFrame

**URL:** <https://root-forum.cern.ch/t/problem-with-rdataframe/52448>\
**Category:** Newbie\
**Tags:** rdataframe\
**Created:** [November 21, 2022, 12:23pm UTC](https://root-forum.cern.ch/t/problem-with-rdataframe/52448 "2022-11-21T12:23:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mimi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@Mimi](https://root-forum.cern.ch/u/Mimi)\
**Post date:** [November 21, 2022, 12:23pm UTC](https://root-forum.cern.ch/t/problem-with-rdataframe/52448/1 "2022-11-21T12:23:12Z")

</div>

Hi everyone,

I have a problem when using RDataFrame. I was trying out the following easy example code:

```auto
RDataFrame d("Filtered", "test.root");
auto h = d.Histo1D("Probability");
h->Draw();

```

This gives me the following error message:

```auto
error: unknown type name 'h'

```

Any ideas what I am doing wrong?

\_ROOT Version: 6.18/04  
\_Platform: Mac OS Monterey

* * *

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 21, 2022, 12:54pm UTC](https://root-forum.cern.ch/t/problem-with-rdataframe/52448/2 "2022-11-21T12:54:18Z")

</div>

It should work, I just tried with `hsimple.root` from ROOT tutorials:

```auto
root [0] ROOT::RDataFrame d("ntuple", "hsimple.root");
root [1] auto h = d.Histo1D("px");
root [2] h->Draw();
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1

```

---

<div class="post-metadata">

**Author:** ![Mimi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@Mimi](https://root-forum.cern.ch/u/Mimi)\
**Post date:** [November 21, 2022, 1:19pm UTC](https://root-forum.cern.ch/t/problem-with-rdataframe/52448/3 "2022-11-21T13:19:08Z")

</div>

Thank you, I found my mistake! I had put everything inside a .C file and ran that with .L, but forgot to create a void function to call “h-\>Draw()”. Now everything works fine.
