Closed melizaantunes closed 5 years ago
hi
my guess is that the object called mydata being created by read_csv() is not a data.frame type object (or possibly matrix type will work too im not quite sure without checking the code), and that its column names are not named as per the error message. When i use read.csv() i have to include read.csv( “file_name.csv", header = TRUE).
try
str(mydata)
to check what object type it is and that the the columns are appropriately named
best wishes
andrew
--
Dr Andrew Jackson, PhD, FTCD Associate Professor Irish Research Council Laureate School of Natural Sciences, Department of Zoology Trinity College Dublin, the University of Dublin Dublin 2, Ireland.
+353 1 896 2728 | a.jackson@tcd.iemailto:a.jackson@tcd.ie Twitter: @yodacomplexhttps://twitter.com/yodacomplex http://www.tcd.ie/Zoology/research/http://www.tcd.ie/Zoology/research/groups/jackson/groups/jackson/
On 25 Oct 2018, at 01:00, melizaantunes notifications@github.com<mailto:notifications@github.com> wrote:
Hello, I work with R, Rstudio interface, I do ecology modeling. Usually I use SIMMR package and it does the trick, except this time I'd like to use SIBER alongside SIMMR, so I can build those ellipsis. I installed it, ran the example model and it worked out just fine. However, when I try to import my data and try to run it, I get the following:
library(SIBER)
library(readr) dados2 <- read_csv("dados2.txt") View(dados2) mydata <- dados2 siber_example <- createSiberObject(mydata) Error in createSiberObject(mydata) : The header names in your data file must match c("iso1", "iso2", "group", "community") exactly
I already checked for the name on top, with quotes, just like it demands me to, and even still, I cant get it to run, I've tried botho .csv and .txt, and get the same error on both
Thanks a lot !!!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/AndrewLJackson/SIBER/issues/45, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADK1sOic-tQgp0rBt-sIBUyWg2oeRC77ks5uoP83gaJpZM4X5QvB.
Hi Andrew,
Actually, my file would be of type .xlsx. I can import the dataset normally, the table is no longer unconfigured, however, even then, the same header name error appears. When I tried to use the header = TRUE option, the following message appears:
Error in read_excel ("C: / Users / Maria Eliza / Desktop / mydates.xlsx", header = TRUE): unused argument (header = TRUE)
I'm sending a photo of my data. Would it be better for me to save in .csv? is that when I put this option, my excel misconfigures the data. Or would it be better in txt? Thank you for your help
Maria
I would do exactly as the examples do unless I was comfortable with managing data types in R.
––––––––––––
Dr Andrew Jackson, PhD, FTCD Associate Professor School of Natural Sciences, Department of Zoology Trinity College Dublin, the University of Dublin Dublin 2, Ireland.
+353 1 896 2728 | a.jackson@tcd.iemailto:a.jackson@tcd.ie
Twitter: @yodacomplexhttps://twitter.com/yodacomplex http://www.tcd.ie/Zoology/research/research/theoretical/AndrewJackson.php
Trinity College Dublin, the University of Dublin is ranked 1st in Ireland and in the top 100 world universities by the QS World University Rankings.
On 25 Oct 2018, at 13:39, melizaantunes notifications@github.com<mailto:notifications@github.com> wrote:
Hi Andrew,
Actually, my file would be of type .xlsx. I can import the dataset normally, the table is no longer unconfigured, however, even then, the same header name error appears. When I tried to use the header = TRUE option, the following message appears:
Error in read_excel ("C: / Users / Maria Eliza / Desktop / mydates.xlsx", header = TRUE): unused argument (header = TRUE)
I'm sending a photo of my data. Would it be better for me to save in .csv? is that when I put this option, my excel misconfigures the data. Or would it be better in txt? Thank you for your help
Maria
[image]https://user-images.githubusercontent.com/44451607/47500610-a18e6780-d839-11e8-84bf-512d0cffeafa.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/AndrewLJackson/SIBER/issues/45#issuecomment-433034427, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADK1sBcRpgFW0xTTrm9lFuLw5UfvWJT_ks5uobENgaJpZM4X5QvB.
Hello, I work with R, Rstudio interface, I do ecology modeling. Usually I use SIMMR package and it does the trick, except this time I'd like to use SIBER alongside SIMMR, so I can build those ellipsis. I installed it, ran the example model and it worked out just fine. However, when I try to import my data and try to run it, I get the following:
library(SIBER)
import my dataset in .txt format
library(readr) dados2 <- read_csv("dados2.txt") View(dados2) mydata <- dados2 siber_example <- createSiberObject(mydata) Error in createSiberObject(mydata) : The header names in your data file must match c("iso1", "iso2", "group", "community") exactly
I already checked for the name on top, with quotes, just like it demands me to, and even still, I cant get it to run, I've tried botho .csv and .txt, and get the same error on both
Thanks a lot !!!