# Questions about saving data to a DataFrame

**URL:** https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156
**Category:** General Usage
**Created:** [October 11, 2020, 12:56pm UTC](https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156 "2020-10-11T12:56:26Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)
#### Post date: [October 11, 2020, 1:13pm UTC](https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156/2 "2020-10-11T13:13:53Z")

</div>

Hi @adeil,

First, it’s always a good idea to quote your code with backticks ``` like this:

```julia
using Printf
v₀ = 3 # velocidade inicial
g = 9.81 # aceleração da gravidade
t = range(0,1, length=100) # 1000 pontos no intervalo de 0 a 1.
y= @.v₀t - 0.5g*t^2 # fórmula para calcular a altura
i = 1 #declarando uma variável global
while y[i] >= 0
global i+=1
#println(“t(s):”,@sprintf("%.3f",t[i]), " / y(m):",@sprintf("%.3f",y[i]))
DataFrame(tempo=t[i], posição=y[i])
end
println(df)
#plot(t,y)
#plot!(xlab=“Tempo (s)”, ylab=" Altura (m)")

```

Second, I _think_ this might be what you are trying to do?

```julia
using DataFrames
using Plots

v₀ = 3 
g = 9.81
t = range(0,1, length=100)
y = [v₀ * t - 0.5g * t^2 for t in t]

df = DataFrame(tempo=t, posição=y)

plot(t, y, xlab="Tempo (s)", ylab="Altura (m)", legend=false)

```

![fig](https://global.discourse-cdn.com/julialang/original/3X/9/c/9cbb93a2a76a426818b65d4657a74a2e3f2daf3a.png)

If this is the case, I’d suggest working through some of the Julia intro materials at [www.juliaacademy.com](http://www.juliaacademy.com) to flesh out your Julia toolbox a bit. That being said, keep asking questions here and have a look at this: [Please read: make it easier to help you - #10](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/10)

---

_[View the full topic](https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156)._
