Plots not working with MethodError or Undefined

I am trying to plot columns of a dataframe and tried to run the example here.

using StatsPlots, RDatasets
gr()
iris = DataFrame(dataset("iris"))
@df iris scatter(
    :SepalLength,
    :SepalWidth,
    group = :Species,
    m = (0.5, [:+ :h :star7], 12),
    bg = RGB(0.2, 0.2, 0.2)
)

I keep getting the following error:

UndefVarError: scatter not defined

Stacktrace:
 [1] (::var"#21#22")(309::DataFrame)
   @ Main ./none:0
 [2] top-level scope
   @ In[37]:2
 [3] eval
   @ ./boot.jl:360 [inlined]
 [4] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1116

I have tried other backends and i get errors like: MethodError: no method matching getproperty(::Char, ::String)

Could someone please help me understand what I am doing wrong?
I am new to julia.

The third line in the tutorial is:

iris = dataset("datasets", "iris")

Instead of :

iris = DataFrame(dataset("iris"))

I don’t know this package, but maybe this affect something?

Hi @vinicius_de_lima, I fixed that part but still get the above errors.

I tried the tutorial here and it worked. Did you installed StatsPlots and RDatasets?