Hello everybody I am trying to use system.file but it returns not file found what I have done is> sample <- system.file("results.xlsx","estdata", package "readxl",mustWork = TRUE)Error in system.file("results.xlsx", "estdata", package = "readxl", mustWork = TRUE) : no file found i have checked the path was correct and the file exists with FILES <- file.path("results.xlsx") present <- file.exists(FILES) and it returned a true values. Anyone can tell me which can be the problem ? thanks Pau Marc Mu?oz Torres skype: pau_marc http://www.linkedin.com/in/paumarc http://www.researchgate.net/profile/Pau_Marc_Torres3/info/ [[alternative HTML version deleted]]
> On 22 May 2017, at 14:43 , Pau Marc Mu?oz Torres <paumarc at gmail.com> wrote: > > Hello everybody > > I am trying to use system.file but it returns not file found > > what I have done is > >> sample <- system.file("results.xlsx","estdata", package > "readxl",mustWork = TRUE) > Error in system.file("results.xlsx", "estdata", package = "readxl", > mustWork = TRUE) : > no file found > > i have checked the path was correct and the file exists with > > FILES <- file.path("results.xlsx") > present <- file.exists(FILES) > > and it returned a true values. Anyone can tell me which can be the problem ?Not if you don't tell us WHERE you expect to find the file... Where is it located, and what is the value of FILES above? It is not unlikely that you misunderstande what system.file() is supposed to do. -pd> > thanks > > Pau Marc Mu?oz Torres > skype: pau_marc > http://www.linkedin.com/in/paumarc > http://www.researchgate.net/profile/Pau_Marc_Torres3/info/ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
What is your version of readxl? In my version 1.0, there is no directory called estdata, but there is one called extdata. However, in that directory there is no file called "results.xlsx" Either it was there once and has now gone missing or "results.xlsx" your own file? It looks like the latter - and in which case, there is no point in using system.file. Rather you should use read_xlsx([path/file]). HTH Ulrik On Mon, 22 May 2017 at 14:44 Pau Marc Mu?oz Torres <paumarc at gmail.com> wrote:> Hello everybody > > I am trying to use system.file but it returns not file found > > what I have done is > > > sample <- system.file("results.xlsx","estdata", package > "readxl",mustWork = TRUE) > Error in system.file("results.xlsx", "estdata", package = "readxl", > mustWork = TRUE) : > no file found > > i have checked the path was correct and the file exists with > > FILES <- file.path("results.xlsx") > present <- file.exists(FILES) > > and it returned a true values. Anyone can tell me which can be the problem > ? > > thanks > > Pau Marc Mu?oz Torres > skype: pau_marc > http://www.linkedin.com/in/paumarc > http://www.researchgate.net/profile/Pau_Marc_Torres3/info/ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]
hi to you both You are right peter, I probably miss understood the system.file function. I was trying to use it with a package from bioconductor and when i saw that it didn't work for me, I tested with readxl and still do not working, so I am doing something wrong with system.file the original script was library(SICtools) bam1 <- system.file(package='SICtools','extdata','example1.bam') the example1.bam file is supposed to be at the working directory (i changed the directory using setwd()), it was changed to /home/paumarc/Bam i tried to change extdata for my working directory but it did not work thanks Pau Marc Mu?oz Torres skype: pau_marc http://www.linkedin.com/in/paumarc http://www.researchgate.net/profile/Pau_Marc_Torres3/info/ 2017-05-22 14:53 GMT+02:00 peter dalgaard <pdalgd at gmail.com>:> > > On 22 May 2017, at 14:43 , Pau Marc Mu?oz Torres <paumarc at gmail.com> > wrote: > > > > Hello everybody > > > > I am trying to use system.file but it returns not file found > > > > what I have done is > > > >> sample <- system.file("results.xlsx","estdata", package > > "readxl",mustWork = TRUE) > > Error in system.file("results.xlsx", "estdata", package = "readxl", > > mustWork = TRUE) : > > no file found > > > > i have checked the path was correct and the file exists with > > > > FILES <- file.path("results.xlsx") > > present <- file.exists(FILES) > > > > and it returned a true values. Anyone can tell me which can be the > problem ? > > Not if you don't tell us WHERE you expect to find the file... > > Where is it located, and what is the value of FILES above? > > It is not unlikely that you misunderstande what system.file() is supposed > to do. > > -pd > > > > > > thanks > > > > Pau Marc Mu?oz Torres > > skype: pau_marc > > http://www.linkedin.com/in/paumarc > > http://www.researchgate.net/profile/Pau_Marc_Torres3/info/ > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > -- > Peter Dalgaard, Professor, > Center for Statistics, Copenhagen Business School > Solbjerg Plads 3, 2000 Frederiksberg, Denmark > Phone: (+45)38153501 > Office: A 4.23 > Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com > > > > > > > > > >[[alternative HTML version deleted]]