Closed Lukas231 closed 4 years ago
So I have one additional comment. Together with my colleagues we relized that only if cvs file is separated by comma the loading is working. Unfortunatelly our version of exel cannot easily save the csv with comma. So if there would be some possibilities to add something into the code to be able load the data in more that one version of csv it would be really great :)
Lukas
Hi Lukas,
I'm sorry about that issue, that's annoying... The proper fix would be to modify the data loading functions to pass arguments to read.csv. If you want to make this change and submit a pull request we can add it. Or you can fork your own version of MixSIAR and hardcode semicolons in the data loading functions.
Otherwise, I don't think it should be too hard to save as a csv with commas instead of semicolons. If for some reason it's not possible in Excel, it is in LibreOffice (free, and what I'm more familiar with).
-Brian
On Thu, Feb 7, 2019, 4:06 PM Lukas231 <notifications@github.com wrote:
So I have one additional comment. Together with my colleagues we relized that only if cvs file is separated by comma the loading is working. Unfortunatelly our version of exel cannot easily save the csv with comma. So if there would be some possibilities to add something into the code to be able load the data in more that one version of csv it would be really great :)
Lukas
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brianstock/MixSIAR/issues/161#issuecomment-461367754, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4wc7VoV_JwZFqQKNWqTxKUToL2niBKks5vLAGPgaJpZM4alWdJ .
Dear Brian,
although I can save my Excel files to CSV separated by commas without problems, I get the same error as Lukas.
A colleague of mine has passed me his csv document and it works, but if I modify it with my data, R answers: Error in load_source_data(filename = source.filename, source_factors = "group", : Your 'source_factors' do not match column names in your source data file (case sensitive). Please check your source .csv data file and load_source_data line, then try again. ***
This is the script I am using:
mix.filename <- "C:/Users/1269775/OneDrive - Universitat Autònoma de Barcelona/Mixing Models/MixSIAR/Dades/mixture2.csv"
mix <- load_mix_data(filename=mix.filename, iso_names=c("d13C16","d13C18"), factors =c("Region", "Pack"), fac_random=c(F,F), fac_nested=c(F,F), cont_effects=NULL)
below attache the data:
d13C16,d13C18,Region,Pack -31.28,-32.94,1,1 -27.65,-25.18,1,1 -24.07,-24.69,1,1 -23.82,-22.31,1,1 -26.46,-26.61,1,1 -31.65,-27.14,1,1 -26.75,-30.13,1,1 -27.58,-24.39,1,1 -24.76,-23.88,1,1 -27.14,-26.01,1,1 -27.76,-27.54,1,1 -24.42,-24.05,1,1 -22.86,-23.52,1,1 -30.56,-32.43,1,1 -27.55,-30.44,1,1 -28.61,-30.03,1,1 -25.83,-26.22,1,1 -27.11,-28.38,1,1 -25.95,-25.73,1,1 -28.18,-30.2,1,1 -28.4,-29.11,1,1 -25.82,-23.88,1,1 -27.82,-28.33,1,1 -27.56,-28.84,1,1 -29.31,-30.37,1,1 -33.28,-34.76,1,1
Thank you very much
Best regards,
Nadia.
Hi Nadia,
If you're using source_factors = 'group', then you should have 'group' as a column heading in the mix data file (I see Region and Pack). Also, the error is with the source data loading - can you post the headings and first couple lines of the source data file... Is 'group' a column heading in the source data file?
Best, Brian
On Thu, Mar 14, 2019 at 11:59 AM NadiaCroft notifications@github.com wrote:
Dear Brian,
although I can save my Excel files to CSV separated by commas without problems, I get the same error as Lukas.
A colleague of mine has passed me his csv document and it works, but if I modify it with my data, R answers: Error in load_source_data(filename = source.filename, source_factors = "group", : Your 'source_factors' do not match column names in your source data file (case sensitive). Please check your source .csv data file and load_source_data line, then try again. ***
This is the script I am using:
mix.filename <- "C:/Users/1269775/OneDrive - Universitat Autònoma de Barcelona/Mixing Models/MixSIAR/Dades/mixture2.csv"
mix <- load_mix_data(filename=mix.filename, iso_names=c("d13C16","d13C18"), factors =c("Region", "Pack"), fac_random=c(F,F), fac_nested=c(F,F), cont_effects=NULL)
below attache the data:
d13C16,d13C18,Region,Pack -31.28,-32.94,1,1 -27.65,-25.18,1,1 -24.07,-24.69,1,1 -23.82,-22.31,1,1 -26.46,-26.61,1,1 -31.65,-27.14,1,1 -26.75,-30.13,1,1 -27.58,-24.39,1,1 -24.76,-23.88,1,1 -27.14,-26.01,1,1 -27.76,-27.54,1,1 -24.42,-24.05,1,1 -22.86,-23.52,1,1 -30.56,-32.43,1,1 -27.55,-30.44,1,1 -28.61,-30.03,1,1 -25.83,-26.22,1,1 -27.11,-28.38,1,1 -25.95,-25.73,1,1 -28.18,-30.2,1,1 -28.4,-29.11,1,1 -25.82,-23.88,1,1 -27.82,-28.33,1,1 -27.56,-28.84,1,1 -29.31,-30.37,1,1 -33.28,-34.76,1,1
Thank you very much
Best regards,
Nadia.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brianstock/MixSIAR/issues/161#issuecomment-472934187, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4wc37JuO0sZAl8Y44R1RA3AdaCUlAVks5vWnHUgaJpZM4alWdJ .
Hi Brian, Not sure if I can reopen this thread (even if it is closed by you on 20 Oct 2020). I have the same problem while changing d13C and d15N to other isotopic names. All I did was just change the name of these two isotopes to other name, and updated the command in R. Nothing else changed. Same problem happened when it said column name not match.. also the csv file are fine if I keep the isotope name as 13C and 15N, so it could not be the csv file issue.
Any idea? Thanks Brian. Below are the code and errors:
mix <- load_mix_data(filename="sediment_mixed.csv",
Below are some of my information on data: Sediment_mixed: Taxa 208Pb/206Pbratio 206Pb/207Pbratio CT 2.1044 1.1632 CT 2.0971 1.1683
Sediment_sources: 208Pb/206Pbratio 206Pb/207Pbratio Coastal water 2.0849 1.1877 Coastal water 2.0957 1.1765
Sediment_discrimination: Mean208Pb/206Pbratio SD208Pb/206Pbratio Mean206Pb/207Pbratio SD206Pb/207Pbratio Coastal water 0 0 0 0
Maybe it's the slash in the column names? Can you read in that file with read.csv?
On Sat, Jul 23, 2022, 2:37 AM ncttrinh @.***> wrote:
Below are some of my information on data: Sediment_mixed: Taxa 208Pb/206Pbratio 206Pb/207Pbratio CT 2.1044 1.1632 CT 2.0971 1.1683
Sediment_sources: 208Pb/206Pbratio 206Pb/207Pbratio Coastal water 2.0849 1.1877 Coastal water 2.0957 1.1765
Sediment_discrimination: Mean208Pb/206Pbratio SD208Pb/206Pbratio Mean206Pb/207Pbratio SD206Pb/207Pbratio Coastal water 0 0 0 0
— Reply to this email directly, view it on GitHub https://github.com/brianstock/MixSIAR/issues/161#issuecomment-1193022425, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHDA432FX5QBOXPKQ7WWK3VVM5FXANCNFSM4GUVM5EQ . You are receiving this because you modified the open/close state.Message ID: @.***>
Hey Brian,
Oh I am not sure if it is a slash. But I will try again today and let you know :)
Also read csv should be no problem.. but I will confirm today also.
Hey Brian, I changed the name of the isotope and it worked, however, there is a problem plotting the Isoplot (which I believe someone has asked but it is not fully resolved- or you should have suggested another program to plot the Isoplot). So I would like to ask: Are you able to help fix the Isoplot so that it come out nicely? Does weird Isoplot have any influence on the final result at all? Thanks Brian! Please refer to the Isoplot below.
There is a default amount to shift the source labels so they are not on top of the points. It is probably easier for you to modify the isospace plot code than to create the ggplot object and modify afterwards, so I suggest that. I think there are other questions in github issues that can help with this.
No, the label positions do not affect the model result. But you should inspect the isospace plot to check the mixing model assumptions are met.
On Sat, Jul 23, 2022, 11:39 AM ncttrinh @.***> wrote:
Hey Brian, I changed the name of the isotope and it worked, however, there is a problem plotting the Isoplot (which I believe someone has asked but it is not fully resolved- or you should have suggested another program to plot the Isoplot). So I would like to ask: Are you able to help fix the Isoplot so that it come out nicely? Does weird Isoplot have any influence on the final result at all? Thanks Brian! Please refer to the Isoplot below. [image: image] https://user-images.githubusercontent.com/84255278/180599854-54ca27c1-a7b6-47af-8919-5637f3cd543a.png
— Reply to this email directly, view it on GitHub https://github.com/brianstock/MixSIAR/issues/161#issuecomment-1193095976, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHDA44V5GON2SHCT2JZ5RDVVO4TNANCNFSM4GUVM5EQ . You are receiving this because you modified the open/close state.Message ID: @.***>
Hey Brian,
Thanks for your suggestion. Can you show me where is the code to modify the isospace plot? I could not find it in the MixSIAR manual. Also I found the thread to convert isoplot to ggplot2 object, and I did. But my quick try to modify it (as an ggplot2 object) does not show any difference, I will need to look into details later today but for now, please refer me to the script where I could modify the isoplot itself in MixSIAR. Thanks Brian :)
Hi Brian, I tried to modify the Isoplot using ggplot but it does not seem to work. Here is my script, I keep the legend at the bottom but it just bring a part of the legend down, but the top right legend items are still in a mess and mixed up together (please refer to the photo 1) .
library(ggplot2) png("my_new_plot.png", width=7, height=7, units="in", res=300) g + theme(panel.border = element_blank(), panel.background = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"), axis.title=element_text(size=10), axis.text=element_text(size=14), legend.text=element_text(size=12), legend.title=element_text(size=14), legend.position="bottom")
dev.off()
g + scale_y_continuous(name = "Pb208206", limits = c(2, 2.3)) + scale_x_continuous(name = "Pb206207", limits = c(1, 1.25))
plot(g)
Hi Brian, I just notice the group of "sources" clumping together at the top left may not be what we usually called "legend", this is because in the 1st photo I can bring the legend down to the bottom using ggplot2 (which you can see it is written as: factor(mix$FAC[[1]]$value) . MCC).
What I want is nothing but arrange the sources at the top left nicely, which is strangely does not work in the isoplot (we know these are called legend but I do not know why the ggplot or MixSIAR do not considered it legend).... What do you think? Thanks Brian! And how to solve this..................... :)
Hi Brian,
Any updates from your side :) What says you? Probably the short solution is if you could help provide the script that modify the isopace itself so I could give it a try. And the long term solution is trying to figure it out regarding the legend issue... Thanks Brian!!!!!!
Dear Brian,
I recently moved from SIAR to MixSiar and now I am bit fighting with data loading. Specifically I have problem with load_mix_data. Currently I would like to see the differences among two groups of organism.
So my problem is this: Error in load_mix_data(filename = mix.filename1, iso_names = c("XX1", : * Error: Your 'iso_names' do not match column names in your mixture data file (case sensitive). Please check your mix .csv data file and load_mix_data line, then try again.
Many times I changed the name of the collums but no success. Now there is names XX1 and XX2. But In previous time the names was d13C and d15N and this csv file was used in SIAR and work perfectly.
bellow I attached the code I am currently using.
mix.filename <- file.path("C:/Users/veselyl/Documents/Isotopy/role.raka.v.nadrzi/ontogeneze/beach_siar_juvenil_jako_korist","predator2.csv")
mix <- load_mix_data(filename=mix.filename, iso_names=c("XX1","XX2"), factors="Group", fac_random=FALSE, fac_nested=FALSE, cont_effects=NULL)
Might be my problem can be connected with csv file. Because I am using czech version of excel so whenever I am loading data I am using this comand : data<-read.table("predators2.csv",header=TRUE,sep=";",dec=",").
can I somehow specified header=TRUE,sep=";",dec="," when I am loading my data? it might be help.
bellow I attachet the data Group XX1 XX2 2 2.496 -14.379 2 1.882 -15.699 2 2.229 -17.485 2 1.778 -15.649 2 4.311 -22.874 2 3.764 -18.321 2 4.329 -18.01 2 3.085 -18.222 2 2.503 -18.512 3 2.718 -13.653 3 3.801 -20.248 3 5.018 -19.387 3 5.114 -19.81 3 5.154 -20.418 3 4.064 -18.659 3 4.096 -22.133 3 3.411 -15.603 3 3.999 -18.884 3 3.014 -20.269
Thank you for your help
best
Lukas