"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/library.c" between
gretl-2020a.tar.xz and gretl-2020b.tar.xz

About: gretl (Gnu Regression, Econometrics and Time-series Library) is a cross-platform statistical package mainly for econometric analysis.

library.c  (gretl-2020a.tar.xz):library.c  (gretl-2020b.tar.xz)
skipping to change at line 1959 skipping to change at line 1959
int out_of_sample_info (int add_ok, int *t2) int out_of_sample_info (int add_ok, int *t2)
{ {
const char *can_add = const char *can_add =
N_("There are no observations available for forecasting\n" N_("There are no observations available for forecasting\n"
"out of sample. You can add some observations now\n" "out of sample. You can add some observations now\n"
"if you wish."); "if you wish.");
int err = 0; int err = 0;
if (add_ok) { if (add_ok) {
int n = add_obs_dialog(_(can_add), 0, NULL); int n = add_obs_dialog(_(can_add), 0, OPT_NONE, NULL);
if (n < 0) { if (n < 0) {
err = 1; err = 1;
} else if (n > 0) { } else if (n > 0) {
set_original_n(dataset->n); set_original_n(dataset->n);
err = dataset_add_observations(dataset, n, OPT_A); err = dataset_add_observations(dataset, n, OPT_A);
if (err) { if (err) {
gui_errmsg(err); gui_errmsg(err);
} else { } else {
lib_command_sprintf("dataset addobs %d", n); lib_command_sprintf("dataset addobs %d", n);
skipping to change at line 6388 skipping to change at line 6388
lib_command_strcpy("genr index"); lib_command_strcpy("genr index");
} }
record_command_verbatim(); record_command_verbatim();
populate_varlist(); populate_varlist();
mark_dataset_as_modified(); mark_dataset_as_modified();
} }
} }
void do_add_obs (void) void do_add_obs (void)
{ {
int n = add_obs_dialog(NULL, 1, NULL); gretlopt opt = OPT_A;
int err = 0; int n, err = 0;
if (dataset_is_panel(dataset)) {
const char *opts[] = {
_("in the cross-sectional dimension"),
_("in the time dimension")
};
int resp;
resp = radio_dialog(NULL, _("Add observations"),
opts, 2, 0, 0, NULL);
if (resp == GRETL_CANCEL) {
return;
}
if (resp == 1) {
opt |= OPT_T;
}
}
n = add_obs_dialog(NULL, 1, opt, NULL);
if (n > 0) { if (n > 0) {
err = dataset_add_observations(dataset, n, OPT_A); err = dataset_add_observations(dataset, n, opt);
if (err) { if (err) {
gui_errmsg(err); gui_errmsg(err);
} else { } else {
mark_dataset_as_modified(); mark_dataset_as_modified();
} }
} }
} }
void do_remove_obs (void) void do_remove_obs (void)
{ {
skipping to change at line 8833 skipping to change at line 8852
resp = spin_dialog(title, _("Resampling with replacement"), resp = spin_dialog(title, _("Resampling with replacement"),
&n, _("Number of cases"), &n, _("Number of cases"),
1, 1000000, 0, NULL); 1, 1000000, 0, NULL);
g_free(title); g_free(title);
if (!canceled(resp)) { if (!canceled(resp)) {
gchar *nstr = g_strdup_printf("%d", n); gchar *nstr = g_strdup_printf("%d", n);
int err; int err;
err = modify_dataset(dataset, DS_RESAMPLE, NULL, nstr, err = modify_dataset(dataset, DS_RESAMPLE, NULL, nstr,
NULL); OPT_NONE, NULL);
if (err) { if (err) {
gui_errmsg(err); gui_errmsg(err);
} else { } else {
mark_dataset_as_modified(); mark_dataset_as_modified();
} }
g_free(nstr); g_free(nstr);
} }
} }
static int db_write_response (const char *filename, const int *list) static int db_write_response (const char *filename, const int *list)
skipping to change at line 10313 skipping to change at line 10332
if (*cmd->savename != '\0' && TEXTSAVE_OK(cmd->ci)) { if (*cmd->savename != '\0' && TEXTSAVE_OK(cmd->ci)) {
ppos = gretl_print_tell(prn); ppos = gretl_print_tell(prn);
} }
check_for_loop_only_options(cmd->ci, cmd->opt, prn); check_for_loop_only_options(cmd->ci, cmd->opt, prn);
switch (cmd->ci) { switch (cmd->ci) {
case DATA: case DATA:
err = db_get_series(cmd->param, dset, cmd->opt, prn); err = db_get_series(cmd->param, dset, cmd->opt, prn);
if (!err) { if (err) {
errmsg(err, prn);
} else {
clean_up_varlabels(dset); clean_up_varlabels(dset);
register_data(DATA_APPENDED); register_data(DATA_APPENDED);
if (gretl_messages_on()) { if (gretl_messages_on()) {
list_series(dset, OPT_NONE, prn); list_series(dset, OPT_NONE, prn);
} }
} }
break; break;
case DELEET: case DELEET:
if (cmd->list != NULL) { if (cmd->list != NULL) {
 End of changes. 5 change blocks. 
6 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)