Closed EllenMcKee closed 5 years ago
Hi Ellen,
Sorry for the delay. You have a simple mistake in your TDF file: extra columns with empty characters. If you use the script version, you'll see the issue is not with the isospace plot, but happens when you load the TDF data. This is a general problem you'll encounter whenever using read.csv
in R.
Mix and source data loading runs fine:
library(MixSIAR)
setwd("/home/brian/Documents/Isotopes/MixSIAR_help/issue_177")
mix.filename <- "V_consumer.csv"
mix <- load_mix_data(filename=mix.filename,
iso_names=c("d13C","d15N"),
factors="Species",
fac_random=FALSE,
fac_nested=FALSE,
cont_effects=NULL)
source.filename <- "v_sources.csv"
source <- load_source_data(filename=source.filename, source_factors=NULL, conc_dep=FALSE, data_type="raw", mix)
But your original discrimination file throws an error:
discr.filename <- "v_discrimination.csv"
discr <- load_discr_data(filename=discr.filename, mix)
Error in `.rowNamesDF<-`(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique value when setting 'row.names': ‘’
When I create a new .csv
file, deleting the "empty" (not actually empty) columns in Excel/LibreOffice, the TDF file loads fine and isospace plot is ok:
discr.filename <- "v_discrimination_delcols.csv"
discr <- load_discr_data(filename=discr.filename, mix)
plot_data(filename="isospace_plot",
plot_save_pdf=TRUE,
plot_save_png=FALSE,
mix,source,discr)
Hi Brian,
Thank you so much for your help - everything is running perfectly now!
Best,
Ellen
From: Brian Stock notifications@github.com Sent: 11 July 2019 17:59 To: brianstock/MixSIAR Cc: EllenMcKee; Author Subject: Re: [brianstock/MixSIAR] Error (#177)
Hi Ellen,
Sorry for the delay. You have a simple mistake in your TDF file: extra columns with empty characters. If you use the script version, you'll see the issue is not with the isospace plot, but happens when you load the TDF data. This is a general problem you'll encounter whenever using read.csv in R.
Mix and source data loading runs fine:
library(MixSIAR)
setwd("/home/brian/Documents/Isotopes/MixSIAR_help/issue_177")
mix.filename <- "V_consumer.csv"
mix <- load_mix_data(filename=mix.filename,
iso_names=c("d13C","d15N"),
factors="Species",
fac_random=FALSE,
fac_nested=FALSE,
cont_effects=NULL)
source.filename <- "v_sources.csv"
source <- load_source_data(filename=source.filename, source_factors=NULL, conc_dep=FALSE, data_type="raw", mix)
But your original discrimination file throws an error:
discr.filename <- "v_discrimination.csv"
discr <- load_discr_data(filename=discr.filename, mix)
Error in .rowNamesDF<-
(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique value when setting 'row.names': ‘’
When I create a new .csv file, deleting the "empty" (not actually empty) columns in Excel/LibreOffice, the TDF file loads fine and isospace plot is ok:
discr.filename <- "v_discrimination_delcols.csv"
discr <- load_discr_data(filename=discr.filename, mix)
plot_data(filename="isospace_plot",
plot_save_pdf=TRUE,
plot_save_png=FALSE,
mix,source,discr)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/brianstock/MixSIAR/issues/177?email_source=notifications&email_token=AMOBA2TUQOTY53QYVBYFYELP65YI7A5CNFSM4H46F6L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXP5GA#issuecomment-510590616, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMOBA2WXYFBZF2TUEJWKZ73P65YI7ANCNFSM4H46F6LQ.
Hi Brian,
I am having the same issue where it says: Error in plot_data(filename = "isospace_plot", plot_save_pdf = TRUE, plot_save_png = FALSE, : *** Error: Source names do not match in source and discr data files. Please check your source and discr data file row names.
All of my mix, source, and discrimination data loaded fine. My code is below.
mix.filename<-"C:/Users/morga/Documents/Data Analysis/Stable isotope analysis/mixSIAR/mixture.csv"
mix<-load_mix_data(filename=mix.filename, iso_names=c("d13c", "d15n"), factors=c("species"), fac_random=(FALSE), fac_nested=(FALSE), cont_effects=NULL)
source.filename<-"C:/Users/morga/Documents/Data Analysis/Stable isotope analysis/mixSIAR/source.csv"
source<-load_source_data(filename=source.filename, source_factors=NULL, conc_dep=FALSE, data_type="raw",mix)
discr.filename<-"C:/Users/morga/Documents/Data Analysis/Stable isotope analysis/mixSIAR/discrimination.csv" discr<-load_discr_data(filename=discr.filename, mix)
plot_data(filename="isospace_plot", plot_save_pdf=TRUE, plot_save_png=FALSE, mix, source, discr, return_obj=FALSE)
Here are the headers of my source and discrimination file.
Source Meand13c SDd13c Meand15n SDd15n
Hi Morgan,
Have you checked all the rownames in your loaded source and discr data? I.e. what do you get when you run the code below? They should match.
source <- read.csv(source.filename)
discr <- read.csv(discr.filename)
unique(source$Source)
unique(discr$Source)
Hi Brian,
There was an extra space in one of my source labels for my discrimination factors. It is working now!
Thank you,
Morgan
From: Brian Stock notifications@github.com Sent: Wednesday, January 20, 2021 5:30:23 PM To: brianstock/MixSIAR MixSIAR@noreply.github.com Cc: Morgan Dobroski dobroskm@myumanitoba.ca; Comment comment@noreply.github.com Subject: Re: [brianstock/MixSIAR] Error loading discrimination data (#177)
Hi Morgan,
Have you checked all the rownames in your loaded source and discr data? I.e. what do you get when you run the code below? They should match.
source <- read.csv(source.filename) discr <- read.csv(discr.filename) unique(source$Source) unique(discr$Source)
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/brianstock/MixSIAR/issues/177#issuecomment-764023967, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASRH3CPPIQYYLCRG5RJDGLTS25RQ7ANCNFSM4H46F6LQ.
Hi Brian, When clicking 'Make Isospace plot' in the GUI, I get this error message:
Error in plot_data(gWidgets::svalue(mixsiar$plot_filename), gWidgets::svalue(mixsiar$plot_save_pdf), : *** Error: Source names do not match in source and discr data files. Please check your source and discr data file row names.
Both my source file and discrimination file have rows named horse, sheep, goat, rabbit or hare and nothing else. Do you know what could be going wrong here?