following on from some help earlier I think all I need for this to work is a way to define the variable dimxST below as not a string as I need that to point to the data frame....

```
cpkstudy <- function(x,y){

  dxST <- paste(x,"$",y, sep = "")

  dLSL <- paste(y, "LSL", sep = "")
  dUSL <- paste(y, "USL", sep = "")
  dTar <- paste(y, "Target", sep = "")

  dimxST <- 
  dimLSL <- PivSpecs[[dLSL]]
  dimUSL <- PivSpecs[[dUSL]]
  dimTar <- PivSpecs[[dTar]]

  ss.study.ca(dimxST, LSL = dimLSL, USL =  dimUSL, Target = dimTar,
              alpha = 0.05, f.na.rm = TRUE, f.main = "Six Sigma Study")

}

cpkstudy("cam1","D1")

```

link to the previous [post](https://stackoverflow.com/questions/50115330/r-auto-creating-variables-from-a-dataset?noredirect=1#comment87247949_50115330)