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]]
Hi Did you define function ap? Cheers Petr> -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Frederic > Ntirenganya > Sent: Friday, March 24, 2017 1:18 PM > To: r-help at r-project.org > Subject: [R] Error: could not find function "ap" > > 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]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.________________________________ Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou ur?eny pouze jeho adres?t?m. Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a jeho kopie vyma?te ze sv?ho syst?mu. Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou modifikacemi ?i zpo?d?n?m p?enosu e-mailu. V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: - vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. - a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky ze strany p??jemce s dodatkem ?i odchylkou. - trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. - odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m zastoupen? zn?m?. This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients. If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system. If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner. The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email. In case that this e-mail forms part of business dealings: - the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning. - if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation. - the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects. - the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.
It seems like it is from sirad packages. Thanks for the help. Cheers 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/ On Fri, Mar 24, 2017 at 4:28 PM, PIKAL Petr <petr.pikal at precheza.cz> wrote:> Hi > > Did you define function ap? > > Cheers > Petr > > > -----Original Message----- > > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Frederic > > Ntirenganya > > Sent: Friday, March 24, 2017 1:18 PM > > To: r-help at r-project.org > > Subject: [R] Error: could not find function "ap" > > > > 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]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > > ________________________________ > Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou > ur?eny pouze jeho adres?t?m. > Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? > neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a jeho kopie > vyma?te ze sv?ho syst?mu. > Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento email > jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. > Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou modifikacemi > ?i zpo?d?n?m p?enosu e-mailu. > > V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: > - vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? > smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. > - a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? p?ijmout; > Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky ze strany > p??jemce s dodatkem ?i odchylkou. > - trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve > v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. > - odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za > spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? zmocn?n > nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly adres?tovi tohoto > emailu p??padn? osob?, kterou adres?t zastupuje, p?edlo?eny nebo jejich > existence je adres?tovi ?i osob? j?m zastoupen? zn?m?. > > This e-mail and any documents attached to it may be confidential and are > intended only for its intended recipients. > If you received this e-mail by mistake, please immediately inform its > sender. Delete the contents of this e-mail with all attachments and its > copies from your system. > If you are not the intended recipient of this e-mail, you are not > authorized to use, disseminate, copy or disclose this e-mail in any manner. > The sender of this e-mail shall not be liable for any possible damage > caused by modifications of the e-mail or by delay with transfer of the > email. > > In case that this e-mail forms part of business dealings: > - the sender reserves the right to end negotiations about entering into a > contract in any time, for any reason, and without stating any reasoning. > - if the e-mail contains an offer, the recipient is entitled to > immediately accept such offer; The sender of this e-mail (offer) excludes > any acceptance of the offer on the part of the recipient containing any > amendment or variation. > - the sender insists on that the respective contract is concluded only > upon an express mutual agreement on all its aspects. > - the sender of this e-mail informs that he/she is not authorized to enter > into any contracts on behalf of the company except for cases in which > he/she is expressly authorized to do so in writing, and such authorization > or power of attorney is submitted to the recipient or the person > represented by the recipient, or the existence of such authorization is > known to the recipient of the person represented by the recipient. >[[alternative HTML version deleted]]