If I understand your problem correctly, I think you need to be doing: summary(data.name)
The functions read.dta and read.spss both return things (data frames, if you use the to.data.frame=T argument with read.spss). So whatever variable you set is what you should be doing a summary on. In this case, you are setting data.name to be the data frame returned by read.dta: data.name <- read.dta(file.choose()) If you'd rather, you could use: kelleya <- read.dta(file.choose()) summary(kelleya) Hope that helps, Jeff. On Sat, Oct 2, 2010 at 10:01 PM, Alla Manukyan <allama...@yahoo.com> wrote: > Dear Sir/Madam, > I have just installed R for Windows. I am trying to open a stata file and I > have > a problem. I have used the following commands: > >> install.packages("foreign") >> library(foreign) > >> data.name <- read.dta(file.choose()) > > > # then I choose a kelleya.dta file and click on open and then I use the > following command: > >> summary(kelleya) > > Error in object[[i]] : object of type 'closure' is not subsettable > I have also used opening an spss file using read.spss command but I get the > same > error message. Can you help me please? > > Alla > > ______________________________________________ > R-help@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. > ______________________________________________ R-help@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.