Re: [R] Add columns in a dataframe and fill them from another table according to a criteria

2009-08-04 Thread Meenu Sahi
Thank you very much !!! It works !!! Sorry it took me some time to understand your solution and apply it to my extended dataset. Just got it working !!! Yes as.numeric is the trick.. Many thanks again for your help and time. Regards Meenu On Sun, Aug 2, 2009 at 6:06 AM, David Winsemius

Re: [R] RServe - How to use 'createReference' method?

2009-08-04 Thread Romain Francois
Hi, The Rserve implementation of REngine does not support references (yet?). Anyway, I don't think references are what you need here. You probably want the methods createFile and openFile that create RFileInputStream and RFileOutputStream which you can use to transfer files through the R

Re: [R] na.strings and the like; suspending interpretation of NA

2009-08-04 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jan Theodore Galkowski Sent: Monday, August 03, 2009 10:23 PM To: R Project Subject: [R] na.strings and the like; suspending interpretation of NA Can someone point me to

Re: [R] na.strings and the like; suspending interpretation of NA

2009-08-04 Thread Peter Dalgaard
Jan Theodore Galkowski wrote: Can someone point me to the proper place in the documentation or on the Wiki where I can learn how to get R to stop interpreting the string NA as something special? I have a table in a database which contains (among other things) country codes and continent codes.

Re: [R] two-factor linear models with missing cells

2009-08-04 Thread Peter Dalgaard
Murray Jorgensen wrote: Hi Peter, there is no problem if the missing cell is not in the first row or column: the corresponding interaction parameter is omitted. In my case the data in the (1,4) cell is missing. What results is clear to me now: the (3,4) interaction parameter is dropped so

[R] Rank of matrix

2009-08-04 Thread Alex Roy
Dear all, Rank of a matrix depends on which factors? Only on rows or coumns? or both ? If there is a collinearlity in the variables ( columns ) does it effects the rank? X-matrix((rnorm(1)),50) dim(X) [1] 50 200 qr(X)$rank [1] 50 X[,2]-X[,30] qr(X)$rank [1] 50

Re: [R] lme funcion in R

2009-08-04 Thread ONKELINX, Thierry
Dear Harry, Your model seems rather complex. Do you have enough data to support it? Did you check for multicollinearity between the variables? HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] How to catch an error using try

2009-08-04 Thread ONKELINX, Thierry
Put your function in try() and the test it's class gene.seq - try(getSequence (id=gene.map[,ensembl_transcript_id], type=ensembl_transcript_id, seqType=3utr, mart=hmart)) if(class(gene.seq) == try-error){ #code to run when an error occurs } else { #code to run when no error

Re: [R] two-factor linear models with missing cells

2009-08-04 Thread Murray Jorgensen
Hi Peter, there is no problem if the missing cell is not in the first row or column: the corresponding interaction parameter is omitted. In my case the data in the (1,4) cell is missing. What results is clear to me now: the (3,4) interaction parameter is dropped so that (Intercept) + Biv now

Re: [R] Merge partially duplicated rows

2009-08-04 Thread Rnewbie
Thanks very much :handshake: David Winsemius wrote: You might want to look at the ave function. It will calculate a function within IDs and you can assign that as another row in the datafrme before you exclude the duplicates. David Winsemius, MD Heritage Laboratories West

Re: [R] package to convert coordiantes to timezone

2009-08-04 Thread Thomas Steiner
Thanks you, this helps. Great, Thomas 2009/8/3 Michael Denslow michael.dens...@gmail.com: Hi Thomas, On Sun, Aug 2, 2009 at 11:02 AM, Thomas Steinerfinbref.2...@gmail.com wrote: Is there a R-package with a function that returns me the timezone, if I hand over longitude and latitude? I know

Re: [R] Rank of matrix

2009-08-04 Thread Martin Maechler
AR == Alex Roy alexroy2...@gmail.com on Tue, 4 Aug 2009 09:56:42 +0200 writes: AR Dear all, Rank of a matrix depends on which factors? AR Only on rows or coumns? or both ? If there is a AR collinearlity in the variables ( columns ) does it AR effects the rank? This has

Re: [R] fitting a truncated power law

2009-08-04 Thread glen_b
John Sanders-2 wrote: How can I fit a truncated power law to a vector? I can't find a function to do that. If the function provides an AIC, even better. Okay, power law I understand - f(x) = k.x^a, or on the log-scale log(f(x)) = log(k) + a log(x) (linear) I was unfamiliar with the term

[R] parameter asterisks

2009-08-04 Thread alexander russell
Hello, Is there a clearcut answer as to why R prints 'NA' sometimes instead of standard errors? mle2(minuslogl = nlikfun4, start = list(a = 1, c = 1, d = 0.2, b = 0.1, b1 = 0.1), method = Nelder-Mead) Coefficients: Estimate Std. Error z value Pr(z) a 3.83845751 0.47320236 8.1117 4.993e-16

[R] Strange error with ROCR

2009-08-04 Thread Noah Silverman
Hello, I've come across a strange error... Here is what happens: model - svm(traindata,trainlabels, type=C-classification, kernel=radial, cost=10, class.weights=c(win=3,lose=1), scale=FALSE, probability = TRUE) predictions - predict(model, traindata) pred - prediction(predictions,

[R] asc class object - how to get positions (coordinates) for a given raster ID?

2009-08-04 Thread Paulo Eduardo Cardoso
In a raster asc object, I'd like to take the positions (x and y coordinates) for a given pixel ID. Any idea about how to do this? ___ Paulo E. Cardoso [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Strange error with ROCR

2009-08-04 Thread Christian Schulz
Hi, you need the score value , have a look at ?svm.predict and in the ROCR example. traindata - as.data.frame(matrix(runif(1000),ncol=10)) trainlabels - as.factor(sample(c(win,lose),nrow(data),replace=T,prob=c(0.5,0.5))) model - svm(traindata,trainlabels, type=C-classification,

[R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
Hi All, I have some data where the dependent variable is a score, low (1:3) or high (8:9), and the independent variables are 21 genotypic markers. I'm fitting a logistic regression on the whole dataset after transforming the score to 0/1 and normal linear regression on the high and low

[R] matrix

2009-08-04 Thread Ismail, Riyad
Hi I have dataset that consists of two columns AB0.102 AC -0.002 BA -0.102 BC 0.270 CA 0.002 CB -0.270 I wish to create a matrix so that I can eventually plot the data. A B C A 1

Re: [R] asc class object - how to get positions (coordinates) for a given raster ID?

2009-08-04 Thread Clément Calenge
The function getXYcoords in the package adehabitat might help. You may also consider asc2spixdf, which returns an object of class SpatialPixelsDataFrame (where the coordinates are stored as well as the values of the pixel). Hope this helps, Clément Calenge. Paulo Eduardo Cardoso wrote: In

Re: [R] matrix

2009-08-04 Thread ONKELINX, Thierry
Split the first column into two columns. One with the first letter and one with the last letter. Then you cast() from the reshape-package to create the matrix you want. HTH, Thierry ir. Thierry Onkelinx Instituut

Re: [R] matrix

2009-08-04 Thread Henrique Dallazuanna
You can try something about like this: merge(transform(x, V1 = gsub(^[A-Z], , x$V1), V3 = gsub([A-Z]$, , x$V1)), data.frame(V1 = LETTERS[1:3], V3 = LETTERS[1:3], V2 = 1), by = c(V1, V3), all = TRUE) On Tue, Aug 4, 2009 at 8:35 AM,

[R] Manova post hoc

2009-08-04 Thread Michelangelo La Spina
Hello, mailing list! I'm using a manova in R to study the responses of four dependent variables. I would like to do a post hoc analysis, but I don`t know which is the best and how to introduce in R. I'm using a pairwise t test, but I'm not sure if it is correct, I like to use tukeyHSD, but

[R] FW: matrix

2009-08-04 Thread Ismail, Riyad
My apologies, to elaborate I carried out a correlation analysis and I want to plot the data (similar to the graphs available in the corrplot package. However, the results are as follows (I have many more combinations): AB0.102 AC -0.002 BA -0.102 BC

[R] error message memory not mapped

2009-08-04 Thread Anne Skoeries
Hi there, I'm automatically generating buttons depending on the amount of rows my dataframe consists of. The buttons are supposed to call a barplot- function. Generating the buttons and displaying the barplot isn't a problem, but once I press one of the buttons, I'm getting an error-

Re: [R] fitting a truncated power law

2009-08-04 Thread John Sanders
Dear Glen_b, The function I'm trying to fit has the form: P(k) ~ k^(-y) exp (– k ⁄ kx) And deals with count data. I'm a newbie, so any more specific suggestion would be greatly appreciated. john John Sanders-2 wrote: How can I fit a truncated power law to a vector? I can't find a

Re: [R] How to get w and b in SVR? (package e1071)

2009-08-04 Thread marlene marchena
Hi Steve, First of all, thanks for your answer. I did all that you suggested and now I have some questions. 1) when I use svm.m1$coefs I have 180 values (the number of SV) of 10 and -10, I think that it is related with C=10 because when I change for C=100 I have 180 values of 100 and -100. I

[R] matrix

2009-08-04 Thread Ismail, Riyad
My apologies, to elaborate I carried out a correlation analysis and I want to plot the data (similar to the graphs available in the corrplot package. However, the results are as follows (I have many more combinations): AB0.102 AC -0.002 BA -0.102 BC

Re: [R] parameter asterisks

2009-08-04 Thread Ben Bolker
alexander russell-2 wrote: Hello, Is there a clearcut answer as to why R prints 'NA' sometimes instead of standard errors? mle2(minuslogl = nlikfun4, start = list(a = 1, c = 1, d = 0.2, b = 0.1, b1 = 0.1), method = Nelder-Mead) Coefficients: Estimate Std. Error z value Pr(z)

[R] Problems with lqs()

2009-08-04 Thread Kathrin Schmidt
Dear List-Members, I have a problem with the function lqs() from package MASS. In some cases it produces different results for the same settings and needs a random seed to be set, in other cases not. I really cannot understand, why this happens. As well I do not understand what exactly you

Re: [R] Comparison of Output from dwtest and durbin.watson

2009-08-04 Thread Tom La Bone
Allow me to reword this question. I have performed two fits to the same set of data below: a weighted fit and an unweighted fit. I performed the Durbin-Watson tests on each fit using dwtest and durbin.watson. For a given fit (weighted or unweighted), should both dwtest and durbin.watson be giving

Re: [R] Comparison of Output from dwtest and durbin.watson

2009-08-04 Thread Ronggui Huang
I think the statistics are the same, but the p-values are not exactly the same as they used different methods for the p-value. car uses bootstrapping and lmtest uses the pan algorithm, said from the help pages. 2009/8/4 Tom La Bone boo...@gforcecable.com: Allow me to reword this question. I

Re: [R] Order statistic in wtd.quantile

2009-08-04 Thread Frank E Harrell Jr
Michael Becher wrote: Dear Professor Harrell, please allow me a brief question about the wtd.quantile() function in your marvelous R package Hmisc that I was not able to answer using the documentation or the web. For type=quantile, what is the exact statistic that is estimated? The

Re: [R] Nonlinear mixed binary regression model

2009-08-04 Thread Caio Azevedo
Dear Daniel, Thanks a lot for your answer. I will take a look in such package. Best regards, Caio On Tue, Jul 28, 2009 at 10:38 PM, Daniel Malter dan...@umd.edu wrote: Caio, check the lme4 library. The lmer function allows for fixed and random effects. Daniel -

Re: [R] RServe - How to use 'createReference' method?

2009-08-04 Thread joaodaniel
Hello, Actually you are right. I was looking on the wrong direction. But I still got some doubts about how to use those methods. I want to open a file on the client machine, for example a txt tab-delimited, and create a dataframe with its information on R. I got to create a RFileInputStream

[R] Building package with vignette

2009-08-04 Thread Richard Chandler
Hello, I have a package that builds fine using R CMD build pkg --no-vignette, but I get the following error when running R CMD build pkg: ** building package indices ... Error in setwd(OutVignetteDir) : cannot change working directory ERROR: installing package indices failed I don't know why it

[R] Efficient coding

2009-08-04 Thread Daniele Amberti
I have a piece of code as the one at the bottom, unfortunately since it involves time series from a db it's not easy to give to mailing list a working script. It becomes very slow after few hundred iterations over variable sp (must process several thousands). The Rprof() indicates that the

Re: [R] Comparison of Output from dwtest and durbin.watson

2009-08-04 Thread Tom La Bone
My concern is that the two tests give different DW statistics for the weighted fit and very different p-values for the same DW statistic for the unweighted fit. Is there a right answer here? -- View this message in context:

Re: [R] Help with reshaping data.frame

2009-08-04 Thread davidr
Thanks to Hadley (shortest and sweetest), Eric and Gabor. I was _so_ close. Now I think I've learned some things about the reshape function and package! (Also transform and interaction.) Thanks to you all, -- David -Original Message- From: hadley wickham [mailto:h.wick...@gmail.com]

[R] read.csv from a remote machine

2009-08-04 Thread Olga Lyashevska
Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. I would appreciate any suggestions, Thanks! Olga __ R-help@r-project.org mailing list

Re: [R] read.csv from a remote machine

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 4, 2009, at 10:37 AM, Olga Lyashevska wrote: Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. I would appreciate any suggestions, Look at the different ways you can

[R] One critical question in R

2009-08-04 Thread Hyo Karen Lee
Hi, I have one critical question in using R. I am currently working on some research which involves huge amounts of data(it is about 15GB). I am trying to use R in this research rather than using SAS or STATA. (The company where I am working right now, is trying to switch SAS/STATA to R) As far

[R] Writing a NetCDF file in R

2009-08-04 Thread Steve Murray
Dear all, I am attempting to convert 10 NetCDF files into a single NetCDF file, due to the data input requirements of a model I hope to use. I am using the ncdf package, version 1.6. The data are global-scale water values, on a monthly basis for 10 years (ie. 120 months of data in total; at

Re: [R] One critical question in R

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 4, 2009, at 11:20 AM, Hyo Karen Lee wrote: Hi, I have one critical question in using R. I am currently working on some research which involves huge amounts of data(it is about 15GB). I am trying to use R in this research rather than using SAS or STATA. (The company where I am

Re: [R] Comparison of Output from dwtest and durbin.watson

2009-08-04 Thread Achim Zeileis
On Tue, 4 Aug 2009, Tom La Bone wrote: My concern is that the two tests give different DW statistics for the weighted fit and very different p-values for the same DW statistic for the unweighted fit. Is there a right answer here? dwtest() is not handling WLS at the moment. I'll have a look

Re: [R] One critical question in R

2009-08-04 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hyo Karen Lee Sent: Tuesday, August 04, 2009 8:21 AM To: r-help@r-project.org Subject: [R] One critical question in R Hi, I have one critical question in using R. I am

Re: [R] survdiff for left-truncated data?

2009-08-04 Thread Terry Therneau
Does anyone know if there is a function like survdiff which can also handle left-truncated and right-censored data? When I use it on left-truncated and right-censored data I get an error message saying Right censored data only. coxph(Surv(time1, time2, status) ~ factor(group), data=mydata)

Re: [R] One critical question in R

2009-08-04 Thread Barry Rowlingson
On Tue, Aug 4, 2009 at 4:20 PM, Hyo Karen Leetotem...@gmail.com wrote: I am currently working on some research which involves huge amounts of data(it is about 15GB). One point nobody has seemed to make yet is that the above statement is meaningless... Do you have a CSV file that is 15GB

Re: [R] read.csv from a remote machine

2009-08-04 Thread Barry Rowlingson
On Tue, Aug 4, 2009 at 3:37 PM, Olga Lyashevskao...@herenstraat.nl wrote: Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. If it's on an HTTP server then you don't need to faff with

Re: [R] RServe - How to use 'createReference' method?

2009-08-04 Thread Romain Francois
Hi, So the file you want to read is on the client machine, and you want to transfer it to the server and read it into R ? What I guess you need is : - open a FileInputStream, many many tutorials on the web will tell you how this works. - open a RFileOutputStream - call the read(byte[] b)

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
Actually, I tried doing data2 = unique(data) mod = lm(y ~ x1 + ... + xn, data2) fitted(mod) and I still get les fitted values than observations. Federico On 4 Aug 2009, at 12:18, Federico Calboli wrote: Hi All, I have some data where the dependent variable is a score, low (1:3) or high

[R] error in Elastic net

2009-08-04 Thread ram basnet
Dear R users,   I am new user for elastic net. I am trying to use elasticnet library. I have marker data with 359 markers and 168 samples, and response is metabolites. I am trying to do regression between a metabolite and markers.  But i am getting the following error:  

[R] [R-pkgs] Deducer 0.1 : An intuitive cross-platform data analysis GUI

2009-08-04 Thread Ian Fellows
Deducer 0.1 has been released to CRAN Deducer is designed to be a free, easy to use, alternative to proprietary software such as SPSS, JMP, and Minitab. It has a menu system to do common data manipulation and data analysis tasks, and an excel-like spreadsheet in which to view and edit data

Re: [R] error in Elastic net

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 4, 2009, at 1:03 PM, ram basnet wrote: Dear R users, I am new user for elastic net. I am trying to use elasticnet library. I have marker data with 359 markers and 168 samples, and response is metabolites. I am trying to do regression between a metabolite and markers. But i am

Re: [R] RServe - How to use 'createReference' method?

2009-08-04 Thread Romain Francois
Hi, I've done a more complete response in my blog. http://tr.im/vshK Romain On 08/04/2009 06:10 PM, Romain Francois wrote: Hi, So the file you want to read is on the client machine, and you want to transfer it to the server and read it into R ? What I guess you need is : - open a

[R] Revolutions blog: July Roundup

2009-08-04 Thread David M Smith
I write about R every weekday at the Revolutions blog: http://blog.revolution-computing.com In case you missed them, here are some articles from last month of particular interest to R users. http://bit.ly/2HPlOe announced a directory of R user groups available on the Revolutions blog.

Re: [R] fitted.values less than observed values

2009-08-04 Thread David Winsemius
Your first posting made me think that you were complaining that the fitted values were less than the raw values. Your second posting makes me think that you may be conflating the English word less with the word English fewer. Many native speakers make the same error, but in this context

[R] regex question

2009-08-04 Thread ravi
Hi, I am getting stuck over an apparently simple problem in the use of regular expressions : To collect together the first letters of the words from the Perl motto, “There is more than one way to do it” in the following form – TIMTOWTDI. I tried the following code :   # A regex problem

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
On 4 Aug 2009, at 18:27, David Winsemius wrote: Your first posting made me think that you were complaining that the fitted values were less than the raw values. Your second posting makes me think that you may be conflating the English word less with the word English fewer. Many native speakers

Re: [R] fitted.values less than observed values

2009-08-04 Thread Federico Calboli
On 4 Aug 2009, at 18:27, David Winsemius wrote: Your first posting made me think that you were complaining that the fitted values were less than the raw values. Your second posting makes me think that you may be conflating the English word less with the word English fewer. Many native speakers

Re: [R] regex question

2009-08-04 Thread Gabor Grothendieck
Try this: library(gsubfn) strapply(astr, \\w+, ~ substr(x, 1, 1), simplify = c) [1] T i m t o w t d i i t f f T On Tue, Aug 4, 2009 at 1:28 PM, ravirv...@yahoo.se wrote: Hi, I am getting stuck over an apparently simple problem in the use of regular expressions : To collect together the

Re: [R] regex question

2009-08-04 Thread Gabor Grothendieck
And here is a second way: strapply(astr, (\\w)\\w+, c, simplify = c) [1] T i m t o w t d i i t f f T On Tue, Aug 4, 2009 at 1:42 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: Try this: library(gsubfn) strapply(astr, \\w+, ~ substr(x, 1, 1), simplify = c)  [1] T i m t o w t d i i t

Re: [R] read.csv from a remote machine

2009-08-04 Thread Olga Lyashevska
Thanks Barry and Steve, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. Probably works with ftp: too. How remote is it? In fact it is a bit more complicated. I am working on a Mac machine,

[R] R's database capabilities

2009-08-04 Thread Jim Bouldin
I admit that I've not done a thorough search on this topic, but from the several instructional manuals and/or tutorials I've looked at, I don't see any mention of relational database capabilities in R? Have I missed something, and if so, can someone point me in the right direction to get

Re: [R] R's database capabilities

2009-08-04 Thread Romain Francois
Hi, Did your search include this : R RSiteSearch( database ) Romain On 08/04/2009 08:04 PM, Jim Bouldin wrote: I admit that I've not done a thorough search on this topic, but from the several instructional manuals and/or tutorials I've looked at, I don't see any mention of relational

[R] Caculate first difference from a dataframe; write a simulation

2009-08-04 Thread Meenu Sahi
Dear R Users I'm writing my first simulation in R. I've put across my problems with a smaller example in the attachment along with the questions. Please help. Best regards Meenu mydat-read.table(textConnection(Level spread change State 4.57 1.6 BlF NA 4.45 2.04 BrS NA 3.07 2.49 BlS NA 3.26

Re: [R] Strange error with ROCR

2009-08-04 Thread Noah Silverman
Good point. I'm not sure how I missed that. This does lead to an additional question: Is the probability of the true label the best prediction to feed to the ROCR package, or is it better to use the decision.value Anybody have any experience on this one? Thanks! -N On 8/4/09 3:28 AM,

Re: [R] R's database capabilities

2009-08-04 Thread David Winsemius
On Aug 4, 2009, at 2:04 PM, Jim Bouldin wrote: I admit that I've not done a thorough search on this topic, but from the several instructional manuals and/or tutorials I've looked at, I don't see any mention of relational database capabilities in R? Have I missed something, and if so,

[R] Sweave, cm-lgc and minus signs

2009-08-04 Thread Bert Stumm
Hello, since a couple of days I'm trying hard to elicit a certain thing out of the Sweave function of R. Unfortunately I'm quite unsuccessful. It's only about a small, ridiculous minus sign, which does not appear in the final pdf of a latex file, if I try to incorporate the Computer- Modern

[R] Completion for custom $ operator?

2009-08-04 Thread Vitalie S.
Dear UseRs, I declared a `$` method for a S4 class. Can I have ab automatic completion for this operator in R? Lists and environment objects provide this feature by default, but my object is an extension of function class which does not have subseting defined. How to be? Thanks for any

Re: [R] Strange error with ROCR

2009-08-04 Thread Tobias Sing
Is the probability of the true label the best prediction to feed to the ROCR package, or is it better to use the decision.value Since AFAIK they are related by a monotonous transformation, both approaches should lead to the same ROC curve, shouldn't they? (not tested) On Tue, Aug 4, 2009 at

Re: [R] Strange error with ROCR

2009-08-04 Thread Noah Silverman
I hadn't thought of that. I'll run some tests... -N On 8/4/09 11:49 AM, Tobias Sing wrote: Is the probability of the true label the best prediction to feed to the ROCR package, or is it better to use the decision.value Since AFAIK they are related by a monotonous transformation, both

[R] ggplot2 course: 19 October, Austin TX / the web

2009-08-04 Thread Hadley Wickham
Hi all, On October 19, I'll be offering a one data ggplot2 course in conjunction with the ISMI Manufacturing Week. The course is open to all and you can attend in person (Austin TX) or over the web. More information available from http://lookingatdata.com/ismi-2009/ Regards, Hadley --

[R] array slice notation?

2009-08-04 Thread Steve Jaffe
Suppose I have an n-diml array A and I want to extract the first row -- ie all elements A[1, ...] Interactively if I know 'n' I can write A[1,] with (n-1) commas. How do I do the same more generally, eg in a script? (I can think of doing this by converting A to a vector then extracting

Re: [R] session logging

2009-08-04 Thread Allan Engelhardt
sink(..., type=c(output,message), split=TRUE) at the beginning of your session should do it? Jacob Wegelin wrote: Consider all the text that one sees on the console during an R session. Is there a way, within R, to make all this text--both the output and the messages--automatically get

Re: [R] array slice notation?

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 4, 2009, at 3:23 PM, Steve Jaffe wrote: Suppose I have an n-diml array A and I want to extract the first row -- ie all elements A[1, ...] Interactively if I know 'n' I can write A[1,] with (n-1) commas. How do I do the same more generally, eg in a script? (I can think of

Re: [R] scatterplot3d bug??

2009-08-04 Thread Uwe Ligges
Will take a look when back from holidays in 2 weeks. Uwe David Winsemius wrote: Not sure you can call it a bug when the help page says for angles in range (180, 360) that some support functions may not work properly. On Aug 3, 2009, at 2:12 PM, Vivek Ayer wrote: Hey guys, Not sure if I

Re: [R] array slice notation?

2009-08-04 Thread Steve Jaffe
Yes, I was thinking more in terms of mental operations than physical. I think the following works, but it doesn't seem entirely transparent :-) Given array A, and a vector of row indices v (ie 1 = v = dim(A)[1]), the slice of rows v is A[ outer(v, dim(A)[1]*( 1:prod(dim(A)[-1])-1 ), '+') ]

Re: [R] Completion for custom $ operator?

2009-08-04 Thread Deepayan Sarkar
On Tue, Aug 4, 2009 at 11:37 AM, Vitalie S.vitosm...@rambler.ru wrote: Dear UseRs, I declared a `$` method for a S4 class. Can I have ab automatic completion for this operator in R? Lists and environment objects provide this feature by default, but my object is an extension of function class

Re: [R] array slice notation?

2009-08-04 Thread Steve Jaffe
Although you *do* have to re-assign the dimensions, otherwise the result is just a flat vector, ie slice - A[ outer(v, dim(A)[1]*( 1:prod(dim(A)[-1])-1 ), '+') ] dim(slice) - dim(A)[-1] Steve Jaffe wrote: A[ outer(v, dim(A)[1]*( 1:prod(dim(A)[-1])-1 ), '+') ] -- View this message in

Re: [R] array slice notation?

2009-08-04 Thread Søren Højsgaard
You can do A - HairEyeColor do.call([, c(list(A),list(1,T,T))) Sex Eye Male Female Brown 32 36 Blue11 9 Hazel 10 5 Green3 2 Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org]

Re: [R] array slice notation?

2009-08-04 Thread Steve Jaffe
correction -- that would work for a single row, if you want the result to be an array with one fewer dimensions. But in general you get an array of the same dimension you started with (where the first dimension may be length 1). So: dim(slice) - c(length(v), dim(arr)[-1]) Although you *do*

Re: [R] session logging

2009-08-04 Thread Jacob Wegelin
Thanks. This seems to mirror the output *both* to the console *and* to the sink file. The error messages, on the other hand, show up only in the console. On Tue, Aug 4, 2009 at 3:24 PM, Allan Engelhardt all...@cybaea.com wrote: sink(..., type=c(output,message), split=TRUE) at the beginning of

Re: [R] Variable names as inputs...

2009-08-04 Thread Horacio Samaniego
That is exactly what I needed! I dunno why I did not think about it earlier duuhhh!!! thanks very much!!! sapply(modelos, AIC) did the job! more specifically, (I wanted a dataframe to make comparaisons easy) k=as.data.frame(sapply(modelos,AIC)) df_results=cbind(k,modelo=rownames(k))

Re: [R] array slice notation?

2009-08-04 Thread Jim Lemon
Hi Steve, I had the same problem when writing the hierobarp function in plotrix. Have a look at the source code (v2.6-4 in my copy lines 128-133) as the solution seems to work well. Jim __ R-help@r-project.org mailing list

[R] Stacked plots with common x-axis and different y-axis

2009-08-04 Thread Jason Rupert
Is there a place that shows how to create two plots that are stacked on top of each other where they share a common x-axis scale, but have differnt y-axis scale? Say have the following data: airquality Stack plot(airquality$Day, airquality$Wind) on top of plot(airquality$Day,

Re: [R] graph data mining

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 3, 2009, at 10:37 PM, Weiwei Shi wrote: Hi I am wondering if R or some others provide free-to-use graph mining tools, like mining some frequent structure in a x-y plot data? It sounds like you're looking for a library does frequent subgraph mining across a graph dataset. I'm

[R] Re ferencing columns and pulling selected data

2009-08-04 Thread PDXRugger
Please consider the following inputs: PrsnSerialno-c(735,1147,2019,4131,4131,4217,4629,4822,4822,5979,5979,6128,6128,7004,7004, 7004,7004,7004,7438,7438,9402,9402,9402,10115,10115,11605,12693,12693,12693)

[R] Wakeby Curve

2009-08-04 Thread amna khan
Hi Sir How to get Wakeby distribution curve on L-moment ratio diagram? Regards -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] problem with pattern matching

2009-08-04 Thread Rnewbie
dear all, I got a problem with pattern matching using grep. I extracted a list of characters from a data frame, and I tried to match this list of characters to a column from another data frame. In return, I got only one match, but there should be far more matches. Any ideas what has gone wrong?

[R] Oracle ODBC driver for Linux

2009-08-04 Thread Luis Ridao Cruz
R-help, I get the following error message when trying to connect to an Oracle database through R (2.8.1) under Linux (Ubuntu 9.04). channel-odbcConnect(magnus,uid=luisr,pwd=juanayzakarias) Warning messages: 1: In odbcDriverConnect(st, ...) : [RODBC] ERROR: state IM002, code 0, message

[R] RODBC package to connect to Oracle database Linux

2009-08-04 Thread Luis Ridao Cruz
R-help, I get the following error message when trying to connect to an Oracle database through R (2.8.1) under Linux (Ubuntu 9.04). channel-odbcConnect(magnus,uid=luisr,pwd=juanayzakarias) Warning messages: 1: In odbcDriverConnect(st, ...) : [RODBC] ERROR: state IM002, code 0, message

Re: [R] read.csv from a remote machine

2009-08-04 Thread Mark Wardle
I would use sshfs or an alternatively remote file system access. Ssh to your Linux box and then mount the mac os x filesystem via sshfs, or afs for example. Alternatively, can't you copy the data to the Linux box using sftp first? -- Dr. Mark Wardle Specialist registrar, Neurology (Sent

Re: [R] na.strings and the like; suspending interpretation of NA

2009-08-04 Thread Jan Theodore Galkowski
The magic I was looking for is to pass as.is=TRUE to sqlQuery of RODBC. The reference to read.table is a little oblique, but with that, all works fine. An education! :-) Thanks much, Jan On Tue, 04 Aug 2009 09:05:05 +0200, Peter Dalgaard p.dalga...@biostat.ku.dk said: Jan Theodore

Re: [R] problem with pattern matching

2009-08-04 Thread David Winsemius
On Aug 4, 2009, at 11:16 AM, Rnewbie wrote: dear all, I got a problem with pattern matching using grep. I extracted a list of characters from a data frame, and I tried to match this list of characters to a column from another data frame. In return, I got only one match, but there

[R] Error in elastic net

2009-08-04 Thread ram basnet
Dear R users,   I am new user for elastic net. I am trying to use elasticnet library. I have marker data with 359 markers and 168 samples, and response is metabolites. I am trying to do regression between a metabolite and markers.  But i am getting the following error:  

[R] Logistic Regression

2009-08-04 Thread Noah Silverman
Hi, Trying to setup a logistic regression model. (Something new to me. I usually use SVM.) The person explaining the concept explained to me that I can include a group variable so that the probabilities predicted by the model will be per group Does this make sense to anyone? If so, how

Re: [R] Logistic Regression

2009-08-04 Thread David Winsemius
On Aug 4, 2009, at 6:33 PM, Noah Silverman wrote: Hi, Trying to setup a logistic regression model. (Something new to me. I usually use SVM.) The person explaining the concept explained to me that I can include a group variable so that the probabilities predicted by the model will be per

Re: [R] Logistic Regression

2009-08-04 Thread Noah Silverman
Thanks David, But HOW do I indicate the grouping variable in the formula? Thanks! -N On 8/4/09 3:37 PM, David Winsemius wrote: On Aug 4, 2009, at 6:33 PM, Noah Silverman wrote: Hi, Trying to setup a logistic regression model. (Something new to me. I usually use SVM.) The person

Re: [R] Logistic Regression

2009-08-04 Thread David Winsemius
On Aug 4, 2009, at 6:38 PM, Noah Silverman wrote: Thanks David, But HOW do I indicate the grouping variable in the formula? Hard to tell. You have told us absolutely nothing about the problem. Discrete variables cause no problems in formulas. Perhaps one of : ?factor ?cut ?quantile

  1   2   >