Just starting using R so if appropriate "go slow" with your answer.
Using mirt package, trying to generate a plot with:
itemplot(polymodel, item = 3, type = "trace")
Works great but the title of the graph is: "Trace lines for item 3"
I would like to have the title show the name of the item (variable) like this: "Trace lines for item v.5.1.1.a"
Help for mirt gives : "item a single numeric value, or the item name, indicating which item to plot"
I tried different ways to type the item name:
itemplot(polymodel, item = "var13$v.5.1.1.a", type = "trace")
Error in x@ParObjects$pars[[item]] : attempt to select less than one element in get1index
itemplot(polymodel, item = var13$v.5.1.1.a, type = "trace")
Error in x@ParObjects$pars[[item]] : recursive indexing failed at level 2
itemplot(polymodel, item = v.5.1.1.a, type = "trace")
Error in itemplot(polymodel, item = v.5.1.1.a, type = "trace") : object 'v.5.1.1.a' not found
It looks like itemplot relies on lattice (you can see that from the fact that itemplot can pass elements to lattice). Hence, it is likely that you can simply use the appropriate lattice command to generate a title. Try something like
itemplot(polymodel, item = 3, type = "trace", main="Trace lines for item v.5.1.1.a")
If you come from Stata, labels do not play the same role in R, so you often will end up tweaking graphs.
You are welcome. For the second question, you need to provide a bit more information about your data. Even better, try to set up a reprex using one of the built-in data sets such as mtcars. See below for information about how to write a good reprex.