I imported a csv file and I need to filter a row from the data frame. Then I need to take the number of death as a time series, i.e., s_1, s_2, s_3, s_4, ..., s_n, group the data into consecutive triples (s_1, s_2, s_3), (s_2, s_3, s_4), (s_3, s_4, s_5), etc. And plot the first two values as x and y coordinates and the third value as z coordinate.

My code is:
setwd("E:/COVID.UG/COVID-19-master/COVID-19 master/csse_covid_19_data/csse_covid_19_time_series")

Is it the way it should be? Also, could you in shortcut walk me through how you solved it? I do not understand it completely! Again, thank you so much for taking your time to help me! I greatly appreciate it!

you plotted my data , but not yours.
If you are very much a beginner in R, then there's not many better ways to learn than sitting an reading an appropriate book.

If you don't mind to answer, I have a few questions about this code:
1.When I try to filter the data frame to extract the row for "New York" in D, I get a integer instead of a data frame. Why do you think this happens?
2. I need to then convert this vector to a matrix/dataframe of 3 consecutive values and plot them as a 3D scatterplot. Could you clarify how you did that using the lead function?
I am sorry for bothering you with these questions but I am stuck so I had to ask.