R/tk.folder.R

Defines functions tk.folder

# Interactive tcltk::tcl-TK directory choosing
tk.folder = function(
		title = "Choose a directory",
		mustexist = TRUE,
		mandatory = TRUE
		)
	{
	# Dialog
	suppressWarnings(folder <- tcltk::tclvalue(tcltk::tkchooseDirectory(title=title, mustexist=mustexist)))
	
	# No folder
	if(mandatory && folder == "") stop("No directory selected")
	
	return(folder)
}

Try the FSAtools package in your browser

Any scripts or data that you put into this service are public.

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.