IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 102 forks source link

Plotting sub-dialogues don't work properly #6597

Open rdstern opened 3 years ago

rdstern commented 3 years ago

This seems fairly general. I tried with different data sets, so our little survey does fine. a) Start with any graph for example boxplot of yield against village

image

b) Press the Plot options and add another layer, e.g. boxplot against variety. Plot works fine

c) Return to the dialogue and to the plot options. Then don't change anything, but press Return

This gives an error.

When you examine the code generated, the first time it runs fine and is as follows:

# Code generated by the dialog, Boxplot
survey <- data_book$get_data_frame(data_name="survey")
last_graph <- ggplot2::ggplot(data=survey, mapping=ggplot2::aes(y=yield, x=village)) + ggplot2::geom_boxplot(outlier.colour="red") + ggplot2::geom_boxplot(mapping=ggplot2::aes(x=variety)) + theme_grey() + ggplot2::theme(axis.text.x=ggplot2::element_text(), legend.position="none")
data_book$add_graph(graph_name="last_graph", graph=last_graph, data_name="survey")
data_book$get_graphs(data_name="survey", graph_name="last_graph")

The second time, when it generates the error, I have changed nothing, but the code is now:

# Code generated by the dialog, Boxplot
survey <- data_book$get_data_frame(data_name="survey")
last_graph <- ggplot2::ggplot(data=survey, mapping=ggplot2::aes(y=yield, x=village)) + ggplot2::geom_boxplot(outlier.colour="red") + ggplot2::geom_boxplot(mapping=ggplot2::aes(x=variety)) + theme_grey() + ggplot2::theme(axis.text.x=ggplot2::element_text(), legend.position="none") + ggplot2::scale_x_continuous(position="") + ggplot2::scale_y_continuous(position="")
data_book$add_graph(graph_name="last_graph", graph=last_graph, data_name="survey")
data_book$get_graphs(data_name="survey", graph_name="last_graph")

You can see R-In stat has now added: + ggplot2::scale_x_continuous(position="") + ggplot2::scale_y_continuous(position="")

I assume this is what is generating the error. If I get the new script and then delete this extra it runs fine again.

shadrackkibet commented 3 years ago

Looks like I can't replicate this easily! It will be very useful if you add the error message you are getting.

rdstern commented 3 years ago

Damn - I can't repeat it now either!

shadrackkibet commented 3 years ago

I guess that is because you had position checkboxes under X-Axis and Y-Axis tabs checked. If this is the case then I don't think that should be a problem! The error message explains the problem!