Skip to content

Commit

Permalink
Merge pull request #3 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Update Master
  • Loading branch information
Vitalis95 authored Aug 22, 2021
2 parents bf0a954 + bd98be5 commit 72afb4b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions instat/ucrGeom.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1756,10 +1756,10 @@ Public Class ucrGeom


clsgeom_smooth.strGeomName = "geom_smooth"
' mandatory
'Mandatory Aesthetics
clsgeom_smooth.AddAesParameter("x", bIsMandatory:=True)
clsgeom_smooth.AddAesParameter("y", bIsMandatory:=True)
' optional
'Optional Aesthetics
clsgeom_smooth.AddAesParameter("alpha")
clsgeom_smooth.AddAesParameter("colour")
clsgeom_smooth.AddAesParameter("fill")
Expand All @@ -1768,24 +1768,28 @@ Public Class ucrGeom
clsgeom_smooth.AddAesParameter("size")
clsgeom_smooth.AddAesParameter("weight")

'add layer parameter
'Add layer parameters
''****Not sure how many positions exist for geom_smooth
clsgeom_smooth.AddLayerParameter("position", "list", Chr(34) & "identity" & Chr(34), lstParameterStrings:={Chr(34) & "identity" & Chr(34), Chr(34) & "jitter" & Chr(34)})
'Can we have stack, DoDragDrop, fill positions here)
clsgeom_smooth.AddLayerParameter("method", "list", Chr(34) & "lm" & Chr(34), lstParameterStrings:={Chr(34) & "lm" & Chr(34), Chr(34) & "glm" & Chr(34), Chr(34) & "gam" & Chr(34), Chr(34) & "loess" & Chr(34), Chr(34) & "rlm" & Chr(34)})
'formula has to be an input and we dont have that currently. its passed in like this formula= y ~ x or formula= y ~ poly(x, 2) or formula= y ~ log(x) so the user has to type in stuff
clsgeom_smooth.AddLayerParameter("formula", "editablelist", Chr(34) & "y ~ x" & Chr(34), lstParameterStrings:={Chr(34) & "y ~ x" & Chr(34), Chr(34) & "y ~ poly(x, 2)" & Chr(34), Chr(34) & "y ~ log(x)" & Chr(34), Chr(34) & " y ~ splines::bs(x,3)" & Chr(34)})
clsgeom_smooth.AddLayerParameter("se", "boolean", "TRUE")
clsgeom_smooth.AddLayerParameter("formula", "editablelist", "y ~ x", lstParameterStrings:={"y ~ x", "y ~ poly(x, 2)", "y ~ log(x)", "y ~ splines::bs(x,3)"})
clsgeom_smooth.AddLayerParameter("se ", "list", "TRUE", lstParameterStrings:={"TRUE", "FALSE"}) 'We add space after parameter name se ("se ") for correct labeling, if the space is omitted, vb labels "se" as "ifelse" but when the space is included "se " is correctly labelled as "se".
clsgeom_smooth.AddLayerParameter("method.args", "editablelist", "list()", lstParameterStrings:={"list()"})
clsgeom_smooth.AddLayerParameter("colour", "colour", Chr(34) & "black" & Chr(34))
clsgeom_smooth.AddLayerParameter("na.rm", "boolean", "FALSE")
clsgeom_smooth.AddLayerParameter("orientation", "list", "NA", lstParameterStrings:={"NA", Chr(34) & "x" & Chr(34), Chr(34) & "y" & Chr(34)})
clsgeom_smooth.AddLayerParameter("show.legend", "list", "TRUE", lstParameterStrings:={"NA", "TRUE", "FALSE"})
'geom and stat are missing here as we dont know how to override the default connection between geom_smooth and stat_smooth
'you can have stat_smooth or geom_smooth. I am not sure how we can do that from here, changing the smothing function

clsgeom_smooth.AddLayerParameter("n", "numeric", "0")
clsgeom_smooth.AddLayerParameter("span", "numeric", "0", lstParameterStrings:={1, 0, 1})
clsgeom_smooth.AddLayerParameter("span", "numeric", "0.3", lstParameterStrings:={2, 0, 1})
clsgeom_smooth.AddLayerParameter("fullrange", "boolean", "FALSE")
clsgeom_smooth.AddLayerParameter("level", "numeric", "0.95", lstParameterStrings:={2, 0, 1})
clsgeom_smooth.AddLayerParameter("size", "numeric", "0.5", lstParameterStrings:={1, 0}) 'Note: negative size gives size 0 in general, but 'Warning: sometimesgive errors...
clsgeom_smooth.AddLayerParameter("linetype", "list", Chr(34) & "blank" & Chr(34), lstParameterStrings:=strLineType)

'method.args is a list of methods passed into the moddeling function
'its passed in like this** method.args = list(family = "binomial") we currently dont have this too.
Expand Down

0 comments on commit 72afb4b

Please sign in to comment.