wapply is a powerful and flexible function to statistics weather records. It could be used to calculate multiple variables with different functions and different parameters for all levels in a certain period.

# S4 method for WeaAna
wapply(
  object,
  vars,
  period,
  FUN,
  ARGS = NULL,
  site.ARGS = NULL,
  res.name = "result",
  yrange = waGetPara("yrange"),
  as.data.frame = FALSE,
  extra = NULL
)

Arguments

object

A WeaAna objects.

vars

A variable vector to apply FUN.

period

A period to apply FUN. It could be one of "year", "month", "week", "day", or any number of day.

FUN

A function vector to be applied.

ARGS

Optional arguments to FUN.

site.ARGS

Arguments for each site

res.name

A result name to store and return.

yrange

Year range to statistics.

as.data.frame

Logical, if TRUE, a data frame will be returned, but just a period supported. if FALSE, a list will be returned.

extra

A list or data.frame whose elements have the same length of sites

Details

vars could be a vector to list all variables which need to calculate. Available variables could be obtained through function getAvaiVars.

period could be one of "year", "month", "week", "day", or any number of day. It will be complicated to the same length of vars.

FUN could be a vector. FUN will be replicated to the same length as vars. Each FUN will be applied to each vars as the sequence of vars.

Optional arguments args is a list which have the same length as FUN. Each element of args is the optional arguments for each FUN. Each argument will be replicated to same length as level number which determines by period. Then, each level will be passed to different parameter.

Examples

library(weaana) data( "records" ) # calculate yearly mean temperature wapply( records, vars = "avgt", period = "year", FUN = mean )
#> Name Number Latitude Longitude year result #> 1 DEMO Weather Site 1 0000001 -25 135 1957 20.27616 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 20.42938 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 19.57555 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 19.18668 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 19.17589 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 19.56144 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 19.41747 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 19.48736 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 19.84589 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 19.66110 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 19.69952 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 19.64706 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 19.47473 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 19.23137 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 19.17637 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 19.10137 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 20.67726 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 19.22685 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 19.50062 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 19.55519 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 20.32781 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 19.31856 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 20.08637 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 20.43115 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 20.00432 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 19.58014 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 19.69534 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 19.58327 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 19.53747 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 20.13384 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 20.17390 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 20.32876 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 19.72226 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 19.95500 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 20.49952 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 19.80546 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 20.64884 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 20.10486 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 20.47110 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 20.19822 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 20.41637 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 21.23890 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 19.44500 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 20.25567 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 20.49493 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 20.90384 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 19.58664 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 20.47992 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 20.96240 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 20.36945 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 20.46884 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 19.33996 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 20.58658 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 20.27616 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 20.42938 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 19.57555 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 19.18668 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 19.17589 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 19.56144 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 19.41747 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 19.48736 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 19.84589 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 19.66110 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 19.69952 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 19.64706 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 19.47473 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 19.23137 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 19.17637 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 19.10137 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 20.67726 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 19.22685 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 19.50062 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 19.55519 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 20.32781 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 19.31856 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 20.08637 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 20.43115 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 20.00432 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 19.58014 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 19.69534 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 19.58327 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 19.53747 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 20.13384 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 20.17390 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 20.32876 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 19.72226 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 19.95500 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 20.49952 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 19.80546 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 20.64884 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 20.10486 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 20.47110 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 20.19822 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 20.41637 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 21.23890 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 19.44500 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 20.25567 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 20.49493 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 20.90384 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 19.58664 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 20.47992 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 20.96240 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 20.36945 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 20.46884 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 19.33996 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 20.58658
# yealy total rainfall wapply( records, vars = "rain", period = "year", FUN = sum )
#> Name Number Latitude Longitude year result #> 1 DEMO Weather Site 1 0000001 -25 135 1957 1446.5 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 1837.0 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 1934.6 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 1612.0 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 1532.0 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 1675.0 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 1803.9 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 1992.4 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 1613.1 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 1704.5 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 1819.9 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 1519.6 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 1749.8 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 1778.9 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 1830.7 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 1866.6 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 2148.3 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 1940.7 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 1768.7 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 1530.5 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 1359.2 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 1921.1 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 1594.2 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 1456.0 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 1829.4 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 1742.0 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 1881.1 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 1654.0 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 1716.6 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 1312.2 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 1478.3 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 1884.9 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 1732.8 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 1697.4 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 1485.4 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 1838.5 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 1160.9 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 1378.8 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 1667.1 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 2165.4 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 1459.5 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 1563.4 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 2000.5 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 1363.1 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 1473.7 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 1543.3 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 1586.9 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 1673.7 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 1426.2 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 1473.1 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 1498.9 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 1902.5 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 1459.7 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 1446.5 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 1837.0 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 1934.6 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 1612.0 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 1532.0 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 1675.0 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 1803.9 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 1992.4 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 1613.1 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 1704.5 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 1819.9 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 1519.6 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 1749.8 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 1778.9 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 1830.7 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 1866.6 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 2148.3 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 1940.7 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 1768.7 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 1530.5 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 1359.2 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 1921.1 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 1594.2 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 1456.0 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 1829.4 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 1742.0 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 1881.1 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 1654.0 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 1716.6 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 1312.2 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 1478.3 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 1884.9 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 1732.8 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 1697.4 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 1485.4 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 1838.5 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 1160.9 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 1378.8 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 1667.1 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 2165.4 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 1459.5 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 1563.4 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 2000.5 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 1363.1 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 1473.7 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 1543.3 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 1586.9 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 1673.7 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 1426.2 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 1473.1 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 1498.9 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 1902.5 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 1459.7
# yearly mean temperature wapply( records, vars = "avgt", period = "year", FUN = mean )
#> Name Number Latitude Longitude year result #> 1 DEMO Weather Site 1 0000001 -25 135 1957 20.27616 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 20.42938 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 19.57555 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 19.18668 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 19.17589 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 19.56144 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 19.41747 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 19.48736 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 19.84589 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 19.66110 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 19.69952 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 19.64706 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 19.47473 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 19.23137 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 19.17637 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 19.10137 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 20.67726 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 19.22685 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 19.50062 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 19.55519 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 20.32781 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 19.31856 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 20.08637 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 20.43115 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 20.00432 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 19.58014 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 19.69534 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 19.58327 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 19.53747 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 20.13384 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 20.17390 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 20.32876 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 19.72226 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 19.95500 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 20.49952 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 19.80546 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 20.64884 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 20.10486 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 20.47110 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 20.19822 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 20.41637 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 21.23890 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 19.44500 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 20.25567 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 20.49493 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 20.90384 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 19.58664 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 20.47992 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 20.96240 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 20.36945 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 20.46884 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 19.33996 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 20.58658 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 20.27616 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 20.42938 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 19.57555 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 19.18668 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 19.17589 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 19.56144 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 19.41747 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 19.48736 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 19.84589 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 19.66110 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 19.69952 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 19.64706 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 19.47473 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 19.23137 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 19.17637 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 19.10137 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 20.67726 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 19.22685 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 19.50062 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 19.55519 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 20.32781 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 19.31856 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 20.08637 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 20.43115 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 20.00432 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 19.58014 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 19.69534 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 19.58327 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 19.53747 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 20.13384 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 20.17390 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 20.32876 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 19.72226 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 19.95500 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 20.49952 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 19.80546 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 20.64884 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 20.10486 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 20.47110 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 20.19822 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 20.41637 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 21.23890 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 19.44500 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 20.25567 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 20.49493 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 20.90384 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 19.58664 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 20.47992 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 20.96240 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 20.36945 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 20.46884 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 19.33996 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 20.58658
# monthly mean temperature wapply( records, vars = "avgt", period = "month", FUN = mean )
#> Name Number Latitude Longitude month result #> 1 DEMO Weather Site 1 0000001 -25 135 1 25.26360 #> 2 DEMO Weather Site 1 0000001 -25 135 2 24.94546 #> 3 DEMO Weather Site 1 0000001 -25 135 3 23.49793 #> 4 DEMO Weather Site 1 0000001 -25 135 4 20.61453 #> 5 DEMO Weather Site 1 0000001 -25 135 5 17.09883 #> 6 DEMO Weather Site 1 0000001 -25 135 6 14.44621 #> 7 DEMO Weather Site 1 0000001 -25 135 7 13.34705 #> 8 DEMO Weather Site 1 0000001 -25 135 8 14.63457 #> 9 DEMO Weather Site 1 0000001 -25 135 9 17.63808 #> 10 DEMO Weather Site 1 0000001 -25 135 10 20.60700 #> 11 DEMO Weather Site 1 0000001 -25 135 11 22.87745 #> 12 DEMO Weather Site 1 0000001 -25 135 12 24.67176 #> 13 DEMO Weather Site 2 0000002 -25 130 1 25.26360 #> 14 DEMO Weather Site 2 0000002 -25 130 2 24.94546 #> 15 DEMO Weather Site 2 0000002 -25 130 3 23.49793 #> 16 DEMO Weather Site 2 0000002 -25 130 4 20.61453 #> 17 DEMO Weather Site 2 0000002 -25 130 5 17.09883 #> 18 DEMO Weather Site 2 0000002 -25 130 6 14.44621 #> 19 DEMO Weather Site 2 0000002 -25 130 7 13.34705 #> 20 DEMO Weather Site 2 0000002 -25 130 8 14.63457 #> 21 DEMO Weather Site 2 0000002 -25 130 9 17.63808 #> 22 DEMO Weather Site 2 0000002 -25 130 10 20.60700 #> 23 DEMO Weather Site 2 0000002 -25 130 11 22.87745 #> 24 DEMO Weather Site 2 0000002 -25 130 12 24.67176
# 10 days mean temperature wapply( records, vars = "avgt", period = 10, FUN = mean )
#> Name Number Latitude Longitude X10 result #> 1 DEMO Weather Site 1 0000001 -25 135 1 24.94175 #> 2 DEMO Weather Site 1 0000001 -25 135 2 25.28580 #> 3 DEMO Weather Site 1 0000001 -25 135 3 25.52953 #> 4 DEMO Weather Site 1 0000001 -25 135 4 25.13717 #> 5 DEMO Weather Site 1 0000001 -25 135 5 24.97142 #> 6 DEMO Weather Site 1 0000001 -25 135 6 24.73316 #> 7 DEMO Weather Site 1 0000001 -25 135 7 24.05142 #> 8 DEMO Weather Site 1 0000001 -25 135 8 23.43401 #> 9 DEMO Weather Site 1 0000001 -25 135 9 22.98972 #> 10 DEMO Weather Site 1 0000001 -25 135 10 21.78118 #> 11 DEMO Weather Site 1 0000001 -25 135 11 20.39255 #> 12 DEMO Weather Site 1 0000001 -25 135 12 19.77014 #> 13 DEMO Weather Site 1 0000001 -25 135 13 18.43613 #> 14 DEMO Weather Site 1 0000001 -25 135 14 17.25514 #> 15 DEMO Weather Site 1 0000001 -25 135 15 15.85726 #> 16 DEMO Weather Site 1 0000001 -25 135 16 15.39486 #> 17 DEMO Weather Site 1 0000001 -25 135 17 14.26061 #> 18 DEMO Weather Site 1 0000001 -25 135 18 13.85958 #> 19 DEMO Weather Site 1 0000001 -25 135 19 13.49443 #> 20 DEMO Weather Site 1 0000001 -25 135 20 13.12877 #> 21 DEMO Weather Site 1 0000001 -25 135 21 13.42387 #> 22 DEMO Weather Site 1 0000001 -25 135 22 14.02863 #> 23 DEMO Weather Site 1 0000001 -25 135 23 14.33090 #> 24 DEMO Weather Site 1 0000001 -25 135 24 15.00118 #> 25 DEMO Weather Site 1 0000001 -25 135 25 16.11623 #> 26 DEMO Weather Site 1 0000001 -25 135 26 17.05245 #> 27 DEMO Weather Site 1 0000001 -25 135 27 18.53538 #> 28 DEMO Weather Site 1 0000001 -25 135 28 19.70042 #> 29 DEMO Weather Site 1 0000001 -25 135 29 20.34892 #> 30 DEMO Weather Site 1 0000001 -25 135 30 20.90307 #> 31 DEMO Weather Site 1 0000001 -25 135 31 21.96844 #> 32 DEMO Weather Site 1 0000001 -25 135 32 22.63816 #> 33 DEMO Weather Site 1 0000001 -25 135 33 23.06495 #> 34 DEMO Weather Site 1 0000001 -25 135 34 24.14594 #> 35 DEMO Weather Site 1 0000001 -25 135 35 24.31769 #> 36 DEMO Weather Site 1 0000001 -25 135 36 24.74264 #> 37 DEMO Weather Site 1 0000001 -25 135 37 25.62068 #> 38 DEMO Weather Site 2 0000002 -25 130 1 24.94175 #> 39 DEMO Weather Site 2 0000002 -25 130 2 25.28580 #> 40 DEMO Weather Site 2 0000002 -25 130 3 25.52953 #> 41 DEMO Weather Site 2 0000002 -25 130 4 25.13717 #> 42 DEMO Weather Site 2 0000002 -25 130 5 24.97142 #> 43 DEMO Weather Site 2 0000002 -25 130 6 24.73316 #> 44 DEMO Weather Site 2 0000002 -25 130 7 24.05142 #> 45 DEMO Weather Site 2 0000002 -25 130 8 23.43401 #> 46 DEMO Weather Site 2 0000002 -25 130 9 22.98972 #> 47 DEMO Weather Site 2 0000002 -25 130 10 21.78118 #> 48 DEMO Weather Site 2 0000002 -25 130 11 20.39255 #> 49 DEMO Weather Site 2 0000002 -25 130 12 19.77014 #> 50 DEMO Weather Site 2 0000002 -25 130 13 18.43613 #> 51 DEMO Weather Site 2 0000002 -25 130 14 17.25514 #> 52 DEMO Weather Site 2 0000002 -25 130 15 15.85726 #> 53 DEMO Weather Site 2 0000002 -25 130 16 15.39486 #> 54 DEMO Weather Site 2 0000002 -25 130 17 14.26061 #> 55 DEMO Weather Site 2 0000002 -25 130 18 13.85958 #> 56 DEMO Weather Site 2 0000002 -25 130 19 13.49443 #> 57 DEMO Weather Site 2 0000002 -25 130 20 13.12877 #> 58 DEMO Weather Site 2 0000002 -25 130 21 13.42387 #> 59 DEMO Weather Site 2 0000002 -25 130 22 14.02863 #> 60 DEMO Weather Site 2 0000002 -25 130 23 14.33090 #> 61 DEMO Weather Site 2 0000002 -25 130 24 15.00118 #> 62 DEMO Weather Site 2 0000002 -25 130 25 16.11623 #> 63 DEMO Weather Site 2 0000002 -25 130 26 17.05245 #> 64 DEMO Weather Site 2 0000002 -25 130 27 18.53538 #> 65 DEMO Weather Site 2 0000002 -25 130 28 19.70042 #> 66 DEMO Weather Site 2 0000002 -25 130 29 20.34892 #> 67 DEMO Weather Site 2 0000002 -25 130 30 20.90307 #> 68 DEMO Weather Site 2 0000002 -25 130 31 21.96844 #> 69 DEMO Weather Site 2 0000002 -25 130 32 22.63816 #> 70 DEMO Weather Site 2 0000002 -25 130 33 23.06495 #> 71 DEMO Weather Site 2 0000002 -25 130 34 24.14594 #> 72 DEMO Weather Site 2 0000002 -25 130 35 24.31769 #> 73 DEMO Weather Site 2 0000002 -25 130 36 24.74264 #> 74 DEMO Weather Site 2 0000002 -25 130 37 25.62068
# yearly mean temperature, total raifall and mean radiation. wapply( records, vars = c( "avgt", "rain", "radn" ), period = "year", FUN = c( mean, sum ), res.name = c( "mean.avgt", "total.rain", "mean.radn" ) )
#> $mean.avgt #> Name Number Latitude Longitude year mean.avgt #> 1 DEMO Weather Site 1 0000001 -25 135 1957 20.27616 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 20.42938 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 19.57555 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 19.18668 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 19.17589 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 19.56144 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 19.41747 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 19.48736 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 19.84589 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 19.66110 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 19.69952 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 19.64706 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 19.47473 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 19.23137 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 19.17637 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 19.10137 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 20.67726 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 19.22685 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 19.50062 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 19.55519 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 20.32781 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 19.31856 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 20.08637 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 20.43115 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 20.00432 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 19.58014 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 19.69534 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 19.58327 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 19.53747 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 20.13384 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 20.17390 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 20.32876 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 19.72226 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 19.95500 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 20.49952 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 19.80546 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 20.64884 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 20.10486 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 20.47110 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 20.19822 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 20.41637 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 21.23890 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 19.44500 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 20.25567 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 20.49493 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 20.90384 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 19.58664 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 20.47992 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 20.96240 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 20.36945 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 20.46884 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 19.33996 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 20.58658 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 20.27616 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 20.42938 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 19.57555 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 19.18668 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 19.17589 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 19.56144 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 19.41747 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 19.48736 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 19.84589 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 19.66110 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 19.69952 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 19.64706 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 19.47473 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 19.23137 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 19.17637 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 19.10137 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 20.67726 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 19.22685 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 19.50062 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 19.55519 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 20.32781 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 19.31856 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 20.08637 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 20.43115 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 20.00432 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 19.58014 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 19.69534 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 19.58327 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 19.53747 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 20.13384 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 20.17390 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 20.32876 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 19.72226 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 19.95500 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 20.49952 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 19.80546 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 20.64884 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 20.10486 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 20.47110 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 20.19822 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 20.41637 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 21.23890 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 19.44500 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 20.25567 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 20.49493 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 20.90384 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 19.58664 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 20.47992 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 20.96240 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 20.36945 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 20.46884 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 19.33996 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 20.58658 #> #> $total.rain #> Name Number Latitude Longitude year total.rain #> 1 DEMO Weather Site 1 0000001 -25 135 1957 1446.5 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 1837.0 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 1934.6 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 1612.0 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 1532.0 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 1675.0 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 1803.9 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 1992.4 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 1613.1 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 1704.5 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 1819.9 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 1519.6 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 1749.8 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 1778.9 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 1830.7 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 1866.6 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 2148.3 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 1940.7 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 1768.7 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 1530.5 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 1359.2 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 1921.1 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 1594.2 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 1456.0 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 1829.4 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 1742.0 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 1881.1 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 1654.0 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 1716.6 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 1312.2 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 1478.3 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 1884.9 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 1732.8 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 1697.4 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 1485.4 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 1838.5 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 1160.9 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 1378.8 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 1667.1 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 2165.4 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 1459.5 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 1563.4 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 2000.5 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 1363.1 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 1473.7 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 1543.3 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 1586.9 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 1673.7 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 1426.2 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 1473.1 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 1498.9 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 1902.5 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 1459.7 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 1446.5 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 1837.0 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 1934.6 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 1612.0 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 1532.0 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 1675.0 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 1803.9 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 1992.4 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 1613.1 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 1704.5 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 1819.9 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 1519.6 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 1749.8 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 1778.9 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 1830.7 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 1866.6 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 2148.3 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 1940.7 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 1768.7 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 1530.5 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 1359.2 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 1921.1 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 1594.2 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 1456.0 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 1829.4 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 1742.0 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 1881.1 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 1654.0 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 1716.6 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 1312.2 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 1478.3 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 1884.9 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 1732.8 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 1697.4 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 1485.4 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 1838.5 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 1160.9 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 1378.8 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 1667.1 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 2165.4 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 1459.5 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 1563.4 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 2000.5 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 1363.1 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 1473.7 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 1543.3 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 1586.9 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 1673.7 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 1426.2 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 1473.1 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 1498.9 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 1902.5 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 1459.7 #> #> $mean.radn #> Name Number Latitude Longitude year mean.radn #> 1 DEMO Weather Site 1 0000001 -25 135 1957 19.52603 #> 2 DEMO Weather Site 1 0000001 -25 135 1958 18.90137 #> 3 DEMO Weather Site 1 0000001 -25 135 1959 18.01644 #> 4 DEMO Weather Site 1 0000001 -25 135 1960 18.99180 #> 5 DEMO Weather Site 1 0000001 -25 135 1961 18.85205 #> 6 DEMO Weather Site 1 0000001 -25 135 1962 18.53699 #> 7 DEMO Weather Site 1 0000001 -25 135 1963 18.24658 #> 8 DEMO Weather Site 1 0000001 -25 135 1964 18.78962 #> 9 DEMO Weather Site 1 0000001 -25 135 1965 19.20274 #> 10 DEMO Weather Site 1 0000001 -25 135 1966 19.48493 #> 11 DEMO Weather Site 1 0000001 -25 135 1967 18.83288 #> 12 DEMO Weather Site 1 0000001 -25 135 1968 18.90984 #> 13 DEMO Weather Site 1 0000001 -25 135 1969 18.71507 #> 14 DEMO Weather Site 1 0000001 -25 135 1970 18.36164 #> 15 DEMO Weather Site 1 0000001 -25 135 1971 17.95616 #> 16 DEMO Weather Site 1 0000001 -25 135 1972 18.90984 #> 17 DEMO Weather Site 1 0000001 -25 135 1973 17.87123 #> 18 DEMO Weather Site 1 0000001 -25 135 1974 17.93699 #> 19 DEMO Weather Site 1 0000001 -25 135 1975 17.94521 #> 20 DEMO Weather Site 1 0000001 -25 135 1976 18.26230 #> 21 DEMO Weather Site 1 0000001 -25 135 1977 19.24932 #> 22 DEMO Weather Site 1 0000001 -25 135 1978 17.93425 #> 23 DEMO Weather Site 1 0000001 -25 135 1979 19.04658 #> 24 DEMO Weather Site 1 0000001 -25 135 1980 19.33607 #> 25 DEMO Weather Site 1 0000001 -25 135 1981 18.89589 #> 26 DEMO Weather Site 1 0000001 -25 135 1982 18.69589 #> 27 DEMO Weather Site 1 0000001 -25 135 1983 18.18356 #> 28 DEMO Weather Site 1 0000001 -25 135 1984 18.06284 #> 29 DEMO Weather Site 1 0000001 -25 135 1985 18.40822 #> 30 DEMO Weather Site 1 0000001 -25 135 1986 19.19452 #> 31 DEMO Weather Site 1 0000001 -25 135 1987 18.46301 #> 32 DEMO Weather Site 1 0000001 -25 135 1988 18.88798 #> 33 DEMO Weather Site 1 0000001 -25 135 1989 18.04384 #> 34 DEMO Weather Site 1 0000001 -25 135 1990 18.73973 #> 35 DEMO Weather Site 1 0000001 -25 135 1991 19.44932 #> 36 DEMO Weather Site 1 0000001 -25 135 1992 19.03279 #> 37 DEMO Weather Site 1 0000001 -25 135 1993 18.93699 #> 38 DEMO Weather Site 1 0000001 -25 135 1994 19.39726 #> 39 DEMO Weather Site 1 0000001 -25 135 1995 18.99178 #> 40 DEMO Weather Site 1 0000001 -25 135 1996 19.13115 #> 41 DEMO Weather Site 1 0000001 -25 135 1997 19.29041 #> 42 DEMO Weather Site 1 0000001 -25 135 1998 18.37534 #> 43 DEMO Weather Site 1 0000001 -25 135 1999 18.16164 #> 44 DEMO Weather Site 1 0000001 -25 135 2000 18.63388 #> 45 DEMO Weather Site 1 0000001 -25 135 2001 19.16438 #> 46 DEMO Weather Site 1 0000001 -25 135 2002 19.84658 #> 47 DEMO Weather Site 1 0000001 -25 135 2003 18.86849 #> 48 DEMO Weather Site 1 0000001 -25 135 2004 19.21585 #> 49 DEMO Weather Site 1 0000001 -25 135 2005 19.15342 #> 50 DEMO Weather Site 1 0000001 -25 135 2006 19.19452 #> 51 DEMO Weather Site 1 0000001 -25 135 2007 18.60822 #> 52 DEMO Weather Site 1 0000001 -25 135 2008 18.17760 #> 53 DEMO Weather Site 1 0000001 -25 135 2009 19.05479 #> 54 DEMO Weather Site 2 0000002 -25 130 1957 19.52603 #> 55 DEMO Weather Site 2 0000002 -25 130 1958 18.90137 #> 56 DEMO Weather Site 2 0000002 -25 130 1959 18.01644 #> 57 DEMO Weather Site 2 0000002 -25 130 1960 18.99180 #> 58 DEMO Weather Site 2 0000002 -25 130 1961 18.85205 #> 59 DEMO Weather Site 2 0000002 -25 130 1962 18.53699 #> 60 DEMO Weather Site 2 0000002 -25 130 1963 18.24658 #> 61 DEMO Weather Site 2 0000002 -25 130 1964 18.78962 #> 62 DEMO Weather Site 2 0000002 -25 130 1965 19.20274 #> 63 DEMO Weather Site 2 0000002 -25 130 1966 19.48493 #> 64 DEMO Weather Site 2 0000002 -25 130 1967 18.83288 #> 65 DEMO Weather Site 2 0000002 -25 130 1968 18.90984 #> 66 DEMO Weather Site 2 0000002 -25 130 1969 18.71507 #> 67 DEMO Weather Site 2 0000002 -25 130 1970 18.36164 #> 68 DEMO Weather Site 2 0000002 -25 130 1971 17.95616 #> 69 DEMO Weather Site 2 0000002 -25 130 1972 18.90984 #> 70 DEMO Weather Site 2 0000002 -25 130 1973 17.87123 #> 71 DEMO Weather Site 2 0000002 -25 130 1974 17.93699 #> 72 DEMO Weather Site 2 0000002 -25 130 1975 17.94521 #> 73 DEMO Weather Site 2 0000002 -25 130 1976 18.26230 #> 74 DEMO Weather Site 2 0000002 -25 130 1977 19.24932 #> 75 DEMO Weather Site 2 0000002 -25 130 1978 17.93425 #> 76 DEMO Weather Site 2 0000002 -25 130 1979 19.04658 #> 77 DEMO Weather Site 2 0000002 -25 130 1980 19.33607 #> 78 DEMO Weather Site 2 0000002 -25 130 1981 18.89589 #> 79 DEMO Weather Site 2 0000002 -25 130 1982 18.69589 #> 80 DEMO Weather Site 2 0000002 -25 130 1983 18.18356 #> 81 DEMO Weather Site 2 0000002 -25 130 1984 18.06284 #> 82 DEMO Weather Site 2 0000002 -25 130 1985 18.40822 #> 83 DEMO Weather Site 2 0000002 -25 130 1986 19.19452 #> 84 DEMO Weather Site 2 0000002 -25 130 1987 18.46301 #> 85 DEMO Weather Site 2 0000002 -25 130 1988 18.88798 #> 86 DEMO Weather Site 2 0000002 -25 130 1989 18.04384 #> 87 DEMO Weather Site 2 0000002 -25 130 1990 18.73973 #> 88 DEMO Weather Site 2 0000002 -25 130 1991 19.44932 #> 89 DEMO Weather Site 2 0000002 -25 130 1992 19.03279 #> 90 DEMO Weather Site 2 0000002 -25 130 1993 18.93699 #> 91 DEMO Weather Site 2 0000002 -25 130 1994 19.39726 #> 92 DEMO Weather Site 2 0000002 -25 130 1995 18.99178 #> 93 DEMO Weather Site 2 0000002 -25 130 1996 19.13115 #> 94 DEMO Weather Site 2 0000002 -25 130 1997 19.29041 #> 95 DEMO Weather Site 2 0000002 -25 130 1998 18.37534 #> 96 DEMO Weather Site 2 0000002 -25 130 1999 18.16164 #> 97 DEMO Weather Site 2 0000002 -25 130 2000 18.63388 #> 98 DEMO Weather Site 2 0000002 -25 130 2001 19.16438 #> 99 DEMO Weather Site 2 0000002 -25 130 2002 19.84658 #> 100 DEMO Weather Site 2 0000002 -25 130 2003 18.86849 #> 101 DEMO Weather Site 2 0000002 -25 130 2004 19.21585 #> 102 DEMO Weather Site 2 0000002 -25 130 2005 19.15342 #> 103 DEMO Weather Site 2 0000002 -25 130 2006 19.19452 #> 104 DEMO Weather Site 2 0000002 -25 130 2007 18.60822 #> 105 DEMO Weather Site 2 0000002 -25 130 2008 18.17760 #> 106 DEMO Weather Site 2 0000002 -25 130 2009 19.05479 #>
# calculate thermal time from last frost day to first heat day for year range 1960 to 2009 last.frost <- lastFrostDay( records, yrange = c( 1960, 2009 ) ) first.heat <- firstHeatDay( records, yrange = c( 1960, 2009 ) ) wapply( records, vars = "avgt", period = "year", FUN = function ( x, start, end, base = 0 ) { if ( is.na( start ) | is.na( end ) ) { return( NA ) } else { x <- x[ seq( start, end )] x <- x[ x > base ] - base return( sum( x, na.rm = TRUE ) ) } }, ARGS = list( list( start = last.frost[,6], end = first.heat[,6] ) ), res.name = "tt", yrange = c( 1960, 2009 ) )
#> Name Number Latitude Longitude year tt #> 1 DEMO Weather Site 1 0000001 -25 135 1960 933.95 #> 2 DEMO Weather Site 1 0000001 -25 135 2009 521.50 #> 3 DEMO Weather Site 2 0000002 -25 130 1960 933.95 #> 4 DEMO Weather Site 2 0000002 -25 130 2009 521.50