[R] lattice strip.custom function

Naresh Gurbuxani naresh_gurbuxani at hotmail.com
Sun Jul 5 03:53:56 CEST 2015


I would like to use a mapping to name panel strips.  Directly using mapping table does not work.  What is the problem here?
my.df <- data.frame(x = rnorm(100, mean = 0, sd = 2), name = "A")
my.df <- rbind(my.df, data.frame(x = rnorm(100, mean = 0, sd = 4), name = "B"))
my.df <- rbind(my.df, data.frame(x = rt(100, 3), name = "C"))
my.df <- rbind(my.df, data.frame(x = runif(100, min = -3, max = 3), name = "D"))


library(lattice)
histogram(~x | name, data = my.df)
name.dist <- data.frame(name = c("A", "B", "C", "D"), dist = c("normal", "normal", "t", "uniform"))
dist.names <- name.dist$dist

# Below code workshistogram(~x | name, data = my.df, strip = strip.custom(factor.levels = c("normal", "normal", "t", "uniform")))
# Below code does not workhistogram(~x | name, data = my.df, strip = strip.custom(factor.levels = dist.names)) 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list