R/cd.R

Defines functions cd

Documented in cd

cd <- function(x) {
	if (x=="..") {
		# Compute directory length
		dirs <- unlist(strsplit(getwd(),"/"))
		dirlgth <- nchar(dirs[length(dirs)])
		# Remove current directory from wd string
		newwd <- strtrim(getwd(),nchar(getwd())-dirlgth-1)
		a<-1
	} else {
		newwd <- paste(getwd(),"/",x,sep="")
	}
	setwd(newwd)
	getwd()
}

Try the schoRsch package in your browser

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

schoRsch documentation built on Nov. 2, 2022, 1:06 a.m.