How to Graph a subset of data in R

So I'm trying to graph using data using multiple crypto currencies from one excel sheet, But I don't know know how to select a subset of data and create a graph from that. for example, I have to create a graph based on the crypto currency ARK's closing data from 2017 to 2021. Could someone please help?

Crypto.data <- read.csv(file="Crypto-USD.csv", header=T) # reading the data file into R
View(Crypto.data)

Crypto.data <- ts(data = Crypto.data$Close, start = 2017,  frequency = 365) #making the data into timeseries format
plot(Crypto.data, main="Daily Closing ARK Stock Price")

Hi @ZootZoot,
Welcome to the RStudio Community Forum.

Try subsetting the dataframe, to include only the ARK values, before you create the time series:

Crypto_ARK <- ts(data = Crypto.data$Close[Crypto.data$CryptoCurrency == "ARK"], 
                  start = 2017, 
                  frequency = 365)
plot(Crypto_ARK, main="Daily Closing ARK Stock Price")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.