Re: [R] Matrix variable in C code

2006-02-03 Thread depire
Selon Gabor Csardi [EMAIL PROTECTED]: On Thu, Feb 02, 2006 at 06:27:47PM +0100, [EMAIL PROTECTED] wrote: [...] The problem is that as.double drops the dim attribute: b - matrix( 1:4, 2, 2) b [,1] [,2] [1,]13 [2,]24 as.double(b) [1] 1 2 3 4 You can try: b

Re: [R] (newbie) Saving the workspace in .txt format

2006-02-03 Thread Petr Pikal
Hi you can also try to look at ?savehistory which enables you to save your latest commands to a file. Or use menu item save history. You can edit this saved file and you can use part of it or whole by loadhistory or just by copy/paste to R console. HTH Petr On 3 Feb 2006 at 7:41, Prof

Re: [R] RHOME

2006-02-03 Thread Martin Maechler
Martyn == Martyn Plummer [EMAIL PROTECTED] on Thu, 02 Feb 2006 22:34:23 +0100 writes: Martyn Quoting Daniel A. Powers Martyn [EMAIL PROTECTED]: R-help -- I built R-2.2.1 in my own directory on a sun (solaris). Now I would like the sysadmin to move the

Re: [R] Matrix variable in C code

2006-02-03 Thread depire
I correct a little my code, in R code, i use as.matrix for ZT, so i haven't got segment fault but it seems that i transmit only the first colon and because ncol gives 1 and not 2. So what happen ? Programs R CODE - test.R = X-c(4,2,3,2) Z-c(40,21,30,20) dX-c(2,1,1) dyn.load(test.so)

Re: [R] Matrix variable in C code

2006-02-03 Thread Gabor Csardi
No idea, your code (now that you're not using as.double) kinda works for me. source(test.R) [,1] [,2] [1,] 21 20 [2,] 300 [3,] 400 verifie taille: 4 verifie de X: 4.00 - 2.00 - 3.00 - 2.00 verifie dX: 2 1 1 verifie de Z 4 1 40.00 0.00 21.00

[R] Accessing row names

2006-02-03 Thread Werner Wernersen
Hi, I am doing cluster analysis and get back the vector with the clusters. Now I want to access the original data according to the assigned clusters. Therefore, I need the row names of the $cluster vector. Right now I do the following what works but seems a little awkward:

[R] Application of R

2006-02-03 Thread Andy Wong
Could somebody gives me some advice what is the problem of my analysis as per attached printed file showing the steps of the input and the error occured. I have also attached my data file in Excel file format for your reference. Thanks. Andy result.pdf Description: Adobe PDF document

Re: [R] Application of R

2006-02-03 Thread Petr Pikal
Hi I do not know anything about mnp but the variables in your data frame has names V1:V23 and you request mnp to use variables x1..., y1..., and z1 Unless you have them somewhere, where do you suppose mnp to know about them? Try to read some basic text about data structures and

[R] question

2006-02-03 Thread Xiao Zhao
Hello, I am a research student and I am using R to access my research. I want to know how to multiple plot , such as for the exponetial distribution, if I give the covariate different value, how to plot these in the same figure, And also I want to add the density plot in the histogramm. How to do

Re: [R] How to get the namespace of a function?

2006-02-03 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: On Thu, 2 Feb 2006, Fernando Saldanha wrote: I am trying to imitate encapsulation from other languages like Java or C++. Coming from that background, it bothers me that I can commit errors like the following: x - 1 f - function(z) { y -

Re: [R] How to get the namespace of a function?

2006-02-03 Thread Luke Tierney
On Thu, 2 Feb 2006, Duncan Murdoch wrote: On 2/2/2006 5:56 PM, Berton Gunter wrote: Just echoing and slightly amplifying Gabor's comment... The semantics of R are really based on functional programming (LISP-like) rather than OOP (JAVA-like)? R's behavior is proper from that point of view;

[R] SVS tree lists

2006-02-03 Thread Mike Saunders
I know this is a long shot, but does anyone out there have code for converting a R-dataframe into a Stand Visualization System (SVS) tree list? It would save me a bit of time. I would be interested if anyone has FVS code as well. I will be working (reworking) NE-TWIGS equations to a

Re: [R] question

2006-02-03 Thread Gabor Csardi
x - seq(0, 10, by=.1) plot(x,pexp(x, rate=1)) points(x,pexp(x, rate=2), pch=2, col=blue) See help(plot), help(points), help(lines). Gabor On Fri, Feb 03, 2006 at 01:07:30PM -, Xiao Zhao wrote: Hello, I am a research student and I am using R to access my research. I want to know how to

Re: [R] RHOME

2006-02-03 Thread Peter Dalgaard
Martin Maechler [EMAIL PROTECTED] writes: Martyn R is designed to run from its build directory. But Martyn if your sysadmin installs it with make install (as Martyn root), then the shell wrapper that is installed in Martyn /usr/local/bin/R will have R_HOME pointing to the

[R] Problems with ks.test

2006-02-03 Thread Emanuele Mazzola
Hi everybody, while performing ks.test for a standard exponential distribution on samples of dimension 2500, generated everytime as new, i had this strange behaviour: data-rexp(2500,0.4) ks.test(data,pexp,0.4) One-sample Kolmogorov-Smirnov test data: data D = 0.0147, p-value = 0.6549

[R] How to decide between two theoretical distributions?

2006-02-03 Thread Petar Milin
Question that I have to ask has two parts: first, related to statistics, in principle, and second, related to R-how-to, in particular. In very brief, I have collected pretty solid sample for a phenomenon that has two possible interpretation of how it is distributed in the population; for example,

[R] How to decide between two theoretical distributions?

2006-02-03 Thread Petar Milin
Question that I have to ask has two parts: first, related to statistics, in principle, and second, related to R-how-to, in particular. In very brief, I have collected pretty solid sample for a phenomenon that has two possible interpretation of how it is distributed in the population; for example,

Re: [R] Matrix variable in C code

2006-02-03 Thread Douglas Bates
On 2/2/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Selon Gabor Csardi [EMAIL PROTECTED]: On Thu, Feb 02, 2006 at 03:11:42PM +0100, [EMAIL PROTECTED] wrote: [...] and my test code in C is: SEXP VPCEfron(SEXP f, SEXP SR, SEXP ZR,

Re: [R] Problems with ks.test

2006-02-03 Thread Don MacQueen
7 repetitions is not nearly enough to get a good estimate of the variability of the test statistic. Try this: nrep - 500 pvals - tstvals - numeric(nrep) for (i in seq(nrep)) { tmp - ks.test(rexp(2500,0.4),pexp,0.4) pvals[i] - tmp$p.value tstvals[i] - tmp$statistic } hist(pvals)

Re: [R] Problems with ks.test

2006-02-03 Thread Patrick Burns
The distribution of p-values should be uniform under the null hypothesis. When I do: jj - numeric(1) for(i in 1:1) jj[i] - ks.test(rexp(2500, .4), 'pexp', .4)$p.value Warning messages: 1: cannot compute correct p-values with ties in: ks.test(rexp(2500, 0.4), pexp, 0.4) 2: cannot

[R] How to get all the data in a specific column from a dataframe?

2006-02-03 Thread Vincent Deng
Dear R-helpers: Suppose I have a datafram called test_frame like this col1 col2 col3 col4 r1 xxx x r2 xxx x r3 xxx x ..xxx x rn xxx x I know I can get data of col3 by using

Re: [R] RHOME

2006-02-03 Thread Martyn Plummer
Far be it for me to tell people what they can and cannot do. Perhaps I can rephrase myself in a less inflammatory way. R runs from the build directory as a convenience for developers, so you don't have to reinstall R every time you change something. But for users, the standard mechanism make

[R] Infinite loop running Mod_R/Rapache

2006-02-03 Thread BJ
I installed mod_r according to the specifications, and have been trying to get the demo script to work correctly. I am running debian, the latest build of R, apache 2 with prefork mpm, and the latest mod_r. Is anyone else using this module successfully? I added: LoadModule R_module mod_R.so

Re: [R] How to get all the data in a specific column from a dataframe?

2006-02-03 Thread Chuck Cleland
test_frame[,col3] or subset(test_frame, select = col3) Vincent Deng wrote: Dear R-helpers: Suppose I have a datafram called test_frame like this col1 col2 col3 col4 r1 xxx x r2 xxx x r3 xxx x ..xx

Re: [R] How to get all the data in a specific column from a dataframe?

2006-02-03 Thread Peter Dalgaard
Chuck Cleland [EMAIL PROTECTED] writes: test_frame[,col3] or subset(test_frame, select = col3) or test_frame$col3 -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of

[R] statistical modelling SAS vs R

2006-02-03 Thread Bill Szkotnicki
Hello, Recently I have been reading a lot of material about statistical modeling using R. There seems to be conflicting opinions about what the best approach is between the SAS community and the R community. 1) In R one might start with a model that has all possible effects of interest in it and

[R] workspace question

2006-02-03 Thread Afshartous, David
All, When starting R, how does one prevent the loading the previous workspace which was saved? I'd like to start a new project and save the new image in a different directory, but I'd like to partition this from the old project. Does there exist a better way than just deleting the files

Re: [R] statistical modelling SAS vs R

2006-02-03 Thread Frank E Harrell Jr
Bill Szkotnicki wrote: Hello, Recently I have been reading a lot of material about statistical modeling using R. There seems to be conflicting opinions about what the best approach is between the SAS community and the R community. 1) In R one might start with a model that has all possible

[R] Clustering for social/complex networks

2006-02-03 Thread Kel Lam
Hi group, Here is another clustering question. Is there anything available in R that I can cluster groups with overlaps? It looks like a Venn Diagram with two or more circles overlapping one another. I realize that Hierarchical Clustering (hclust in Stats) only group individuals into

Re: [R] is there a way to visualize 3D normal distributions?

2006-02-03 Thread Ben Bolker
In response to your last question -- Duncan already gave you the answer in his last e-mail -- to give an explicit example, for a particular set of means and variance-covariance matrix: library(rgl) demo(shapes3d) rgl.clear() sphere - ellipsoid3d(2,2,2,qmesh=TRUE) means - c(0,0,0) S -

Re: [R] Infinite loop running Mod_R/Rapache

2006-02-03 Thread Jeffrey Horner
BJ wrote: I installed mod_r according to the specifications, and have been trying to get the demo script to work correctly. I am running debian, the latest build of R, apache 2 with prefork mpm, and the latest mod_r. Is anyone else using this module successfully? I added: LoadModule

[R] R-2.2.1-INSTALL Issue with TCLTK

2006-02-03 Thread Bhola, Gautam
Hi I am not able to have a working tcltk library in R-2.2.1 inspite of trying different options suggested in the FAQ's. I am using the following configure option and I do get the tcltk package installed but with a missing libs folder. ./configure -prefix= ~R-2.2.1 --enable-R-shlib

Re: [R] workspace question

2006-02-03 Thread Liaw, Andy
If you start R with the argument --no-restore (or even --vanilla, I think), no workspace will be loaded. Personally I almost never save a workspace image. Whatever I need I explicitly save() and load() or attach(). Andy From: Afshartous, David All, When starting R, how does one prevent

Re: [R] Difficulty with qqline in logarithmic context

2006-02-03 Thread François Pinard
[Brian Ripley] Is there a good reason to use qqnorm in a single-log context? Yes. Googling around reveals this is not so uncommon. Should one not rather use qqnorm(log(freq)) qqline(log(freq)) In the display produced by qqnorm, the y-axis would then show log(value) labels, while the user

Re: [R] Clustering for social/complex networks

2006-02-03 Thread Christian Schulz
try: cmeans Fuzzy C-Means Clustering in library(e1071) regards, christian Hi group, Here is another clustering question. Is there anything available in R that I can cluster groups with overlaps? It looks like a Venn Diagram with two or more circles overlapping one another. I realize that

[R] Function assign

2006-02-03 Thread Marco Venanzi
I'm trying to apply the function assign( ) to a subset of a matrix, but it doesn't work... i.e. example-matrix(nrow=5,ncol=5) assign(example[c(1,3),],matrix(1:10,nrow=2,ncol=5)) but matrix example doesn't change ( get(example[c(1,3),]) is not useful to me)...how can I do this assignment?

Re: [R] Function assign

2006-02-03 Thread Ferdinand Alimadhi
example-matrix(nrow=5,ncol=5) example[c(1,3),]-matrix(1:10,nrow=2,ncol=5) Marco Venanzi wrote: I'm trying to apply the function assign( ) to a subset of a matrix, but it doesn't work... i.e. example-matrix(nrow=5,ncol=5) assign(example[c(1,3),],matrix(1:10,nrow=2,ncol=5)) but matrix

Re: [R] R-2.2.1-INSTALL Issue with TCLTK

2006-02-03 Thread Prof Brian Ripley
Those don't look like valid paths to config files to me. On FC3 they would be /usr/lib/tclConfig.sh /usr/lib/tkConfig.sh So even if you have users tcl-8.4.12 and tk-8.4.12 (do you?), your paths are almost surely not to config files. Configure reports what works, including that it is not

[R] all.equal() and which()

2006-02-03 Thread tom wright
Please excuse the lack of a complete dataset here, if its needed I'll be happy to provide it. Can anyone show me how to rewrite this? Browse[1] time(data)[24210:24220] [1] 24.209 24.210 24.211 24.212 24.213 24.214 24.215 24.216 24.217 [10] 24.218 24.219 Browse[1] which(time(data)==24.211)

Re: [R] all.equal() and which()

2006-02-03 Thread Marc Schwartz (via MN)
On Fri, 2006-02-03 at 10:41 -0500, tom wright wrote: Please excuse the lack of a complete dataset here, if its needed I'll be happy to provide it. Can anyone show me how to rewrite this? Browse[1] time(data)[24210:24220] [1] 24.209 24.210 24.211 24.212 24.213 24.214 24.215 24.216 24.217

[R] Using string vectors as for loop arguments

2006-02-03 Thread Kevin Middleton
Is there a mechanism to interate through a vector of strings? Say I have a data frame of 50 variables (VAR1 to VAR50), each with 100 measurements along with some coding factors (EXP and DOSE). I want to calculate the mean of a subset of each of VAR1 to VAR 50 (selecting by EXP and DOSE).

Re: [R] statistical modelling SAS vs R

2006-02-03 Thread Wensui Liu
bill, what kind of modeling are you talking about? based on your desc on SAS, you are doing general linear model, aren't you? Frank gave you a great suggestion of using shrinkage methods, such as lasso, instead of stepwise/backforward/forward methods. But no matter shrinkage or stepwise, both

[R] How to generate pitch strings

2006-02-03 Thread Atte Tenkanen
If I calculate a transition probability matrix, first order markov 12x12 or second order 144x144 from musical pitch classes (0-11), is it possible to generate pitch class strings similar as those original strings using those probability matrix with R? If, how? Atte Tenkanen, Turku, Finland

Re: [R] Using string vectors as for loop arguments

2006-02-03 Thread Berton Gunter
?apply as in: answer-apply(yourframe,2,function(x)x[EXP==1 DOSE==1]) Note that there are slicker ways to do this call. Note also for that for the particular case of column means, you have a built-in much faster alternative: answer-colMeans(yourframe[EXP==1 DOSE==1,],na.rm=TRUE) Also note

Re: [R] RHOME

2006-02-03 Thread Prof Brian Ripley
On Fri, 3 Feb 2006, Peter Dalgaard wrote: Martin Maechler [EMAIL PROTECTED] writes: Martyn R is designed to run from its build directory. But Martyn if your sysadmin installs it with make install (as Martyn root), then the shell wrapper that is installed in Martyn

[R] Cause of Error 1:nrow(X) : argument NA / NaN

2006-02-03 Thread Jean-Louis Abitbol
Dear R Helpers I am trying to get function smedian.hilow to work using Hmisc summarize on variable conc in dataframe pkindivmtd by time and dose using: attach(pkindivmtd) sconc - summarize(conc,llist(time,dose),smedian.hilow) I get the error message Erreur dans 1:nrow(X) : argument NA / NaN

[R] Tobit Regression

2006-02-03 Thread bambang pramono
I'm statistician I have thesis : Tobit Regression my book : Greene, William H. 1997. Econometric Analysis. Third Edition, prentice Hall Is there the program in R ? may I ask the manual how make the program? and also how to test the assumption ? If there are anyone have Amemiya journal may I asked

[R] rgl install problem on Solaris 10 X86

2006-02-03 Thread Dongseok Choi
Hi, Could you help me to install the rgl package on Solaris 10 x86? I tried and got the following error messages. When I compiled my R as 64bit, I used the SUN ProW compilers. However, gcc seems to being used below as well as missing some information. Thank you in advance, Dongseok

Re: [R] rgl install problem on Solaris 10 X86

2006-02-03 Thread Duncan Murdoch
On 2/3/2006 6:37 PM, Dongseok Choi wrote: Hi, Could you help me to install the rgl package on Solaris 10 x86? No, but there have been a lot of changes to it since the last upload to CRAN. You might want to grab a new copy from http://rgl.neoscientists.org/About.html by getting the

Re: [R] RHOME

2006-02-03 Thread Dan Powers
R-help My thanks goes out to all who responded to this. I am tying to avoid burdening the sysadmin with this project so I opted for the simple fix of modifying the shell script. My aim here is to build the libraries in my local directory and copy those as needed to /usr/local/lib/R/library. I

Re: [R] weights argument in the lmer function in lme4

2006-02-03 Thread Spencer Graves
I agree: The lmer weights argument seems not to have any effect. To check this, I modified the first example in the lmer documentation as follows: Sleep - sleepstudy Sleep$wts - 1:180 (fm1 - lmer(Reaction ~ Days + (Days|Subject), Sleep)) (fm1w - lmer(Reaction ~ Days +

Re: [R] Density estimation with monotonic constaints

2006-02-03 Thread Spencer Graves
There are multiple functions for density estimation in R, but I don't know of any for estimating a monotonically decreasing density. If you haven't already, I encourage you to use, e.g., the help.search and RSiteSearch functions to find and explore their capabililties. Why

Re: [R] output hessian matrix in constrOptim

2006-02-03 Thread Spencer Graves
The documentation for constrOptim says it has a ... argument, which can contain Other arguments passed to 'optim', which will pass them to 'f' and 'grad' if it does not used them. I routinely get an estimated hessian from 'optim' just by specifying the argument 'hessian=TRUE'. This

[R] RUnit - need advice on a good directory structure or tips...

2006-02-03 Thread Sung Soo Kim
I made my own RUnit testing convention, and I want to introduce this to one of my friends. Before that, I'd like to review my codes. The problem that I met when I tried to polish my codes is: How can I get the file path in the file??? I.e., I want to get the path to the file that I'm writing