qgis_algorithm_search_by_word.R 981 B

12345678910111213141516171819202122232425262728293031
  1. #' QGIS-i algoritmi leidmine fraasi järele
  2. #'
  3. #' Funktsioon leiab fraasi järele QGIS-i algoritmid.
  4. #' @param str string otsitav algoritmi fraas.
  5. #' @return Table found algorithms. Help for the selected algorithm.
  6. #' @return A array of all database schemas.
  7. #' @seealso [qgisprocess::qgis_algorithms()]
  8. #' @keywords qgis, help
  9. #' @export
  10. #' @examples
  11. #' \dontrun{
  12. #'
  13. #' qgis_algorithm_search_by_word(str = "clip")
  14. #' algorithm <- "native:clip"
  15. #' # Read help.
  16. #' qgisprocess::qgis_show_help(algorithm = algorithm)
  17. #'
  18. #' qgis_algorithm_search_by_word(str = "centroid")
  19. #' qgis_algorithm_search_by_word(str = "filedownloader")
  20. #' qgis_algorithm_search_by_word(str = "")
  21. #' qgis_algorithm_search_by_word()
  22. #' }
  23. qgis_algorithm_search_by_word <- function(str = NULL) {
  24. if (is.null(str) || str == "") {
  25. return(NULL)
  26. }
  27. x <- system(sprintf("qgis_process list | grep %s", str), intern = TRUE)
  28. x <- do.call("rbind", strsplit(x, "\t"))[, 2:3]
  29. cat("\n----------------\n")
  30. x
  31. }