# Renaming columns in DataFramesMeta with spaces

**URL:** https://discourse.julialang.org/t/renaming-columns-in-dataframesmeta-with-spaces/11101
**Category:** Data
**Created:** [May 23, 2018, 3:50pm UTC](https://discourse.julialang.org/t/renaming-columns-in-dataframesmeta-with-spaces/11101 "2018-05-23T15:50:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jacobcvt12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobcvt12/32/2695_2.png) [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)
#### Post date: [May 23, 2018, 3:50pm UTC](https://discourse.julialang.org/t/renaming-columns-in-dataframesmeta-with-spaces/11101/1 "2018-05-23T15:50:48Z")

</div>

I’ve created the following dataset:

```julia
d = DataFrame(x=randn(100))
d[Symbol("Y 2")] = randn(100)

```

I can rename the second column via

```julia
rename!(d, Symbol("Y 2") => :Y)

```

But I would like to rename it via a `DataFramesMeta` chain.

I can do

```julia
@linq d |> select(X=:x)

```

But

```julia
@linq d |> select(Y=Symbol("Y 2"))

```

drops the column `Y 2` and adds the column `Y` with only one row with the value “Y 2”

Additionally,

```julia
@linq d |> select(X=Symbol("x"))

```

Does something similar. Anyway to get around this, or do I need to use `rename!`?

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [May 23, 2018, 7:01pm UTC](https://discourse.julialang.org/t/renaming-columns-in-dataframesmeta-with-spaces/11101/2 "2018-05-23T19:01:34Z")

</div>

I think this is a bug in DataFramesMeta, and you should file an issue. I think this has to do with how the syntax tree looks for `Symbol("Y 2") ` vs. `:Y2`.

---

<div class="post-metadata">

### Author: ![jacobcvt12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobcvt12/32/2695_2.png) [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)
#### Post date: [May 23, 2018, 7:14pm UTC](https://discourse.julialang.org/t/renaming-columns-in-dataframesmeta-with-spaces/11101/3 "2018-05-23T19:14:38Z")

</div>

I’ve created an issue [here](https://github.com/JuliaStats/DataFramesMeta.jl/issues/93) for any interested.
