R/print.R

Defines functions print.weather

Documented in print.weather

#' S3 print weather
#' 
#' Print the weather. 
#' 
#' @param x An object of class "weather".
#' @param ... other arguments.
#' 
#' @export


print.weather<-function(x,...){
    wind<-base::round(x$current$wind_speed/3.6,2)
    base::cat("Country:",x$location$country,"\n",
              "City:",x$location$name,"\n",
              "Local time:",x$location$localtime,"\n",
              "Temperature:",x$current$temperature,"degree celsius\n",
              "Weather descriptions:",x$current$weather_descriptions,"\n",
              "Wind speed:",wind,"m/s")
}
harjew/lab5G3 documentation built on Nov. 4, 2019, 1:28 p.m.