Displaying 20 results from an estimated 9000 matches similar to: "reading lisp file in R"
2018 Jan 19
0
reading lisp file in R
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)
if
2018 Jan 18
0
reading lisp file in R
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 LEBOWITZ at cs.columbia.edu Mon Feb 22 20:53:02 1988
Received: from zodiac by meridian (5.52/4.7)
Received: from Jessica.Stanford.EDU by ads.com (5.58/1.9)
id AA04539; Mon, 22 Feb 88 20:59:59 PST
Received: from
2018 Jan 18
0
reading lisp file in R
> On Jan 17, 2018, at 8:22 PM, Ranjan Maitra <maitra at email.com> 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 into R. Any suggestions?
It's just a text file. What difficulties
2018 Jan 18
1
reading lisp file in R
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 thanks for your response!
Best wishes,
Ranjan
On Wed, 17 Jan 2018 20:59:48 -0800 David Winsemius
2018 Jan 18
0
reading lisp file in R
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 function read.csv.
HTH,
Eric
On Thu, Jan 18, 2018 at 6:22 AM, Ranjan Maitra <maitra at
2018 Mar 30
3
getting all circular arrangements without accounting for order
Thanks!
Yes, however, this seems a bit wasteful. Just wondering if there are other, more efficient options possible.
Best wishes,
Ranjan
On Thu, 29 Mar 2018 22:20:19 -0400 Boris Steipe <boris.steipe at utoronto.ca> wrote:
> If one is equal to the reverse of another, keep only one of the pair.
>
> B.
>
>
>
> > On Mar 29, 2018, at 9:48 PM, Ranjan Maitra
2018 Mar 30
2
getting all circular arrangements without accounting for order
Jeff,
I wanted to let you know that your function is faster than generating the directional circular permutations and weeding.
Here is the time for n = 10. I compared with just doing the permutations, there is no point in proceeding further with the weeding since it is slower at the start itself.
system.time(directionless_circular_permutations(10))
user system elapsed
1.576 0.000
2018 Mar 30
0
getting all circular arrangements without accounting for order
I don't know if this is more efficient than enumerating with distinct
directions and weeding... it seems kind of heavyweight to me:
#######
library(gtools)
directionless_circular_permutations <- function( n ) {
v <- seq.int( n-1 )
ix <- combinations( n-1, 2 )
jx <- permutations( n-3, n-3 )
x <- lapply( seq.int( nrow( ix ) )
, function( i ) {
2011 Sep 21
3
Reading data in lisp format
Hi,
I am trying to read the "credit.lisp" file of the Japanese credit database in UCI repository, but it is in lisp format which I do not know how to read. I have not found how to do that in the foreign library
http://archive.ics.uci.edu/ml/datasets/Japanese+Credit+Screening <http://archive.ics.uci.edu/ml/datasets/Japanese+Credit+Screening>
Could anyone help me?
Best
2018 Mar 30
0
getting all circular arrangements without accounting for order
New function below is a bit faster due to more efficent memory handling.
for-loop FTW!
directionless_circular_permutations2 <- function( n ) {
n1 <- n - 1L
v <- seq.int( n1 )
ix <- combinations( n1, 2L )
jx <- permutations( n-3L, n-3L )
jxrows <- nrow( jx )
jxoffsets <- seq.int( jxrows )
result <- matrix( n, nrow = factorial( n1 )/2L, ncol = n )
k
2018 Mar 30
3
getting all circular arrangements without accounting for order
Dear friends,
I would like to get all possible arrangements of n objects listed 1:n on a circle.
Now this is easy to do in R. Keep the last spot fixed at n and fill in the rest using permuations(n-1, n-1) from the gtools package.
However, what if clockwise or counterclockwise arrangements are the same? I know that half of the above (n - 1)! arrangements are redundant.
Is there an easy way to
2012 Dec 28
4
efficiently multiply different matrices in 3-d array with different vectors?
Hello,
I have been wondering of an efficient way to do this:
I have an n x m x p array Z and a p x n matrix Y.
I want to multiply each of the n matrices with the corresponding column
vector of Y.
In other words, I am wanting to matrix multiply:
Z[i, ,] %*% Y[, i]
which will give me a (two-dimensional) array or matrix of dimension n x
p with the i'th row storing the above.
Any pointers
2018 Mar 30
0
getting all circular arrangements without accounting for order
If one is equal to the reverse of another, keep only one of the pair.
B.
> On Mar 29, 2018, at 9:48 PM, Ranjan Maitra <maitra at email.com> wrote:
>
> Dear friends,
>
> I would like to get all possible arrangements of n objects listed 1:n on a circle.
>
> Now this is easy to do in R. Keep the last spot fixed at n and fill in the rest using permuations(n-1, n-1)
2012 Jul 21
2
two questions re: the use of lattice
Dear friends,
I have two questions regarding the use of lattice. First some code:
## begin code
z <- cbind(rep(c("BIC", "ICL", "s_v", "Q_v", "sig-q",
"s_lsk", "s_lML", "s_mlsk", "s_mlML", "s_la8",
"s_haar"), each = 250), rep(c(5, 10, 20, 30, 50), each = 50))
z
2017 Oct 08
2
how to overlay 2d pdf atop scatter plot using ggplot2
Note: I have posted this on SO also but while the question has been
upvoted, there has been no answer yet.
https://stackoverflow.com/questions/46622243/ggplot-plot-2d-probability-density-function-on-top-of-points-on-ggplot
Apologies for those who have seen it there also but I thought that this
list of experts may have someone who knows the answer.
I have the following example code:
2017 Jun 29
0
package to fit mixtures of student-t distributions
Would package "teigen" help?
Ranjan
On Thu, 29 Jun 2017 14:41:34 +0200 vare vare via R-help <r-help at r-project.org> wrote:
> Hello!
>
> I am new to R (before used python exclusively and would actually call the R solution for this issue inside a python notebook, hope that doesn?t disqualify me right of the batch).
>
> Right now I am looking for a piece of
2017 Oct 08
0
how to overlay 2d pdf atop scatter plot using ggplot2
Hi,
I am no expert on ggplot2 and I do not know the answer to your question. I looked around a bit but could not find an answer right away. But one possibility could be, if a direct approach is not possible, to draw ellipses corresponding to the confidence regions of the multivariate t density and use geom_polygon to draw this successively?
I will wait for a couple of days to see if there is a
2001 Feb 23
4
hclust question
Dear all,
I have a question with regard to the use of hclust. I would like to be
able to specify my own distance matrix instead of asking R to compute
the distance matrix for me. It is computationally easier for me this
way. My question is: How can I get hclust to accept this?
Thanks,
Ranjan
--
***************************************************************************
Ranjan
2011 Mar 20
3
manova question
Dear friends,
Sorry for this somewhat generically titled posting but I had a question
with using contrasts in a manova context. So here is my question:
Suppose I am interested in doing inference on \beta in the case of the
model given by:
Y = X %*% \beta + e
where Y is a n x p matrix of observations, X is a n x m design matrix,
\beta is m x p matrix of parameters, and e is a
2017 Aug 24
1
Scaling Matrix in qda() function in MASS package
I guess the question that is being asked here is what is the scaling matrix that is being returned in the qda object. The help file on qda() says:
...
scaling: for each group ?i?, ?scaling[,,i]? is an array which transforms observations so that within-groups covariance matrix is spherical.
...
This is a bit ambiguous. I tried a few cases (spectral, QR decomposition, especially given that it is an