Skip to content

stata ==> R - error messages

9 messages · Jim Lemon, Peter Dalgaard, Rob Bakker +2 more

#
Rob Bakker wrote:
Hi Rob,
Looks like you're on Windows, and you have probably fallen victim to the 
Microsoft  (and Apple) "hide-everything-you-can-from-them" file manager 
defaults. Your file "Rklein" probably has an extension on it (maybe 
.dta?) and if you can find that by turning off extension hiding, you 
will probably see the solution immediately.

Jim
#
Jim Lemon wrote:
Also, notice the function choose.file() which lets browse your way to
the file in the usual Windows style. If used on its own, then it returns
the full path to the file, so that you know what to feed to read.dta().

You can short-circuit by using read.dta(choose.file()), but if you do it
in a script, then you need to do the browsing every time you run the
script.
#
On 24/04/2009 7:42 AM, Peter Dalgaard wrote:
The function name is actually file.choose(), which exists on all (?) 
platforms.  There's also a function choose.files(), only on Windows, and 
mainly used for choosing multiple files (but it has a few other 
Windows-only differences from file.choose()).

Duncan Murdoch
#
Rob Bakker wrote:
As Duncan points out, it is file.choose(), sorry about that - I don't
use Windows regularly.

Notice also that you need to run it _without_ any argument.
#
On Fri, Apr 24, 2009 at 01:50:04PM +0200, Rob Bakker wrote:
a) quote the filename
b) include the suffix

rklein <- read.dta("C:\Rklein.dta")
#
On 4/24/2009 10:18 AM, Hans Ekbrand wrote:
c) use forward slashes, or double backslashes:

rklein <- read.dta("C:/Rklein.dta")

Duncan Murdoch