Re: [R] re ad and check table

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Fri, 18 Jul 2008 13:28:22 -0300

Maybe something like this:

stopifnot(tail(unlist(strsplit("slides.pdf", "\\.")), 1) == "txt")

On Fri, Jul 18, 2008 at 12:51 PM, mysimbaa <adel.tekari_at_sisltd.ch> wrote:
>
> Dear R users,
> I want to read a file like following :
>
> if it is a table then z <- read.table(pathname, dec=".", header=TRUE)
> else if it's not a table (image,doc,...) then send an error or something
> like that
>
> acually I have a read.table in the beginnig of my R code, and if my data is
> not a table I become in my R console : fail in scan.
> So the question is how to check the nature of the file?
> something like : is.table?
> I don't know the function.
>
> Thanks for any help
> Adel
> --
> View this message in context: http://www.nabble.com/read-and-check-table-tp18532292p18532292.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Fri 18 Jul 2008 - 16:40:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jul 2008 - 17:31:51 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive