[R] integer to date-format

2007-06-05 Thread Rina Miehs
hello I have a problem... I have to subtract an integer from a date-format and that is not possible! How is it possible to convert an integer to a date-format?? any date format? i cant make it work without errors... Thanks Rina Miehs [[alternative HTML version deleted]]

[R] multiple plot in odfWeave

2007-06-05 Thread Laurence Amilhat
Hello R users, I found the odfWeave package to create an odf document. It seems to be a very nice tool. So i tried to used it to create a report with multiple plot: I create an odt file with some code inside: I connect to a mysql database I get a list of projects foreach project I would like

Re: [R] klaR stepclass

2007-06-05 Thread Uwe Ligges
Neil Losin wrote: Hi, I'm trying to use stepclass to do a stepwise variable selection with method=lda. I keep getting this warning message, which shows up once for each variable added to the model during variable selection: Warning message: error(s) in modeling/prediction step in:

Re: [R] integer to date-format

2007-06-05 Thread Uwe Ligges
Rina Miehs wrote: hello I have a problem... I have to subtract an integer from a date-format and that is not possible! The Exmaples section in ?DateTimeClasses shows that it works well: Sys.time() - 3600 # an hour ago Uwe Ligges How is it possible to convert an integer

Re: [R] Why is the R mailing list so hard to figure out?

2007-06-05 Thread Gavin Simpson
On Mon, 2007-06-04 at 18:25 -0500, Robert Wilkins wrote: Why does the R mailing list need such an unusual and customized user interface? Last January, I figured out how to read Usenet mailing lists ( or Usenet groups ) and they all pretty much work the same, learn to use one, you've

Re: [R] Question using stepAIC

2007-06-05 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Hi - I use stepAIC to automatically select the model. The stepAIC was applied on polr as follow:objPolr - polr(formula=myformula, data=dat, method=METHOD);objPolr.step - stepAIC(objPolr, trace=T);Then R complaints that it doesn't know about 'dat' when it executes

Re: [R] multiple plot in odfWeave

2007-06-05 Thread Laurence Amilhat
Hello, To clarify my question: When I launch the odfWeave function in the R console, I see the several maps in the R graphic window, but I cannot open the output file .odt I get the following error: format error in the subdocument content.xml position 123,82 (row,col) Thanks, Laurence

Re: [R] biplot package

2007-06-05 Thread Mark Difford
Hi Jose, Good idea. I haven't yet run your code, but it might be a good idea to take a look at the calibrate package (unfortunately not upgraded since its first release), and at what Chessel and his group have done in package ade4, as well as what Jari Oksanen his co-authors have done in

Re: [R] Why is the R mailing list so hard to figure out?

2007-06-05 Thread Vladimir Eremeev
irishhacker wrote: Why does the R mailing list need such an unusual and customized user interface? There was a discussion of this some time ago on the list. I believe, RSiteSearch(r-help mailing list forum) or some other similar keywords will find it. irishhacker wrote: What's the

Re: [R] lme vs. SAS proc mixed. Point estimates and SEs are the same, DFs are different

2007-06-05 Thread Peter Dalgaard
John Sorkin wrote: R 2.3 Windows XP I am trying to understand lme. My aim is to run a random effects regression in which the intercept and jweek are random effects. I am comparing output from SAS PROC MIXED with output from R. The point estimates and the SEs are the same, however the DFs

[R] extract data from Access

2007-06-05 Thread livia
Hi, I have imported an Access Database into R. There are three variables in the Access database, return, a and b. Among them a and b are factors. I would like to extract return from it, i.e return of a in level 1 and b in level 2. I would appreciate any advice. Many thanks. -- View this message

Re: [R] lme vs. SAS proc mixed. Point estimates and SEs are the same, DFs are different

2007-06-05 Thread Peter Dalgaard
Peter Dalgaard wrote: John Sorkin wrote: R 2.3 Windows XP I am trying to understand lme. My aim is to run a random effects regression in which the intercept and jweek are random effects. I am comparing output from SAS PROC MIXED with output from R. The point estimates and the SEs are

[R] help with simple R-question

2007-06-05 Thread Rina Miehs
hello what do i write for R to recognize both columns? In the R-script downunder you can see that i use tapply to get my information out of my data, and then i need to use it as a dataframe with both columns! It is like R is using the first column as an observationnumber or something, how can

Re: [R] biplot package

2007-06-05 Thread Jari Oksanen
joseclaudio.faria joseclaudio.faria at terra.com.br writes: Dears, I've been learning biplot (Gabriel, 1971) and I found the function 'biplot', inside of the package 'stats', useful but, a bit limited. So, I'm thinking to start a colaborative package to enhance this methods to other

[R] Population genetics tests for neutral evolution

2007-06-05 Thread Peter Pfaffelhuber
Dear R, I am working with DNA data (nexus-Format) and want to do some population genetics analysis. There are some standard test for neutral evolution, e.g. Tajima's D, Fu+Li's D, the McDonald Kreitman test and the HKA test. Does anyone know, if these tests are already implemented in R (or

[R] Latex \ell symbol in plotmath

2007-06-05 Thread Mario dos Reis
Is it possible to use the '\ell' (i.e. the log likelihood) in plots? I've been browsing the plotmath documentation unsucesfully. Cheers, Mario dos Reis [EMAIL PROTECTED] +44 (0)20 8816 2300 Division of Mathematical Biology National Institute for Medical Research The Ridgeway Mill Hill London,

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread vito muggeo
Dear Mario, I don't know whether the $\ell$ symbol is available .. However you can use the LaTeX psfrag/pdfrag packages to convert tags in latex symbols.. hope this helps, vito Mario dos Reis wrote: Is it possible to use the '\ell' (i.e. the log likelihood) in plots? I've been browsing the

Re: [R] rq matrix decomposition

2007-06-05 Thread Kasper Kristensen
I guess you could achieve the rq-decompostion like this: ## Transpose and permute pt - function(A){n - nrow(A);t(A)[n:1,n:1]} ## pt(A)=QR == A=pt(R)pt(Q) rq - function(A){ qr - qr(pt(A)) list(Q=pt(qr.Q(qr)),R=pt(qr.R(qr))) } ## Test it A - matrix(rnorm(25),5) Q - rq(A)$Q R - rq(A)$R

[R] Lines to plots with a for-loop

2007-06-05 Thread Saanisto, Taija
Hello all, I'm plotting several graphs with a for-loop with a code: par(mfrow=c(3,4)) for(i in levels(fHCGB$code)) with(subset(fHCGB,code==i), plot(pooledPlateIntra, type=b, ylim=ylim, xlab=code, ylab=CV%)) With which I have no problems.. However I need to add lines to all of these 12 plots,

[R] plot histogram and print

2007-06-05 Thread livia
I have got a dataset with two factors, and I would like to print the histograms of the variable return for each combination of the two factors. I do not know how can I name the figure title to sth like main=alevel blevel according to the data. par(ask=TRUE) myhistogram - function(x) { hist (x,

Re: [R] lme vs. SAS proc mixed. Point estimates and SEs are the same, DFs are different

2007-06-05 Thread Doran, Harold
In addition to Peter's comments, the following link summarizes the issue as well. This is a direct response to the SAS/lmer DF issue. https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [R] Lines to plots with a for-loop

2007-06-05 Thread ONKELINX, Thierry
Dear Taija, You want lines but use points? Try for(i in levels(fHCGB$code)){ with(subset(fHCGB,code==i), plot(pooledPlateIntra, type=b, ylim=ylim, xlab=code, ylab=CV%) lines(fHCGB$limitVarC, col=green)) } Cheers, Thierry

[R] Problems with Merge

2007-06-05 Thread Patnaik, Tirthankar
Hi, I have a history dataset, a matrix with about 1590 obs, and 242 cols, and I need to update this matrix with an 'update' matrix that has about 30 rows, and roughly similar number of columns as the history ds (but not necessarily equal). The update dataset is read from an Excel ODBC connection.

Re: [R] Lines to plots with a for-loop

2007-06-05 Thread Peter Dalgaard
Saanisto, Taija wrote: Hello all, I'm plotting several graphs with a for-loop with a code: par(mfrow=c(3,4)) for(i in levels(fHCGB$code)) with(subset(fHCGB,code==i), plot(pooledPlateIntra, type=b, ylim=ylim, xlab=code, ylab=CV%)) With which I have no problems.. However I need to add

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, Mario dos Reis wrote: Is it possible to use the '\ell' (i.e. the log likelihood) in plots? 'plots'? On what OS and what device? (There is no general solution here.) I've been browsing the plotmath documentation unsucesfully. That symbol is in neither of the Latin-1

Re: [R] Front end for R in Mac,

2007-06-05 Thread Ken Nussear
Em Segunda 04 Junho 2007 07:57, KK escreveu: Hello all. I just switched from Windows to Mac and I am trying to find a good front end for R in Mac that is relatively user friendly and works well. I have used RWinEdt for several years in Windows, and something similar to RWinEdt

[R] Refactor all factors in a data frame

2007-06-05 Thread Hilmar Berger
Hi all, Assume I have a data frame with numerical and factor variables that I got through merging various other data frames and subsetting the resulting data frame afterwards. The number levels of the factors seem to be the same as in the original data frames, probably because subset() calls

Re: [R] Problems with Merge

2007-06-05 Thread Prof Brian Ripley
Take a look at the help for merge(): in all the examples by.x is a character string, not a one-column data frame which is what rhistory[Date] would appear to be. Please note the trailer of this messsage. On Tue, 5 Jun 2007, Patnaik, Tirthankar wrote: Hi, I have a history dataset, a matrix

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Alberto Monteiro
Prof Brian Ripley wrote: It is Unicode character U+2113, and so on UTF-8 R systems you may well be able to enter it as \u2113 and get it plotted on-screen in a suitable font. But we'd need to know a lot more about your system to advise on how exactly to do so. I must be sleeping, but I

Re: [R] Why is the R mailing list so hard to figure out?

2007-06-05 Thread Martin Maechler
VE == Vladimir Eremeev [EMAIL PROTECTED] on Tue, 5 Jun 2007 01:39:47 -0700 (PDT) writes: VE irishhacker wrote: Why does the R mailing list need such an unusual and customized user interface? Well, that's VERY MUCH a matter of point of view, and the view is most

Re: [R] Problems with Merge

2007-06-05 Thread Patnaik, Tirthankar
Prof. Ripley, Date is a column in a matrix, which should be ok for the merge. Actually the IMHO problem was with the default sorting option, I set sort=FALSE, and the merge happened as it should. Best, -Tir Tirthankar Patnaik Analyst, India Strategy Citigroup Investment Research

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread hadley wickham
Hi Hilmar, Try this: cat - sapply(df, is.factor) df[cat] - lapply(df[cat], factor) Hadley On 6/5/07, Hilmar Berger [EMAIL PROTECTED] wrote: Hi all, Assume I have a data frame with numerical and factor variables that I got through merging various other data frames and subsetting the

Re: [R] help with simple R-question

2007-06-05 Thread John Kane
--- Rina Miehs [EMAIL PROTECTED] wrote: hello what do i write for R to recognize both columns? In the R-script downunder you can see that i use tapply to get my information out of my data, and then i need to use it as a dataframe with both columns! It is like R is using the first

[R] Inverse of encodeString

2007-06-05 Thread Alberto Monteiro
What is the inverse of encodeString? For example, \u1 is some Unicode symbol. If I do s - encodeString(\u1) then s will be the string \001. But anything I do with s, will not return the Unicode that corresponds to \u1: cat(s, \n) # prints \001 cat(\u1, \n) # prints y with umlaut Alberto

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread John Fox
Dear Hilmar, You could use something like DF - as.data.frame(lapply(DF, function (x) if (is.factor(x)) factor(x) else x)) Where DF is the data frame. I hope this helps, John John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Mario dos Reis
I am using R 2.5.0 on Fedora Linux core 6, AMD 64. Prof Brian Ripley wrote: On Tue, 5 Jun 2007, Mario dos Reis wrote: Is it possible to use the '\ell' (i.e. the log likelihood) in plots? 'plots'? On what OS and what device? (There is no general solution here.) I've been browsing

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread Hilmar Berger
Hi, the best solution I found so far is (assuming data is your data.frame): # identify all factor variables factor.list = colnames(data)[sapply(data,class) == factor] # use transform to apply factor() to all factor variables trans.vars =paste(factor.list,=factor(,factor.list,),sep=,collapse=,

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, Mario dos Reis wrote: I am using R 2.5.0 on Fedora Linux core 6, AMD 64. So for a suitable font you should be able to make this work on X11: I did on my FC5 Opteron system (but the fonts are on a fully loaded separate font server). Prof Brian Ripley wrote: On Tue, 5 Jun

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, Alberto Monteiro wrote: Prof Brian Ripley wrote: It is Unicode character U+2113, and so on UTF-8 R systems you may well be able to enter it as \u2113 and get it plotted on-screen in a suitable font. But we'd need to know a lot more about your system to advise on how

Re: [R] test for nested factors

2007-06-05 Thread J. R. M. Hosking
Tim Bergsma wrote: Is there a conventional way to test for nested factors? I.e., if 'a' and 'b' are lists of same-length factors, does each level specified by 'a' correspond to exactly one level specified by 'b'? all( tapply(b, a, function(x) length(unique(x))==1 )) J. R. M. Hosking

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread hadley wickham
Hi Hilmar, What was wrong with my solution? It's much simpler and shorter. cat - sapply(df, is.factor) df[cat] - lapply(df[cat], factor) Hadley On 6/5/07, Hilmar Berger [EMAIL PROTECTED] wrote: Hi, the best solution I found so far is (assuming data is your data.frame): # identify all

[R] odfTable

2007-06-05 Thread Laurence Amilhat
Hello, I am using the odfWeave packages; I draw a table using the function odfTable: partCols - gsub(“\\.”, “ “, names(partenaires)) odfTable(partenaires, useRowNames = FALSE, colnames=partCols) it's working as I have a table in my output file. I would like to know how to change the background

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, John Fox wrote: Dear Hilmar, You could use something like DF - as.data.frame(lapply(DF, function (x) if (is.factor(x)) factor(x) else x)) Where DF is the data frame. I think DF[] - lapply(DF, [, drop=TRUE) is more likely to be what is wanted. That drops factor

[R] help with using grid to modify ggplot/lattice plots

2007-06-05 Thread Vikas Rawal
I want to use grid to modify some boxplots made using ggplot. I would really appreciate if somebody could guide me to a resource on how to use grid to modify such graphics. I guess the basic approach will be similar to using grid to modify lattice graphics. To that extent something that explains

Re: [R] Inverse of encodeString

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, Alberto Monteiro wrote: What is the inverse of encodeString? For example, \u1 is some Unicode symbol. If I do s - encodeString(\u1) then s will be the string \001. But anything I do with s, will not return the Unicode that corresponds to \u1: cat(s, \n) # prints \001

[R] standard error of skewness

2007-06-05 Thread livia
Hi, I just wonder how can I calculate the standard error of skewness? Basiclly, I would like to test whether it is too skewed or not? Many thanks -- View this message in context: http://www.nabble.com/standard-error-of-skewness-tf3872201.html#a10970956 Sent from the R help mailing list

[R] the biggest integer R can display in complete form but not scientific form

2007-06-05 Thread 李俊杰
Dear R-lister, One of my friends wanted to produce random number which is 64 bits. He did it with Fortune. I think R can do it also. But I don't know how to display a very big integer in the complete form but not scientific form. And what's the biggest integer R can display in complete form ?

Re: [R] odfTable

2007-06-05 Thread Sarah Goslee
Hi, There are a couple of steps, and it requires use of the newest version of odfWeave. First, you need to set up the table styles in R _before_ you run odfWeave. Here's an example: # Now to specify the styles themselves # The default list has 10 styles in it right now.

[R] Can I treat subject as fixed effect in linear model

2007-06-05 Thread shirley zhang
Hi, There are 20 subjects grouped by Gender, each subject has 2 tissues (normal vs. cancer). In fact, it is a 2-way anova (factors: Gender and tissue) with tissue nested in subject. I've tried the following: Model 1: lme(response ~ tissue*Gender, random = ~1|subject) Model 2: response ~

Re: [R] RMySQL question, sql with R vector or list

2007-06-05 Thread Chris Stubben
I am trying to write a RMySQL sql script inside R such that part of the SQL would be R list or vector. For example, I want to select * from Atable where ID would equal to a members of R list or vector of 1, 2, 3. Here the ID list was generated inside R and then try to feed to mysql to call

[R] Still having problemes when loading RMySQL

2007-06-05 Thread Paulino Perez Rodriguez
I am Still having problems when loading RMySQL under R-2.4.1, I am using RMySQL_0.6-0 and MySQL 5.0.41 under WinXP. I have added RMySQL\lib to the PATH, prior to launching R, but the problem is the same: library(RMySQL) Error in dyn.load(x, as.logical(local), as.logical(now)) :

Re: [R] multiple plot in odfWeave

2007-06-05 Thread Kuhn, Max
Laurence, I haven't seen any issues like this. Can you: 1. Send the results of sessionInfo() 2. Try using carte2, echo = FALSE, results= xml, fig = TRUE=. It sounds like the text being written to the xml file is not valid xml. This could be the case if results != xml. 3. If that doesn't

Re: [R] GUI for R running under Linux

2007-06-05 Thread Bos, Roger
I am not very good with Linux, but I have a setup that works pretty well using the KDE desktop environment, which offers Kate. Once inside Kate you can open a terminal session and start R there. Then you can send code snippets from Kate to R and see the output. Its not as good as Tinn-r under

Re: [R] Mandriva Spring 2007 and R

2007-06-05 Thread Roland Rau
Hi Jonathan, Jonathan Morse wrote: I am new to Linux (not to R) and recently installed Mandriva Spring 2007 on my partitioned hard drive. My next objective is to install R in the Linux environment, unfortunately Mandriva is not one of the Linux distributions available for download...

[R] read table

2007-06-05 Thread jiqiang yao
Hi, I'm a novice of R. I want to read the following table into R: names mpgcyl disp hp drat Mazda RX4 21.0 6160.0 110 3.90 Mazda RX4 Wag 21.0 6160.0 110 3.90 The command I used is: test - read.table(file.choose(),header=T) The result is:

Re: [R] GUI for R running under Linux

2007-06-05 Thread Stefan Grosse
Hi John, I use JGR when I am on Fedora. This is a good java gui which is similiar (and better) compared to the R windows gui . You can install it via install.packages(JGR,dep=T) and start with library(JGR). Sometimes Java is not configured correctly so you might end up with an error. In that case

Re: [R] the biggest integer R can display in complete form but not scientific form

2007-06-05 Thread Roland Rau
李俊杰 wrote: Dear R-lister, One of my friends wanted to produce random number which is 64 bits. He did it with Fortune. I think R can do it also. But I don't know how to display a very big integer in the complete form but not scientific form. And what's the biggest integer R can display in

Re: [R] odfTable

2007-06-05 Thread Kuhn, Max
Sarah and Laurence, A few comments: 1. The default background color for columns is horrible. I've changed to white it in the upcoming version. 2. In the next version (in 1-2 weeks), I have a fairly long document that goes into much more detail about the specific styles that can be changed

Re: [R] read table

2007-06-05 Thread Stefan Grosse
Original Message Subject: [R] read table From: jiqiang yao [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Date: 05.06.2007 18:17 Hi, I'm a novice of R. I want to read the following table into R: names mpgcyl disp hp drat Mazda RX4 21.0

Re: [R] read table

2007-06-05 Thread jiqiang yao
Thanks. It works after I change the space in the names with underscore. --- Sarah Goslee [EMAIL PROTECTED] wrote: The default separator in read.table is white space, so the first line (header) has 6 elements, the second line has 7 elements, and the third has 8 elements. Either delete the

Re: [R] read table

2007-06-05 Thread Sarah Goslee
The default separator in read.table is white space, so the first line (header) has 6 elements, the second line has 7 elements, and the third has 8 elements. Either delete the spaces in the car names, or use sep=\t (or whatever is appropriate). ?read.table explains this. Sarah On 6/5/07,

Re: [R] odfTable

2007-06-05 Thread Sarah Goslee
3. To simply Sarah's approach, add the style definition via setStyleDefs(existingStyles) as suggested. Then, just before making the table, simply use current - getStyles() currrent$header - newStyle1 setStyles(current) then produce the table. Unless I'm not understanding what you

Re: [R] Refactor all factors in a data frame

2007-06-05 Thread Hilmar Berger
Hi, thanks for all suggestions - I found a solution myself within 5 minutes, but your suggestions are surely more elegant / shorter. Thanks again, Hilmar hadley wickham schrieb: Hi Hilmar, What was wrong with my solution? It's much simpler and shorter. cat - sapply(df, is.factor)

Re: [R] read table

2007-06-05 Thread John Kane
R considers Mazda RX4 Wag to be three columns. There fore you have 6 columns of data and only 6 names. Use like this Mazda RX4 and Mazda Rx4 Wag to indicate each is a single character value. --- jiqiang yao [EMAIL PROTECTED] wrote: Hi, I'm a novice of R. I want to read the

Re: [R] locked environment and inheritance

2007-06-05 Thread Seth Falcon
johan Faux [EMAIL PROTECTED] writes: Thanks for your reply. Experimenting a little further, I was able to learn a bit more and find what is the real problem of mine what the real question is. I could create my S4 extended class by adding these two lines in my namespace file

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Alberto Monteiro
Prof Brian Ripley wrote: I must be sleeping, but I can't think about a program that lists all Unicode characters. A stupid and dirty solution would be: You realize there are millions of them? (2^21, in theory.) :-) Yes, but in Windows there are only 256... cat(u 31 = \u31\n) cat(u 32 =

Re: [R] Extracting lists in the dataframe $ format

2007-06-05 Thread John Kane
I think your indexing is wrong in the function. Note the tble[a] rather than tble[,a]. Try: regression=function(tble,a,b) { plot.new() plot(tble[,a]~tble[,b]) lmm=lm(tble[,a]~tble[,b]) abline(lmm) anova(lmm) } --- Stan Hopkins

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread hadley wickham
On 6/5/07, Alberto Monteiro [EMAIL PROTECTED] wrote: Prof Brian Ripley wrote: I must be sleeping, but I can't think about a program that lists all Unicode characters. A stupid and dirty solution would be: You realize there are millions of them? (2^21, in theory.) :-) Yes, but in

Re: [R] Latex \ell symbol in plotmath

2007-06-05 Thread Alberto Monteiro
hadley wickham wrote: intToUtf8(33) # error. Argument x must be an integer vector intToUtf8(33:35) # ok intToUtf8(40 + 0:9) # error. Argument x must be an integer vector Well you need to give it integers! intToUtf8(33L) intToUtf8(40L + 0:9) As I wrote before, 33L or 40L return an

Re: [R] Mandriva Spring 2007 and R

2007-06-05 Thread Bricklemyer,Ross S
Jonathan, I was in the same predicament not long ago with Mandriva 2007. You will need to compile and build R from the source code. I have not completely gotten all of the bugs worked out on my system, but I am still quite new to linux. Good luck. Ross

Re: [R] RMySQL question, sql with R vector or list

2007-06-05 Thread Waverley
Thanks Chris. I think this should work. I have one more question regarding this. Is that possible to write some PL/SQL scripts integrated inside R, it is the same token like I have asked in my previous question. In this way, native R data structures can be passed to the MYSQL data base

[R] rJava installation under linux: configuration failed

2007-06-05 Thread zhihua li
Hi netter, Recently I was trying to install rJava. The operating system is suse 10.0, and the R versionis 2.5.0. Following the instructions of R Wiki for rJava, I did configuration first: R CMD javareconf and then it showed a series of information, from what it seems that java is in the

Re: [R] read table

2007-06-05 Thread Prof Brian Ripley
On Tue, 5 Jun 2007, Sarah Goslee wrote: The default separator in read.table is white space, so the first line (header) has 6 elements, the second line has 7 elements, and the third has 8 elements. Either delete the spaces in the car names, or use sep=\t (or whatever is appropriate). Or add

Re: [R] RMySQL question, sql with R vector or list

2007-06-05 Thread bogdan romocea
With regards to your concern - export the R object to a MySQL table (the RMySQL documentation tells you how), then run an inner join. Or if the table to query isn't that big, pull it in R and subset it with %in%. You could use system.time() to see which runs faster. -Original Message-

Re: [R] RMySQL question, sql with R vector or list

2007-06-05 Thread Waverley
Thanks for the tip. But this is different from what I asked. I know how to export the R object to a MySQL table. But what I don't know how I can use R objects as variables in constructing SQLs to integrrogate MYSQL database. Chris's suggestion using paste to construct is one which basically

Re: [R] RMySQL question, sql with R vector or list

2007-06-05 Thread Chris Stubben
dynamically, rather than statically like using paste. One concern using paste to construct the SQL command is this: what about if the ID list in your sample becomes very large, is this a problem to construct this way? I have not messed with procedures in mysql 5, so I have no idea about

[R] One-dimensional point processes

2007-06-05 Thread dhinds
I'm interested in characterizing data from a one-dimensional point process... say, testing for stationarity, or measuring the degree of clustering at different length scales. This sounds like a spatial statistics problem but the available tools all seem focused on 2+ dimensional data. Time

Re: [R] naiveBayes other than e1071

2007-06-05 Thread Saeed Abu Nimeh
Max, Thanks. I have tried it but i keep getting an error: Error in as.vector(x, mode) : invalid argument 'mode' Do I have to do something specific when using the class column. I tried both y.y-as.vector and y.y-as.factor. dread-read.table('dataset.csv',sep=,) x.x-as.matrix(dread[,2:256])

[R] logit model interpretation

2007-06-05 Thread violeta834
Hello everyone I appologize for my lack of experience in statistical methods. I am an R user begginer and I am running a logit model using zelig and pcse packages. I will go to the point and is that Im having problems with interpreting the results of my models.. It is really simple (I guess for

Re: [R] naiveBayes other than e1071

2007-06-05 Thread Uwe Ligges
Saeed Abu Nimeh wrote: Max, Thanks. I have tried it but i keep getting an error: Error in as.vector(x, mode) : invalid argument 'mode' Do I have to do something specific when using the class column. I tried both y.y-as.vector and y.y-as.factor. dread-read.table('dataset.csv',sep=,)

Re: [R] logit model interpretation

2007-06-05 Thread Petr Klasterecky
Hi, this is a standard (logistic) regerssion output and the meaning of coefficients and other terms is described in standard textbooks. Applied linear statistical models by Neter, Kutner, Nachtsheim Wassermann is a good start to regression in general, (An introduction to) Categorical data

[R] R CMD BATCH command

2007-06-05 Thread Austin, Peter
The version of R on our unix system has been updated to version 2.5.0. When I type the following command at the unix prompt: 'R CMD BATCH filename' I receive the following error message: Error in Sys.unsetenv(R_BATCH) : 'Sys.unsetenv' is not available on this system Execution halted. 'R

[R] ggplot aspect ratio

2007-06-05 Thread Ross Boylan
Is there a way to control the aspect ratio of plots using ggplot? Specifically, I'm using the formula=a~b argument to produce a grid of plots, but the overall width of the result seems to vary for reasons that are obscure to me. This affects not only the appearance of the plots but the amount of

Re: [R] naiveBayes other than e1071

2007-06-05 Thread Kuhn, Max
Saeed and Uwe, The underlying problem is the distribution of the data. For example: table(x.x[,91], y.y) y.y 01 0.000675027 24120 0.0021848920 481 When the function tries to estimate the distribution of this feature for each class, it gets:

Re: [R] R CMD BATCH command

2007-06-05 Thread Peter Dalgaard
Austin, Peter wrote: The version of R on our unix system has been updated to version 2.5.0. When I type the following command at the unix prompt: 'R CMD BATCH filename' I receive the following error message: Error in Sys.unsetenv(R_BATCH) : 'Sys.unsetenv' is not available on this system

Re: [R] Question using stepAIC

2007-06-05 Thread adschai
Uwe -On my email editor, it shows the break line properly as I don't think I can type in one straight line without break as it shows from your reply. My apology if this causes you inconvenience. I think it's just the text got transformed improperly between systems.The dat is simply a predefined

[R] Expand duplicated observations

2007-06-05 Thread M. P. Papadatos
Dear all, I am trying to expand duplicated observations. I need to replace each observation in the dataset with n copies of the observation, where n is equal to the required expression rounded to the nearest integer. If the expression is less than 1 or equal to missing, it is

Re: [R] Expand duplicated observations

2007-06-05 Thread Francisco J. Zagmutt
I think this will do what you want x=c(1,2,3) rep(x,x) [1] 1 2 2 3 3 3 Regards Francisco M. P. Papadatos wrote: Dear all, I am trying to expand duplicated observations. I need to replace each observation in the dataset with n copies of the observation, where n is equal to the required

Re: [R] Expand duplicated observations

2007-06-05 Thread Simon Blomberg
Does this do what you want? dat - c(NA, 0, 3.2, 4) fn - function (x) { z - round(x) if (is.na(x) | x = 1) z else rep(z, each=z) } unlist(sapply(dat, fn)) [1] NA 0 3 3 3 4 4 4 4 HTH, Simon. On Wed, 2007-06-06 at 01:54 +0100, M. P. Papadatos wrote: Dear all, I am trying to expand

Re: [R] Expand duplicated observations

2007-06-05 Thread Jared O'Connell
Also, to handle NAs and non-integers: x = c(1:3,9.4,NA) tmp = round(x) tmp[is.na(tmp)]=1 rep(x,tmp) [1] 1.0 2.0 2.0 3.0 3.0 3.0 9.4 9.4 9.4 9.4 9.4 9.4 9.4 9.4 9.4 NA On 6/6/07, Francisco J. Zagmutt [EMAIL PROTECTED] wrote: I think this will do what you want x=c(1,2,3) rep(x,x) [1]

[R] fixed effects anova in lme lmer

2007-06-05 Thread toby909
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a random effect, or have there be at least one random effect in order for these functions to work? Trying to run such, (1) without specifying a random effect produces an error, (2) specifying that there is no random

[R] kernel smooth for tw-dimensional data

2007-06-05 Thread Patrick Wang
Hi all: I can use the density() function to get the kernel density for given observed data X with bandwidth. Is there a function in R that can take in two dimensional data(x, y) and return a joint density based on the bandwidth. Do I need to provide bandwith for x and then for y? Is the GRASS

Re: [R] Expand duplicated observations

2007-06-05 Thread Simon Blomberg
D'Oh! yet again my first inclination is to write something complicated when a little thought shows a short, neat solution. Ah, well, I live and learn. Cheers, Simon. On Wed, 2007-06-06 at 09:59 +0800, Jared O'Connell wrote: Also, to handle NAs and non-integers: x = c(1:3,9.4,NA) tmp =

Re: [R] Expand duplicated observations

2007-06-05 Thread Jared O'Connell
oh dear...I forgot about 0! :( On 6/6/07, Jared O'Connell [EMAIL PROTECTED] wrote: Also, to handle NAs and non-integers: x = c(1:3,9.4,NA) tmp = round(x) tmp[is.na(tmp)]=1 rep(x,tmp) [1] 1.0 2.0 2.0 3.0 3.0 3.0 9.4 9.4 9.4 9.4 9.4 9.4 9.4 9.4 9.4 NA On 6/6/07, Francisco J.

Re: [R] fixed effects anova in lme lmer

2007-06-05 Thread Simon Blomberg
?gls in package nlme. It's like lme but with no random effects. But you can still model the variance-covariance properties of the data. Simon. On Tue, 2007-06-05 at 19:11 -0700, [EMAIL PROTECTED] wrote: Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a random

[R] Question about Johansen result

2007-06-05 Thread adschai
Hi,I obtained the ect term from cajorls in urca. I found a result that would like to obtain some explanation here. My setting is that I have 2 variate time series. I use ca.jo to perform Johansen test. 1. I found that sometimes, in the case where the ca.jo test statistics suggest that I have 1

Re: [R] kernel smooth for tw-dimensional data

2007-06-05 Thread Patrick Wang
Hi, I found kde2d in the MASS packages return densities for the bivariate random varaibles. I donot understand why each element of density Z is a 2*2 matrix. Why it is not a number. For example, a bivariate normula distribution given (x, y) will return a number, the density, not a matrix.

Re: [R] the biggest integer R can display in complete form but not scientific form

2007-06-05 Thread Francisco J. Zagmutt
Also, look at options(digits) to set the number digits to be printed in the console, i.e. pi [1] 3.141593 options(digits=22) pi [1] 3.141592653589793 Regards Francisco Roland Rau wrote: 李俊杰 wrote: Dear R-lister, One of my friends wanted to produce random number which is

Re: [R] ggplot aspect ratio

2007-06-05 Thread hadley wickham
Hi Ross, In brief, you can use ggopt(aspect.ratio = 1) or p$aspect.ratio - 1 to set the aspect ratio for all plots, or for a single plot respectively. There are a few example of this at http://had.co.nz/ggplot2/coord_equal.html I am also preparing a chapter for the ggplot book which will

Re: [R] kernel smooth for tw-dimensional data

2007-06-05 Thread Roger Bivand
On Tue, 5 Jun 2007, Patrick Wang wrote: Hi, I found kde2d in the MASS packages return densities for the bivariate random varaibles. I donot understand why each element of density Z is a 2*2 matrix. Why it is not a number. For example, a bivariate normula distribution given (x, y) will

  1   2   >