Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Andreas Wittmann
Hello Dirk, thank you for your chick answer. I tried another file and there it works. so i removed all files which were created during of the compilation of add.c in windows and so i could compile it under ubuntu too. During the windows compilation there is some *.o file which is created during

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Prof Brian Ripley
From the help page: 'R CMD SHLIB' is the mechanism used by 'INSTALL' to compile source code in packages. Please consult section 'Creating shared objects' in the manual 'Writing R Extensions' for how to customize it (for example to add 'cpp' flags and to add libraries to the link

[R] convert lines to inches

2008-10-19 Thread Thomas Steiner
Hi, how can I convert the unit lines of par(mar) into inches? par(mai) could help, but does not (see code below). I want to plot a curve in a predefined size in pdf (I add some margin space to the plot widthheight, everything is in cm): pdf(test.pdf,width=(20+2+4)/2.54,height=(10+3+1)/2.54)

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-19 Thread Duncan Murdoch
Andreas Wittmann wrote: Hello Dirk, thank you for your chick answer. I tried another file and there it works. so i removed all files which were created during of the compilation of add.c in windows and so i could compile it under ubuntu too. During the windows compilation there is some *.o file

Re: [R] convert lines to inches

2008-10-19 Thread Peter Dalgaard
Thomas Steiner wrote: Hi, how can I convert the unit lines of par(mar) into inches? par(mai) could help, but does not (see code below). I want to plot a curve in a predefined size in pdf (I add some margin space to the plot widthheight, everything is in cm):

[R] time-series noise filter

2008-10-19 Thread Thomas
Hello, I have a very large data set (collected automatically) of animal heart frequencies. The data of course forms a time series. My problem is I do not only have the real heart frequencies, but also quite a lot of non-sense noise which needs to be filtered out. Visually inspecting the data

Re: [R] Plot table of counts

2008-10-19 Thread Jim Lemon
[EMAIL PROTECTED] wrote: I have a data set which is comprised of counts, that is, the number of times a mass spectrometer measured a particular mass at a particular time (the rows and columns of the table). Is there a way to make a plot so that it draws a square at the mass/time spot on the

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-19 Thread Graham Smith
Jim, Gabor is right, gantt.chart comes close but you will have to change all the POSIXct axis calls to plain old axis calls and manually create the list of gantt.info with the x values as numbers. Mmm, I have had a quick look at the code and it seems a bit beyond me, but it could be a good

Re: [R] convert lines to inches

2008-10-19 Thread Thomas Steiner
Ok, thanks Peter, I try to be more accurate: pdf(test.pdf,width=(20+2+4)/2.54,height=(10+3+1)/2.54) x=seq(0,pi,length=100) par( mai=c(2,3,4,1)/2.54 ) plot(x,cos(x),type=l,xlim=c(0,3),ylim=c(-1.2,1.2),xaxs=i,yaxs=i,asp=1) conv=par(mar)/par(mai) box(figure, col=darkblue) dev.off() Then figure has

Re: [R] definition of dffits

2008-10-19 Thread Gabor Grothendieck
Check out: http://en.wikipedia.org/wiki/DFFITS On Sun, Oct 19, 2008 at 1:26 AM, Kunio takezawa [EMAIL PROTECTED] wrote: R-users E-mail: r-help@r-project.org Hi! R-users. I am just wondering what the definition of dffits in R language is. Let me show you an simple example. function()

Re: [R] plot - central limit theorem

2008-10-19 Thread Yihui Xie
Thanks, Duncan, I agree with you in terms of doing the tests independently. I've modified the code and updated the package at R-forge. As for the choice of vertical bars or points, you are free to provide the option type = 'h' or type = 'p' in the function. Regards, Yihui -- Yihui Xie [EMAIL

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-19 Thread Gabor Grothendieck
Then try something like this. We plot it as a stacked horizontal bargraph where the first bar in the stack is white and with border = 0 so its not visible. # test data - rows are from and to points and # column names are the labels mat - matrix(1:10, 2, byrow = TRUE, dimnames =

Re: [R] convert lines to inches

2008-10-19 Thread Peter Dalgaard
Thomas Steiner wrote: Ok, thanks Peter, I try to be more accurate: pdf(test.pdf,width=(20+2+4)/2.54,height=(10+3+1)/2.54) x=seq(0,pi,length=100) par( mai=c(2,3,4,1)/2.54 ) plot(x,cos(x),type=l,xlim=c(0,3),ylim=c(-1.2,1.2),xaxs=i,yaxs=i,asp=1) conv=par(mar)/par(mai) box(figure, col=darkblue)

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-19 Thread Graham Smith
Gabor, Then try something like this. We plot it as a stacked horizontal bargraph where the first bar in the stack is white and with border = 0 so its not visible. # test data - rows are from and to points and # column names are the labels mat - matrix(1:10, 2, byrow = TRUE,

Re: [R] definition of dffits

2008-10-19 Thread John Fox
Dear Kunio, The approach in dffits() in R is equivalent to the definition of DFFITS_i in Belsley, Kuh, and Welch, Regression Diagnostics (which is, I believe the original source, or close to it), generalized to WLS. Possibly a more transparent definition would be dfs - function(mod){ rs

Re: [R] Dep setting for install of packages...

2008-10-19 Thread Gabor Grothendieck
Its showing you the install.packages command that the menu invokes. You can keep pressing Enter to step through that and you can try entering the same command from your R console to verify its operation. On Sun, Oct 19, 2008 at 10:09 AM, Brian Lunergan [EMAIL PROTECTED] wrote: Gabor

Re: [R] Variable shortlisting for the logistic regression

2008-10-19 Thread Darin Brooks
Frank's remark was made in response to my posting. As funny as it was - it was the best thing that could have happened to me. It sparked an enlightening discussion between my committee and me (in particular, the pros cons of stepwise vs. information theoretic approach to model selection). Being

[R] zoo in ggplot2

2008-10-19 Thread stephen sefick
library(zoo) d-(structure(c(1.39981554315924, 0.89196314359498, 0.407816250252697, 0.823496839063978, 1.14429021220358, 1.23971035967413, 0.960868900583432, 0.927685306209829, 1.22072345292821, 0.249842897450642, 1.00879641624694, 0.925372139878243, 0.317259909172362, 0.382677149697482), index =

Re: [R] Plot table of counts

2008-10-19 Thread Mark Ewing
Thank you for your suggestions - image() produced a plot that worked, I'll be trying out all these other options as well. - Mark Ewing On Sun, Oct 19, 2008 at 4:03 AM, Jim Lemon [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I have a data set which

[R] PCA HCA

2008-10-19 Thread Amit Patel
Hi I am attempting PCA and HCA on a dataset The head of the table looks like this VariableSamp1Samp2Samp3 109232 276 352 222 244 I cant stop R from

[R] Date classes in ggplot2

2008-10-19 Thread stephen sefick
updn.gg - (structure(list(date = structure(c(11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057, 13149), class = Date), unrestored = c(1.13789418691602, 0.704948049842955, 0.276777348238899, 0.417586861554189, 0.504870337754768, 0.673201771716216,

Re: [R] Getting names of variables without quotes

2008-10-19 Thread Jorge Ivan Velez
Dear AJSS, Perhaps: # --- # Data set # --- mydata=read.table(textConnection( V1V2V3 1 15 10 4 26 4 7 3 10 5 2 48 6 6),header=TRUE) closeAllConnections() # --- # Regression models #

Re: [R] Date classes in ggplot2

2008-10-19 Thread hadley wickham
On Sun, Oct 19, 2008 at 10:49 AM, stephen sefick [EMAIL PROTECTED] wrote: updn.gg - (structure(list(date = structure(c(11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057, 13149), class = Date), unrestored = c(1.13789418691602, 0.704948049842955,

Re: [R] Date classes in ggplot2

2008-10-19 Thread stephen sefick
well I must have either resolve it without knowing it, ot something funny is going on... sorry I didn't run it in a clean R session. Should have. works fine thanks Stephen Sefick On Sun, Oct 19, 2008 at 12:01 PM, hadley wickham [EMAIL PROTECTED] wrote: On Sun, Oct 19, 2008 at 10:49 AM,

Re: [R] help

2008-10-19 Thread Ben Bolker
Sonam sonam at ms.ie.u-ryukyu.ac.jp writes: hello there, can anyone tell me how to correct this error, Error in nlm(if(analytic.gradient) objective.2 else objective.1, start,: probable coding error in analytic gradient) thanks in advance. sonam Look for an error in your

Re: [R] multivariate integral with ADAPT when the parameter is close to boundary

2008-10-19 Thread Muhtar Osman
Thanks so much for the comments. Of course, integrating dbeta(theta[1],0.005,0.005)*dbeta(theta[2],0.005,0.005) over the whole range is not something I am really interested in. I am just concerned about the results I got for other integrands with extreme priors using ADAPT function. It is true

Re: [R] zoo in ggplot2

2008-10-19 Thread Gabor Grothendieck
zoo does have plot.zoo and xyplot.zoo library(zoo) xyplot(d) plot(d) but there is no zoo method for ggplot2 currently; however, you can qplot d from its constituent pieces: library(ggplot2); library(zoo) qplot(time(d), coredata(d)) On Sun, Oct 19, 2008 at 11:22 AM, stephen sefick [EMAIL

Re: [R] Getting names of variables without quotes

2008-10-19 Thread Amarjit Singh Sethi
Dear Jorge Many thanks for your prompt reply. I tried to make use of the code provided by you (as per file attached), but it did not work for me; got the following output: # --- # Data set # --- mydata=read.table(textConnection( + V1V2V3 + 115104 + 2647 +

Re: [R] Getting names of variables without quotes

2008-10-19 Thread Jorge Ivan Velez
Dear AJSS, The problem is in how we read the data set. Here is a slight modification: # --- # Data set # --- mydata=data.frame( V1=c(15,6,10,8), V2=c(10,4,5,6), V3=c(4,7,2,6)) # --- # Regression models # --- # Combinations

Re: [R] How to save/load RWeka models into/from a file?

2008-10-19 Thread Kurt Hornik
Paulo Cortez writes: Achim Zeileis wrote: On Thu, 16 Oct 2008, Paulo Cortez wrote: Hi, I want to save a RWeka model into a file, in order to retrive it latter with a load function. See this example: library(RWeka) NB - make_Weka_classifier(weka/classifiers/bayes/NaiveBayes)

Re: [R] Please help

2008-10-19 Thread Rolf Turner
On 19/10/2008, at 6:55 AM, Sonam wrote: Dear R-experts, I am trying to fit my model but I couldn't because of this error. here is the error Error in solve.default(dial(m) -A) : Lapack routine dgesv: system is exactly singular thank you all. sonam Hey! Maybe the problem is that the

Re: [R] wrireframe

2008-10-19 Thread Deepayan Sarkar
On 10/17/08, Chibisi Chima-Okereke [EMAIL PROTECTED] wrote: Dear all, Does anyone know how to overlay a 3d line on a wireframe plot? See http://lmdvr.r-forge.r-project.org/figures/figures.html?chapter=13;figure=13_07; I would also like to be able to keep the legend that you get when

Re: [R] lattice histogram question

2008-10-19 Thread Deepayan Sarkar
On 10/17/08, Sharma, Dhruv [EMAIL PROTECTED] wrote: Hi, When I do a conditional histogram of X by Y and my Y ranges 0-100,000 I get the x axis bin labels in scientific notation. 0 to 2e+06 etc. is there a way to view the histogram bins without scientific notation? Look at the scipen

[R] Handling complex sampling designs in R

2008-10-19 Thread David Kaplan
Hi all, I typically need to analyze data from large scale surveys obtained under complex sampling designs and where sampling weights are provided. I suspect that weights can be handled for some, but not all, packages. Can someone point me to information about which packages can incorporate

[R] derivatives and integrals in R

2008-10-19 Thread David Kaplan
Hi all, Can anyone recommend a good reference for taking scalar and matrix derivatives in R, and also doing integration in R. I've searched the list and have not come across anything thus far. Thanks in advance, David --

[R] R-square in robust regression

2008-10-19 Thread PARKERSO
Hi there, I have just started using the MASS package in R to run M-estimator robust regressions. The final output appears to only give coefficients, degrees of freedom and t-stats. Does anyone know why R doesn't compute R or R-squared and why doesn't give you any other indices of goodness of fit?

Re: [R] Handling complex sampling designs in R

2008-10-19 Thread David Kaplan
This looks fantastic. Thanks! David === David Kaplan, Ph.D. Professor Department of Educational Psychology University of Wisconsin - Madison Educational Sciences, Room, 1061 1025 W. Johnson Street Madison, WI 53706 email:

Re: [R] number of required trials

2008-10-19 Thread Rolf Turner
On 20/10/2008, at 9:51 AM, Boks, M.P.M. wrote: Dear Experts, Probably trivial, but I am struggling to get what I want: I need to know how the number of required trials to get a certain number of successes. By example: How many trials do I need to have 98% probability of 50 successes,

Re: [R] definition of dffits

2008-10-19 Thread Kunio takezawa
R-users E-mail: r-help@r-project.org Hi! R-users. Check out: http://en.wikipedia.org/wiki/DFFITS The approach in dffits() in R is equivalent to the definition of DFFITS_i in Belsley, Kuh, and Welch, Regression Diagnostics (which is, I believe the original source, or close to it),

[R] The evaluation of optional function arguments

2008-10-19 Thread Sietse Brouwer
Dear R-helpers, I've got two functions; callTimes() calls times(), passing it an optional argument (bar) by name (bar=harry). times() then believes it has been passed a name, rather than a value — but I want the value, not the name. Worse, if I evaluate the name, it is evaluated in the

Re: [R] Dep setting for install of packages...

2008-10-19 Thread Brian Lunergan
Gabor Grothendieck wrote: Its showing you the install.packages command that the menu invokes. You can keep pressing Enter to step through that and you can try entering the same command from your R console to verify its operation. Tried an install of car three different times. Once from the

Re: [R] Calculate SPE in PLS package

2008-10-19 Thread Stella Sim
Dear list, I want to calculate SPE (squared prediction error) in x-space, can someone help? Here are my codes: fit.pls- plsr(Y~X,data=DAT,ncomp=3,scale=T,method='oscorespls',validation=CV,x= T) actual-fit.pls$model$X pred-fit.pls$scores %*% t(fit.pls$loadings) SPE.x-rowSums((actual-pred)^2)

Re: [R] Dep setting for install of packages...

2008-10-19 Thread Gabor Grothendieck
leaps is not in Depends or Imports for car. It is in Suggests and those don't get automatically pulled in when dependencies = NA. What you could do is to replace the builtin menuInstallPkgs with your own by running this: assignInNamespace(menuInstallPkgs, function (type = getOption(pkgType)) {

Re: [R] The evaluation of optional function arguments

2008-10-19 Thread Kaom Te
Try this for timesDefineInside: timesDefineInside - function(foo, ...) { extra.args - list(...) bar - extra.args$bar foo * bar } -Kaom On Oct 19, 2008, at 6:34 PM, Sietse Brouwer wrote: Dear R-helpers, I've got two functions; callTimes() calls times(), passing it an optional

Re: [R] The evaluation of optional function arguments

2008-10-19 Thread hadley wickham
Why don't you want to do this? timesDefineInside - function(foo, bar...) { foo * bar } It seems like the obvious solution to your problem. Hadley On Sun, Oct 19, 2008 at 8:34 PM, Sietse Brouwer [EMAIL PROTECTED] wrote: Dear R-helpers, I've got two functions; callTimes() calls times(),

[R] passing a list where names arguments are expected

2008-10-19 Thread erwann rogard
hi, say i have a function f and i'd like to to call it like this: 1) f(list(a=...,b=...)) but i can't do it, because f is defined as: 2) f-function(a=NULL,b=NULL){...} is there a way that i can approximate 1), such as mapping list(a=,...b=...) to list(a=,...b=...) and then replacing list by

Re: [R] passing a list where names arguments are expected

2008-10-19 Thread Kaom Te
I believe you want do.call(f, list(a =..., b=...)) ?do.call -Kaom On Oct 19, 2008, at 7:55 PM, erwann rogard wrote: hi, say i have a function f and i'd like to to call it like this: 1) f(list(a=...,b=...)) but i can't do it, because f is defined as: 2) f-function(a=NULL,b=NULL){...} is

Re: [R] pairs plots in R

2008-10-19 Thread Felix Andrews
One idea: if the primary variable of interest is a categorical (binary), I would rather look at univariate plots for each of your 100 variables, grouped by the primary one. e.g. library(latticeExtra) marginal.plot(~ myBigDat, data = myBigData, groups = myBinaryVar, auto.key = TRUE,

Re: [R] passing a list where names arguments are expected

2008-10-19 Thread erwann rogard
Indeed, that's all I need. Thanks! On Sun, Oct 19, 2008 at 11:09 PM, Kaom Te [EMAIL PROTECTED] wrote: I believe you want do.call(f, list(a =..., b=...)) ?do.call -Kaom On Oct 19, 2008, at 7:55 PM, erwann rogard wrote: hi, say i have a function f and i'd like to to call it like this:

Re: [R] R-square in robust regression

2008-10-19 Thread Prof Brian Ripley
On Sun, 19 Oct 2008, PARKERSO wrote: Hi there, I have just started using the MASS package in R to run M-estimator robust regressions. The final output appears to only give coefficients, degrees of freedom and t-stats. Does anyone know why R doesn't compute R or R-squared These as only valid