I am new to R and I want to know how to write a code for my following question. I have excel file in the following format. 1. I want to create a time series from first 4 column, each and every column represent year, month, date, time(hours) 2. Plot the time series against 2 stations that I have (X991 and X5779) Note: first raw indicate what type of time seris (Temperature), second raw is height of the station, third row is X coordinate, fourth row is Y coordinate and fifth row is station name (X991, X5779), therfore i want to skip these rows and plot my time series
我是R的新手,我想知道如何为我的后续问题编写代码。我有以下格式的excel文件。 1.我想从前4列创建一个时间序列,每列代表年,月,日,时(小时)2。绘制我所拥有的2个站的时间序列(X991和X5779)注意:第一个原始指示什么类型的时间系列(温度),第二个原始是站的高度,第三行是X坐标,第四行是Y坐标,第五行是站名(X991,X5779),因此我想跳过这些行和绘图我的时间序列
can anyone please help me with this
任何人都可以帮我这个
Temperature
YY MM DD HH 365 877
YY MM DD HH 50.9117 50.7314
YY MM DD HH 13.7087 13.7516
YY MM DD HH X991 X5779
2000 1 1 0 -9999 -4.3
2000 1 1 1 -9999 -4.3
2000 1 1 2 -9999 -4.1
2000 1 1 3 -9999 -4.1
2000 1 1 4 -9999 -4.4
2000 1 1 5 -9999 -4.2
2000 1 1 6 -9999 -4
2000 1 1 7 -9999 -3.9
2000 1 1 8 -9999 -3.8
2000 1 1 9 -9999 -3.7
2000 1 1 10 -9999 -3.5
2000 1 1 11 -9999 -3.1
2000 1 1 12 -9999 -2.7
2000 1 1 13 -9999 -2.5
2000 1 1 14 -9999 -2.4
1 个解决方案
#1
1
There is a lot here....
这里有很多......
First off, welcome to Stack Overflow. This community can be very helpful...but you have to learn how to get the most out of it. Check out this page https://*.com/help/how-to-ask.
首先,欢迎来到Stack Overflow。这个社区可能非常有用......但你必须学习如何充分利用它。看看这个页面https://*.com/help/how-to-ask。
The problem with your question is that you are asking several different questions here...and are unlikely to have somebody answer them all for you.
你的问题的问题是你在这里问了几个不同的问题......并且不太可能有人为你回答这些问题。
Here are the different questions you are asking, and some resources that will get you started. Once you attempt these pieces, and get stuck, you can ask again about a SPECIFIC piece...including what you have tried already.
以下是您要问的不同问题,以及一些可以帮助您入门的资源。一旦你尝试了这些碎片并卡住了,你可以再次询问一个特定的部分......包括你已经尝试过的部分。
- Getting data into R. I would first delete the unnecessary rows in Excel...will be much easier. Then import your data into R
- 将数据导入R.我首先要删除Excel中不必要的行...会更容易。然后将数据导入R
将.xlsx文件导入R
- Next, you need to concatenate the fields into a
datetime
value...these pages will help you. - 接下来,您需要将字段连接到日期时间值...这些页面将帮助您。
Merge three different columns into a date in R
将三个不同的列合并为R中的日期
R tick data : merging date and time into a single object
R tick数据:将日期和时间合并为单个对象
- In R, time series analysis requires a
ts
object to be created. This page will help you do that. - 在R中,时间序列分析需要创建ts对象。此页面将帮助您做到这一点。
How to Create a R TimeSeries for Hourly data
如何为每小时数据创建R TimeSeries
- Then, you are ready to start you r time series analysis....here is a good guide to time series in R
- 然后,你准备开始你的时间序列分析......这里是R的时间序列的一个很好的指南
http://www.statmethods.net/advstats/timeseries.html
http://www.statmethods.net/advstats/timeseries.html
Good luck!
祝你好运!
#1
1
There is a lot here....
这里有很多......
First off, welcome to Stack Overflow. This community can be very helpful...but you have to learn how to get the most out of it. Check out this page https://*.com/help/how-to-ask.
首先,欢迎来到Stack Overflow。这个社区可能非常有用......但你必须学习如何充分利用它。看看这个页面https://*.com/help/how-to-ask。
The problem with your question is that you are asking several different questions here...and are unlikely to have somebody answer them all for you.
你的问题的问题是你在这里问了几个不同的问题......并且不太可能有人为你回答这些问题。
Here are the different questions you are asking, and some resources that will get you started. Once you attempt these pieces, and get stuck, you can ask again about a SPECIFIC piece...including what you have tried already.
以下是您要问的不同问题,以及一些可以帮助您入门的资源。一旦你尝试了这些碎片并卡住了,你可以再次询问一个特定的部分......包括你已经尝试过的部分。
- Getting data into R. I would first delete the unnecessary rows in Excel...will be much easier. Then import your data into R
- 将数据导入R.我首先要删除Excel中不必要的行...会更容易。然后将数据导入R
将.xlsx文件导入R
- Next, you need to concatenate the fields into a
datetime
value...these pages will help you. - 接下来,您需要将字段连接到日期时间值...这些页面将帮助您。
Merge three different columns into a date in R
将三个不同的列合并为R中的日期
R tick data : merging date and time into a single object
R tick数据:将日期和时间合并为单个对象
- In R, time series analysis requires a
ts
object to be created. This page will help you do that. - 在R中,时间序列分析需要创建ts对象。此页面将帮助您做到这一点。
How to Create a R TimeSeries for Hourly data
如何为每小时数据创建R TimeSeries
- Then, you are ready to start you r time series analysis....here is a good guide to time series in R
- 然后,你准备开始你的时间序列分析......这里是R的时间序列的一个很好的指南
http://www.statmethods.net/advstats/timeseries.html
http://www.statmethods.net/advstats/timeseries.html
Good luck!
祝你好运!