[R] Error: could not find function "ap"

Frederic Ntirenganya ntfredo at gmail.com
Fri Mar 24 13:18:09 CET 2017


Dear All,

I hope you are doing well.

I am new in using evapotranspiration packages and got the following error:

Error: could not find function "ap"

The code I am using and data are:

dat1<-read.csv("/home/fredo/Documents/Meteo Data/Meteo Rwa
data.csv",header=T,na.string="9999")
dat1$u.daily<-dat1$Wind.Speed*0.514444
dat1$Date<-as.Date(paste(dat1$Year,dat1$Month,dat1$Day,sep="-"))
#dat1$DOY<-dayOfYear(dat1$Date)
dat1$Longitude<-30.11
dat1$Latitude<--1.95
dat1$Elevation<-1490
dat1$RHmax.daily<-dat1$RHmax.daily
dat1$RHmin.daily<-dat1$RHmin.daily
dat1$Tmax.daily<-dat1$Tmax.daily
dat1$Tmin.daily<-dat1$Tmin.daily
#dat1<-subset(select=-Wind.direction.measured.in.Degrees)
Sunshine<-dat1$n.daily
lat<-as.numeric(dat1$Latitude)
lon<-as.numeric(dat1$Longitude)
days<-dat1$Date
require(zoo)
A <- 0.21
B <- 0.57
dat1$RS.daily<-ap(days,lat,lon,A,B,Sunshine,extraT=NULL)
View(dat1)



dput(head(dat1))
structure(list(Year = c(1984L, 1984L, 1984L, 1984L, 1984L, 1984L
), Month = c(1L, 1L, 1L, 1L, 1L, 1L), Day = 1:6, Wind.Speed = c(5L,
4L, 4L, 3L, 5L, 6L), n.daily = c(6.3, 4.8, 0.6, 8.2, 7.3, 1.7
), Tmax.daily = c(27.4, 26.3, 22.9, 27.7, 28.5, 25.5), Tmin.daily = c(14.5,
16, 14.4, 14.8, 16.6, 15.4), RHmax.daily = c(100L, 95L, 97L,
100L, 97L, 99L), RHmin.daily = c(45L, 62L, 72L, 55L, 54L, 63L
), Station.Name = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "KIGALI
AERO", class = "factor"),
    Elevation = c(1490, 1490, 1490, 1490, 1490, 1490), Longitude = c(30.11,
    30.11, 30.11, 30.11, 30.11, 30.11), Latitude = c(-1.95, -1.95,
    -1.95, -1.95, -1.95, -1.95), u.daily = c(2.57222, 2.057776,
    2.057776, 1.543332, 2.57222, 3.086664), Date = structure(c(5113,
    5114, 5115, 5116, 5117, 5118), class = "Date")), .Names = c("Year",
"Month", "Day", "Wind.Speed", "n.daily", "Tmax.daily", "Tmin.daily",
"RHmax.daily", "RHmin.daily", "Station.Name", "Elevation", "Longitude",
"Latitude", "u.daily", "Date"), row.names = c(NA, 6L), class = "data.frame")


I appreciate your help in advance!

Best regards,
Fredo.






Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fredo at aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/

	[[alternative HTML version deleted]]



More information about the R-help mailing list