Using R, how do I make a data column as a data index? Suppose I read my data from a CSV file. One of the columns is called Date, and I want to make this column the index of my frame.
For example, in Python, NumPy, Pandas; I would do the following:
df = pd.read_csv('/mydata.csv') d = df.set_index('Date')
Now how to do it in R?
I tried in R:
df <- read.csv("/mydata.csv") d <- data.frame(V1=df['Date'])
r
brno792
source share