# examples of specifying 'names' and 'values'
a <- GenerateHITLayoutParameter(names = "hitvariable", 
                                values = "Text for HIT 1")
b <- GenerateHITLayoutParameter(names = "hitvariable", 
                                values = "Text for HIT 2")
c <- GenerateHITLayoutParameter(names = c("hitvariable1","hitvariable2"),
                                values = c("Headline for HIT1","Text for HIT 1"))
# example using a named character string in lieu of specifying 'names'
d <- GenerateHITLayoutParameter(values = c(hitvariable1 = "Headline for HIT1", 
                                           hitvariable2 = "Text for HIT 1"))
# create HIT using layout parameter
hit1 <- 
CreateHIT(title = "Survey",
          description = "5 question survey",
          reward = ".10",
          expiration = seconds(days=4),
          duration = seconds(hours = 1),
          keywords = "survey, questionnaire",
            # retrieved from MTurk web interface:
          hitlayoutid = "23ZGOOGQSCM61T1H5H9U0U00OQWFFU", 
          hitlayoutparameters = a)
# cleanup
DisableHIT(hit1$HITId)Run the code above in your browser using DataLab