[R] how to do interpolation
Hello R Users, How to make a variable equidistance with time i.e. how to interpolate a variable if it is not sampled at equal time interval. Many thanks, Regards, Yogesh [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] interpolation
Hello R Users, I am new to R and I have simple problem for R users. I have CO2 observations defined on time axis(yr,mo,day,hr,min,sec). (DATA ATTACHED HERE) First I want to convert time axis as one axis as 'hour' on regular interval as 1 hour. Say 00 hrs to 24hrs(jan1), 25hrs to 48hrs(jan2) and so on. Then I want to interpolate CO2 at every hour. Kindly anybody can help, Many thanks, Regards, Yogesh yr mo dy hr min sec co2obs 19981 9 0 35 24 365.19 19981 9 1 17 39 363.54 19981 9 1 58 41 364.24 19981 9 2 39 42 364.88 19981 9 3 20 43 365.06 19981 9 4 1 44 364.75 19981 9 4 42 45 364.77 19981 9 5 23 46 364.87 19981 9 6 4 51 364.77 19981 9 6 45 52 364.73 19981 9 7 26 54 364.76 19981 9 8 7 55 363.49 19981 23 1 6 16 364.31 19981 23 1 48 32 364.38 19981 23 2 29 33 364.67 19981 23 3 10 35 365.53 19981 23 3 51 36 365.16 19981 23 4 32 37 364.56 19981 23 5 13 40 364.62 19981 23 5 54 41 365.05 19981 23 6 35 42 365.13 19981 23 7 16 44 365.45 19981 23 7 57 49 364.77 19981 23 8 38 49 364.65 19982 3 0 44 21 362.43 19982 3 1 26 36 363.96 19982 3 2 7 38 364.59 19982 3 2 48 40 364.62 19982 3 3 29 40 366.22 19982 3 4 10 41 365.4 19982 3 4 51 41 365.34 19982 3 5 32 42 365.31 19982 3 6 13 44 364.84 19982 3 6 54 46 365.07 19982 3 7 35 51 364.84 19982 3 8 16 50 364.81 19982 19 0 35 14 363.41 19982 19 1 17 31 362.93 19982 19 1 58 32 363.86 19982 19 2 39 33 364.87 19982 19 3 20 34 366.05 19982 19 4 1 36 364.84 19982 19 4 42 36 364.77 19982 19 5 23 37 365.01 19982 19 6 4 39 365 19982 19 6 45 39 365.9 19982 19 7 26 40 366.24 19982 19 8 7 41 366.55 19983 5 0 50 20 363.13 19983 5 1 32 37 363.6 19983 5 2 13 39 364.26 19983 5 2 54 40 364.26 19983 5 3 35 41 364.39 19983 5 4 16 42 365.24 19983 5 4 57 42 365.48 19983 5 5 38 43 365.01 19983 5 6 19 44 365.43 19983 5 7 0 45 365.11 19983 5 7 41 46 368.54 19983 5 8 22 48 364.96 19983 19 0 46 36 363.25 19983 19 1 28 51 363.8 19983 19 2 9 53 364.21 19983 19 2 50 55 364.46 19983 19 3 31 58 365.61 19983 19 4 12 59 365.57 19983 19 4 53 59 365.53 19983 19 5 35 0 365.38 19983 19 6 16 3 366.23 19983 19 6 57 4 364.28 19983 19 7 38 6 367.08 19983 19 8 19 5 369.19 19984 2 1 8 1 363.76 19984 2 1 50 17 365.14 19984 2 2 31 18 365.26 19984 2 3 12 21 364.7 19984 2 3 53 24 364.04 19984 2 4 34 25 366.13 19984 2 5 15 25 366.11 19984 2 5 56 26 366.34 19984 2 6 37 27 367.9 19984 2 7 18 28 367.3 19984 2 7
[R] how to sub-sample a variable on another file coordinates
Hello 'R' Users, I have a monthly mean CO2 necdf data file defined on 1x1 lat by lon coordinate. I want to sub-sample this variable CO2 on the coordinates of another ASCII data file. The coordinates of another ASCII data file are as: -24.01 152.06 -18.58 150.19 -13.46 148.35 -8.29 147.03 -3.14 146.19 1.53 145.59 7.08 145.33 12.25 145.02 17.46 144.31 22.44 142.35 27.53 141.26 33.04 140.15 -23.49 152.07 -18.56 150.18 -13.41 150.14 -8.24 150.04 -3.07 149.21 2.05 148.31 7.19 147.45 12.37 147.03 17.53 146.21 22.56 144.47 28.04 143.38 32.54 142.26 Kindly anybody can help on this. Many thanks, Cheers, Yogesh [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to compute cross correlation
Hello R Users, How to compute cross correlation between two time series. Data is in ASCII format. I am using R on windows. Many thanks, Regards, Yogesh [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to convert decimal date to its equivalent date format(YYYY.mm.dd.hr.min.sec)
Hello R Users, How to convert decimal date to date as .mm.dd.hr.min.sec For example, I have decimal date in one column , and want to convert and write it in equivalent date(.mm.dd.hr.min.sec) in another next six columns. 1979.00 1979.020833 1979.041667 1979.062500 Is it possible in R ? Kindly help, Regards, Yogesh -- Dr. Yogesh K. Tiwari, Scientist, Indian Institute of Tropical Meteorology, Homi Bhabha Road, Pashan, Pune-411008 INDIA Phone: 0091-99 2273 9513 (Cell) : 0091-20-258 93 600 (O) (Ext.250) Fax: 0091-20-258 93 825 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problem in reading TOMS observed ASCII data file
Hello R Users, I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS ozone(O3). AOD data is on 1x1 grid and O3 data is on 5x5 grid. First I want to read AOD and O3 as it is and then I want to regrid AOD on 5x5 grid as O3. Reading is first problem. FIRST PROBLEM READING AOD: AOD data is in following format: # Latitute: 89.5 167 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 155 0 0 0 0 0 156 0 0 0 0 0 0 ... Latitude: 88.5 . Lat. . ... .. Latitude: -88.5 180 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 655 0 0 0 0 0 156 0 0 0 0 0 0 .. . ## After each latitude header there is 360 AOD values (1x1 grid). This is monthly mean data. I have many years of data file. So the first problem is how to read the data by omiting latitude header, also data is written along row not along column ? SECOND PROBLEM READING O3: O3 data is in following format: ozone(72,12,324) 72: Longitude -177.5,-172.5,...,177.5' 12: Latitude -27.5,-22.5,...,27.5' 324: Month Jan79,Feb79,,Dec05' ### Month index:0 20.8 22.1 20.0 19.0 16.3 20.0 24.4 23.5 27.9 23.7 0.0 32.4 21.6 23.8 20.4 17.9 16.0 22.2 25.3 25.1 31.1 27.4 0.0 30.3 23.2 23.9 20.7 17.3 16.5 23.1 25.9 25.4 30.4 29.3 0.0 29.9 26.1 24.7 21.3 15.9 16.8 22.8 25.3 25.8 29.8 30.1 0.0 31.6 -- Month index: 323 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - - # 12 columns and 72 rows (latitudexlongitude) THIRD PROBLEM regriding AOD: How to regrid 1x1 AOD data on 5x5 grid as O3. Many thanks for yours help. Regards, Yogesh -- Dr. Yogesh K. Tiwari, Scientist, Indian Institute of Tropical Meteorology, Homi Bhabha Road, Pashan, Pune-411008 INDIA Phone: 0091-99 2273 9513 (Cell) : 0091-20-258 93 600 (O) (Ext.250) Fax: 0091-20-258 93 825 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] need help in reading TOMS observed ASCII data file
Hello R Users, I am new to R. I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS ozone(O3). AOD data is on 1x1 grid and O3 data is on 5x5 grid. First I want to read AOD and O3 as it is and then I want to regrid AOD on 5x5 grid as O3. Reading is first problem. FIRST PROBLEM READING AOD: AOD data is in following format: # Latitute: 89.5 167 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 155 0 0 0 0 0 156 0 0 0 0 0 0 ... Latitude: 88.5 . Lat. . ... .. Latitude: -88.5 180 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 655 0 0 0 0 0 156 0 0 0 0 0 0 .. . ## After each latitude header there is 360 AOD values (1x1 grid). This is monthly mean data. I have many years of data file. So the first problem is how to read the data by omiting latitude header, also data is written along row not along column ? SECOND PROBLEM READING O3: O3 data is in following format: ozone(72,12,324) 72: Longitude -177.5,-172.5,...,177.5' 12: Latitude -27.5,-22.5,...,27.5' 324: Month Jan79,Feb79,,Dec05' ### Month index:0 20.8 22.1 20.0 19.0 16.3 20.0 24.4 23.5 27.9 23.7 0.0 32.4 21.6 23.8 20.4 17.9 16.0 22.2 25.3 25.1 31.1 27.4 0.0 30.3 23.2 23.9 20.7 17.3 16.5 23.1 25.9 25.4 30.4 29.3 0.0 29.9 26.1 24.7 21.3 15.9 16.8 22.8 25.3 25.8 29.8 30.1 0.0 31.6 -- Month index: 323 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.00.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - - # 12 columns and 72 rows (latitudexlongitude) THIRD PROBLEM regriding AOD: How to regrid 1x1 AOD data on 5x5 grid as O3. Many thanks for yours help. Regards, Yogesh -- Dr. Yogesh K. Tiwari, Scientist, Indian Institute of Tropical Meteorology, Homi Bhabha Road, Pashan, Pune-411008 INDIA Phone: 0091-99 2273 9513 (Cell) : 0091-20-258 93 600 (O) ( Ext.250) Fax: 0091-20-258 93 825 -- Dr. Yogesh K. Tiwari, Scientist 'B', Indian Institute of Tropical Meteorology, Homi Bhabha Road, Pashan, Pune-411008 INDIA Phone: 0091-99 2273 9513 (Cell) : 0091-20-258 93 600 (O) (Ext.250) Fax: 0091-20-258 93 825 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.