Re: [R] reading lisp file in R

2018-01-20 Thread Ranjan Maitra
Thank you for your example. I have successfully modified it with regard to most fields. However, I think that am not going to be putting this out for my students. The class I am currently teaching is in multivariate statistics (both methods and applications, with R used for computing) and I use

Re: [R] reading lisp file in R

2018-01-18 Thread Martin Møller Skarbiniks Pedersen
Here are the beginning of a R program. I hope it can help you writing the rest of the program. Regards Martin M. S. Pedersen filename <- "university.data" lines <- readLines(filename) first <- T for (ALine in lines) { ALine <- sub("^ +","",ALine) ALine <- sub(")","",ALine, fixed = T)

Re: [R] reading lisp file in R

2018-01-18 Thread peter dalgaard
Yes, and the structure is obviously case-insensitive. More troublesome is probably that there can be multiple ACADEMIC-EMPHASIS entries, which can be tricky to tidify. Also one would need to figure out what is the meaning of lines like (DEFPROP BOSTON-COLLEGE0 T DUPLICATE) -pd > On 18 Jan

Re: [R] reading lisp file in R

2018-01-18 Thread Barry Rowlingson
The file also has a bunch of email headers stuck in the middle of it: . (QUALITY-OF-LIFE SCALE:1-5 4) (ACADEMIC-EMPHASIS HEALTH-SCIENCE) ) --- --- >From lebow...@cs.columbia.edu Mon Feb 22 20:53:02 1988 Received: from zodiac by meridian (5.52/4.7) Received: from

Re: [R] reading lisp file in R

2018-01-18 Thread Peter Crowther
That's a nice example of why Lisp is both powerful and terrifying - you're looking at a Lisp *program*, not just Lisp *data*, as Lisp makes no distinction between the two. You just read 'em in. The two definitions at the bottom are function definitions. The top one defines the def-instance

Re: [R] reading lisp file in R

2018-01-17 Thread Ranjan Maitra
Thanks! I guess one way to do it in R would be to read the lines and then do character parsing (string-matching and other operations) to save as a data frame and forget about the lines at the end perhaps? I am not sure how general such a scheme would be: that is also something I would like to

Re: [R] reading lisp file in R

2018-01-17 Thread Ranjan Maitra
Thanks! I am trying to use it in R. (Actually, I try to give my students experiences with different kinds of files and I was wondering if there were tools available for such kinds of files. I don't know Lisp so I do not actually know what the lines towards the bottom of the file mean.( Many

Re: [R] reading lisp file in R

2018-01-17 Thread Eric Berger
It seems the file contains records, with each record having 18 fields. I would use awk (standard unix tool), creating an awk script to process the file into a new file with one line for each record, each line with 18 fields, say comma-separated. The csv file can then be easily read into R via the

Re: [R] reading lisp file in R

2018-01-17 Thread David Winsemius
> On Jan 17, 2018, at 8:22 PM, Ranjan Maitra wrote: > > Dear friends, > > Is there a way to read data files written in lisp into R? > > Here is the file: > https://archive.ics.uci.edu/ml/machine-learning-databases/university/university.data > > I would like to read it

[R] reading lisp file in R

2018-01-17 Thread Ranjan Maitra
Dear friends, Is there a way to read data files written in lisp into R? Here is the file: https://archive.ics.uci.edu/ml/machine-learning-databases/university/university.data I would like to read it into R. Any suggestions? Thanks very much in advance for pointers on this and best wishes,