Re: [R] a question on matrix manipulation

2009-06-17 Thread Dimitris Rizopoulos
Hi Lei, one way to do this is the following: mat - matrix(rnorm(4*6), 4, 6) ind - c(3, 2, 4, 5) mat[rep(seq_along(ind), ind), ] I hope it helps. Best, Dimitris Lei Liu wrote: Hi there, I have a question on manipulating a matrix. Say I have a matrix A with 3 rows. I want to generate a

Re: [R] ifelse(is.na), with function inside

2009-06-17 Thread joscani
Try: b- ifelse(is.na(a),1,2) Grześ wrote: 2 - is.na(a) - it's superb! but I need call a function: wy[i]- ifelse(((is.na(a))), call_fun1(x), call_fun2(x) Gabor Grothendieck wrote: Try: 2 - is.na(a) On Tue, Jun 16, 2009 at 5:46 PM, Grześgregori...@gmail.com wrote: Hi,

Re: [R] a question on matrix manipulation

2009-06-17 Thread Simon Blomberg
How about this: mat - matrix(rep(1:4, each=4), nrow=4, byrow=TRUE) mat[rep(1:4, times=c(3,2,4,5)),] Cheers, Simon. On Wed, 2009-06-17 at 01:54 -0400, Lei Liu wrote: Hi there, I have a question on manipulating a matrix. Say I have a matrix A with 3 rows. I want to generate a new matrix

Re: [R] [R-help] how to install own R withour root?

2009-06-17 Thread Patrick Connolly
On Tue, 16-Jun-2009 at 03:48PM -0700, J Dougherty wrote: [...] | You might simply ask your administrator to install R and the | relevant libraries. Not infrequently admins can get cranky about | users with executables in their user space. I suspect that the OP is in a position similar to mine

[R] vertical line in xtable

2009-06-17 Thread christiaan pauw
Hi everyone I have created a function that uses xtable to print table of frequencies and percentages with a heading and some sample information (the sample size and missing values). The function and example data is below. I want a vertical line that separates the results from the sample

[R] Unable to use jpeg(), png() etc.....

2009-06-17 Thread Martial Sankar
Hello, I 've just re-installed R 2.9.0 on ubuntu 9.04. I do not understand why I am unable to use simple device function such as jpeg(), png()... png() Error in X11(paste(png::, filename, sep = ), width, height, pointsize, : unable to start device PNG In addition: Warning message: In

Re: [R] Comparing model fits for NLME when models are not nested

2009-06-17 Thread Lindsay Banin
Hi all, Many thanks for your advice. Lindsay -Original Message- From: Peter Flom [mailto:peterflomconsult...@mindspring.com] Sent: 12 June 2009 11:18 To: Lindsay Banin; 'r-help@r-project.org' Subject: Re: [R] Comparing model fits for NLME when models are not nested Lindsay Banin

[R] lattice: axis ticks, axis alignment and remove axis from plot

2009-06-17 Thread Katharina May
Hi there, I'm a bit confused concerning the axis tck setting in the lattice package as the ticks on left sided axis aren't drawn at all with the following setting: dados - data.frame(varsep = factor(rep(1:2,10)), i = runif(20)) library(lattice) my.theme - list(

[R] Urgent - odfWeave produces graphs /images with Read-Error

2009-06-17 Thread Fredrik Karlsson
Dear list, I have been working on a report with around 60 images in it, and everything has been fine, until now. I find that the image output that is produced by odfWeave produces images that are NOT readable by OpenOffice or NeoOffice. I get empty boxes with Read-Error written in them. While

Re: [R] Urgent - odfWeave produces graphs /images with Read-Error

2009-06-17 Thread Ronggui Huang
If you use lattice to produce the figures, you need to wrap them in print, say, = print(xyplot(y~x,data=dat)) @ Ronggui 2009/6/17 Fredrik Karlsson dargo...@gmail.com: Dear list, I have been working on a report with around 60 images in it, and everything has been fine, until now. I find that

[R] Re gression by groups questions

2009-06-17 Thread Chris Friedl
I have a large dataset grouped by a factor and I want to perform a regression on each data subset based on this factor. There are many ways to do this, posted here and elsewhere. I have tried several. However I found one method posted on the R wiki which works exactly as I want, and I like the

[R] Fwd: Urgent - odfWeave produces graphs /images with Read-Error

2009-06-17 Thread Fredrik Karlsson
-- Forwarded message -- From: Fredrik Karlsson dargo...@gmail.com Date: Wed, Jun 17, 2009 at 11:10 AM Subject: Re: [R] Urgent - odfWeave produces graphs /images with Read-Error To: Ronggui Huang ronggui.hu...@gmail.com Hi Ronggui, Thank you for this! In some of the graphs, the

Re: [R] problem with scan recognizing newline '\n'

2009-06-17 Thread Peter Dalgaard
Mark Kimpel wrote: I'm using R to do some file processing in Linux and am trying to read in the output of find . -type f -print ~/Music_Archives_search_problem/ls.output.find.txt This command yields a text file with each line representing the full path name of all files in the directory

Re: [R] Statistically detecting thresholds...

2009-06-17 Thread matifou
Hi Threshold models with time series for ecology have been quite famous with bookf from Tong (1990, nonlinear time series), who studied lynx population and showed evidence of threshold (regime specific) effects, and built a model called threshold autoregressive Many of those functions are

[R] About duleg Indicator Species Analysis

2009-06-17 Thread Mariko Takemoto
I have a question about the function duleg in the package labdsv. How the p-value is calculated ? Dufrene and Legendre (1997) have shown two calculation way ; one is the difference between the observed value and the mean of those obtained from random permutations and another is the rank of the

[R] p-value for the parameter in ARIMA model with R

2009-06-17 Thread FMH
Dear All, I decided to use an AR(1) model for the residual series and trying to find the p-value for each parameter by using arima command in R, but i never find it from the output. The output gives me the parameter and mean's value, its standard error, estaimated variance, AIC and

[R] Horisontal line in xtable

2009-06-17 Thread christiaan pauw
Hi everyone (Pardon the incorrect terminology of my previous post: vertical line...). I have created a function that uses xtable to print table of frequencies and percentages with a heading and some sample information (the sample size and missing values). The function and example data is below.

[R] shall I uninstall an old R installation in advance of installing a new one ?

2009-06-17 Thread mauede
I have resumed developing R code on SuSE/Linux version 11.1 I installed the latest 64-bit R version available for my platform. Accidentally I figured out I still had an old R installation that, surprisingly, was not wiped out by the new SuSE installation from scratch. I suspect the new and old

Re: [R] Bin Category Labels on Axis

2009-06-17 Thread David Winsemius
On Jun 16, 2009, at 6:13 PM, jproville wrote: Thanks David! I had trouble understanding how to convert factors, and was playing around with as.numeric but it had never occurred to me to use a combination of both that and as.character. There's a FAQ on the topic. I am getting really

[R] nls with weights

2009-06-17 Thread Antje
Hi there, I don't have much experience with fitting at all and I'd like to get some advice how to use the weights-argument with nls correctly. I have created some data with a sigmoidal curve shape. Each y-Value was generated by the mean of three values. A standard deviation was calculated

Re: [R] ifelse(is.na), with function inside

2009-06-17 Thread Grześ
2 - is.na(a) - it's superb! but I need call a function: wy[i]- ifelse(((is.na(a))), call_fun1(x), call_fun2(x) Gabor Grothendieck wrote: Try: 2 - is.na(a) On Tue, Jun 16, 2009 at 5:46 PM, Grześgregori...@gmail.com wrote: Hi, I have a vector a=c(NA, 3, 4, 4, NA, NA, 3) and I

[R] Coerce rectangular matrix to symmetrical square matrix

2009-06-17 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a rectangular matrix of size 920 by 85. I'd like to coerce it into a square matrix such that all row/col names are present in the new matrix and the additional values are zero. As an example: A B C D A 1 2 3 4 E 5 6 7 8 F 9 10

[R] Problem in 'Apply' function: does anybody have other solution

2009-06-17 Thread suparna mitra
Dear All, I am having some problem in apply function. I have some data like below. I want to get a range vector (which is max-min value for each row , ignoring NA values.) Species.all[1:10,] V2 V3 V4 V5V6 V7V8 V9 1 57543 55938 47175 54922 36032 5785 29497

[R] glm binomial logit

2009-06-17 Thread jagat
Hi All, I am using glm function to build logistic regression. I noticed that glm function glm function is computing many other statistics which are not required for our analysis. As our dataset is very big and we have to run logistic regression on several samples the run time drastically

[R] Pharmacokinetic and pharmacodynamic modeling and simulation

2009-06-17 Thread Dick Verkerk
Pharmacokinetic and pharmacodynamic modeling and simulation By Dr. Jan Freijer September 24, 2009 Amsterdam, The Netherlands http://www.can.nl/events/details.php?id=57 This course is aimed at users of R or S-PLUS in the bio-pharmaceutical sciences who would like to use R

[R] Demande d'informations

2009-06-17 Thread Da MUNDA Carlo
Bonjour Monsieur, Madame, Je vous écris pour vous demander une question concernant le logiciel R.   Je voudrais vous demander l'équivalent de lsmeans de SAS dans R pour les échantillons d'éffectifs inégaux?   Merci d'avance.   Carlo. [[alternative HTML version deleted]]

[R] nearZeroVar in caret fails

2009-06-17 Thread Damian Krstajic
I am using R version 2.6.0 on Linux (CentOS 4.5) and have a problem with executing nearZeroVar function in the package caret. I am using the latest release of caret v4.17. I have a matrix X with 266 rows and 4 columns and when implementing nearZeroVar function from caret package I get

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-17 Thread suparna mitra
Dear All, Just to add some more lines in my previous query I am writing this. I was checking with several data. The cases where the apply function is working, the part of result looks like : apply(Species.all[1:10,],1,max,na.rm=TRUE) 1 2 3 4 5 6 7 8 910

[R] How to append to a list dynamically?

2009-06-17 Thread Nick Angelou
Hi, I have a problem with dynamic appending to a list. Here is the list variable: clusters - vector(list, 0) I extended in the function below: cluster - function (pair, clusters) { found - FALSE for (i in length(clusters)) { if (length(intersect(pair, clusters[i])) 0) {

[R] Coefficient of determination -- should be compare to a trivial model

2009-06-17 Thread John C Nash
As a long time nonlinear modeller, I always compute a quantity commonly referred to as R_squared or the coefficient of determination. However, I agree with other commentators, including those of several years ago, that one wants to be very careful about interpretation. In fact, I would say DO NOT

Re: [R] shall I uninstall an old R installation in advance of installing a new one ?

2009-06-17 Thread Martial Sankar
Hello Maura, Date: Wed, 17 Jun 2009 14:07:44 +0200 From: mau...@alice.it To: r-h...@stat.math.ethz.ch Subject: [R] shall I uninstall an old R installation in advance of installing a new one ? I have resumed developing R code on SuSE/Linux version 11.1 I installed the latest 64-bit R

Re: [R] How to append to a list dynamically?

2009-06-17 Thread Linlin Yan
Function parameters in R are passed by value, not by reference. In order to resolve it, just remove clusters from the parameter list, and use clusters[i] - ... to change the value of global variable. On Wed, Jun 17, 2009 at 7:52 PM, Nick Angelounikola...@yahoo.com wrote: Hi, I have a problem

Re: [R] ifelse(is.na), with function inside

2009-06-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.06.2009 07:51:27: 2 - is.na(a) - it's superb! but I need call a function: wy[i]- ifelse(((is.na(a))), call_fun1(x), call_fun2(x) You did not grasp how to use ifelse. It goes not cycle through logical vector is.na(a). from help page

Re: [R] Problem in 'Apply' function: does anybody have othersolution

2009-06-17 Thread Liaw, Andy
Could it be that the problematic data came from csv files with quotes? What does str() on those data say? Recall that apply() will coerce the object to a matrix (if it's not), which means everything needs to be the same type, so if even just one column is read into R as non-numeric, the entire

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-17 Thread jim holtman
Do an 'str' of your object. It looks like one of the columns is probably character/factor since there are quotes around the 'numbers'. You can also explicity convert the offending columns to numeric is you want to. Also use colClasses on the read.csv to define the class of the data in each

Re: [R] Constrained Optimization, a full example

2009-06-17 Thread Ravi Varadhan
Look at this: http://finzi.psych.upenn.edu/Rhelp08/2009-May/198540.html Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns

Re: [R] Testing if all elements are equal in a vector/matrix

2009-06-17 Thread utkarshsinghal
I will wait for the next version-2.9.1 and presently using Petr's suggestion, i.e., (x[1]*length(x))==sum(x) which significantly reduced the run time. The problem is now there might be only small differences ,say, of the order of 10^-10 which I want to ignore. So I used:

Re: [R] glm binomial logit

2009-06-17 Thread Marc Schwartz
On Jun 17, 2009, at 1:45 AM, ja...@cmi.ac.in wrote: Hi All, I am using glm function to build logistic regression. I noticed that glm function glm function is computing many other statistics which are not required for our analysis. As our dataset is very big and we have to run logistic

Re: [R] ifelse(is.na), with function inside

2009-06-17 Thread Grześ
This is my function: zywnoscCalosc - function( zywnosc, sklepik, sklslodycze) { b=as.vector(sklslodycze) fun=function(a,b){ a=2+b } zywnosc=ifelse(is.na(sklepik),NA,fun(a,b))#Here I have a problem ! } I always get: Error in 2 + b : non-numeric argument to binary operator I think

[R] [R-pkgs] WriteXLS - New Version 1.8.0

2009-06-17 Thread Marc Schwartz
The updated package has been submitted to CRAN and will propagate to mirrors over the next day or so. It is maintained on R-Forge at http://r-forge.r-project.org/projects/writexls , where downloads are available as well. Package: WriteXLS Version: 1.8.0 Description: Cross-platform perl

Re: [R] How to append to a list dynamically?

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 7:52 AM, Nick Angelou wrote: I have a problem with dynamic appending to a list. Here is the list variable: clusters - vector(list, 0) library(fortunes) fortune(dog) I would suggest that referring to a character vector as a list, and then also calling an element in

Re: [R] Bin Category Labels on Axis

2009-06-17 Thread jproville
David, It turns out that the 'at' argument takes the values 1,70,by=5, while the 'label' spans -36,33,by=5 Just took a little trial and error, but the graph now looks great. Cheers! Jeremy jproville wrote: Hi, I'd really appreciate if someone could give me some help or advice about

[R] How to translate a dataframe into the R code that makes that dataframe?

2009-06-17 Thread Mark Na
Hi, I am helping another R user (off list) and I would like to email her an R script containing the data she needs and the code to solve her problem. I have made a small dummy dataset, but instead of sending her a CSV I would prefer to send the data embedded in the script, so there would be a

Re: [R] How to translate a dataframe into the R code that makes that dataframe?

2009-06-17 Thread Gabor Grothendieck
See ?dump ?dput On Wed, Jun 17, 2009 at 10:43 AM, Mark Namtb...@gmail.com wrote: Hi, I am helping another R user (off list) and I would like to email her an R script containing the data she needs and the code to solve her problem. I have made a small dummy dataset, but instead of sending

Re: [R] How to translate a dataframe into the R code that makes that dataframe?

2009-06-17 Thread stephen sefick
why not save it as an .Rd file, or use some R code to to create the dataframe. This way the code will be totally self-contained. Stephen On Wed, Jun 17, 2009 at 10:43 AM, Mark Namtb...@gmail.com wrote: Hi, I am helping another R user (off list) and I would like to email her an R script

Re: [R] glm binomial logit

2009-06-17 Thread Thomas Lumley
You don't say why you think that computing these other statistics is responsible for the run time. If you just want to fit logistic regressions faster, glm.fit() is likely to be helpful. -thomas On Wed, 17 Jun 2009 ja...@cmi.ac.in wrote: Hi All, I am using glm function to build

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 9:27 AM, jim holtman wrote: Do an 'str' of your object. It looks like one of the columns is probably character/factor since there are quotes around the 'numbers'. You can also explicity convert the offending columns to numeric is you want to. Also use colClasses on

[R] sapply() related query

2009-06-17 Thread Girish A.R.
Hi folks, I'm trying to consolidate the outputs (of anova() and lrm()) from multiple runs of single-variable logistic regression. Here's how the output looks: y ~ x1 y ~ x2 y ~ x3 y ~ x4

Re: [R] Demande d'informations

2009-06-17 Thread milton ruser
Dear all, If I understood well with my broken french, Carlo are looking for some R solution that do the same as lsmeans that SAS do. Bests milton 2009/6/17 Da MUNDA Carlo carlo_damu...@yahoo.fr Bonjour Monsieur, Madame, Je vous écris pour vous demander une question concernant le logiciel R.

[R] New book: Mathematical modeling using R

2009-06-17 Thread Dr. Kai Velten
May I recommend my new book on mathematical modeling to you, which is based on R as a main software tool: Kai Velten: Mathematical Modeling and Simulation, Wiley-VCH, 2009, ISBN 978-3527407583. See also: http://www.wiley.com/WileyCDA/WileyTitle/productCd-3527407588.html

[R] Unicode normalization?

2009-06-17 Thread Allan Engelhardt
Does R support unicode normalization? For my application, I'd quite like to test for canonical equivalence (e.g. n\u0303 is equivalent to \u00F1 which is ñ) and ideally convert strings to NFD form. (\u0303 is the combining tilde character.) Is there a package for this? The Unicode

[R] is there any R function to read xls (Excel) format files ?

2009-06-17 Thread mauede
Sorry for this trivial question. I have just installed R on SuSE/Linux and cannot cope with the character terminal. I am going to install JGR that will make my life easier at searching for existing R functions/packages. In the meantime (higher-priority things to do) I would appreciate your

[R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Avraham . Adler
Hello. I am trying to invert a matrix, and I am finding that I can get different answers depending on whether I set LAPACK true or false using qr. I had understood that LAPACK is, in general more robust and faster than LINPACK, so I am confused as to why I am getting what seems to be invalid

[R] GAM function with interaction

2009-06-17 Thread Paul Simonin
Hello R Users, I have a question regarding fitting a model with GAM{mgcv}. I have data from several predictor (X) variables I wish to use to develop a model to predict one Y variable. I am working with ecological data, so have data collected many times (about 20) over the course of two years.

Re: [R] nearZeroVar in caret fails

2009-06-17 Thread Max Kuhn
I just put in a new version of that function contributed by a user. I'll make that modification and send it to CRAN shortly. caret depends on R = 2.5.1. Thanks, Max __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] cumulative sum in data frame

2009-06-17 Thread SEUNG CHEON HONG
Dear R-Help List, I have a question about data manipulation. I tried to make code myself but too much for me. I would greatly appreciate your help. I have data set consisting of site (from 1 to N1) and distance and there are several variables (1 to N2) collected from each sampling site. I am

[R] Cannot install a package - with a funny error message

2009-06-17 Thread Alon Ben-Ari
Hello I am trying to install the following package . I am logged in as SU of course. Below is my input and output. Any ideas? install.packages(kernlab) --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done Error in m[, 1] : incorrect number of dimensions

Re: [R] Demande d'informations

2009-06-17 Thread Jean-Paul Kibambe Lubamba
Your French is almost perfect Milton... This is what in fact Carlo is looking for. JP Dear all, If I understood well with my broken french, Carlo are looking for some R solution that do the same as lsmeans that SAS do. Bests milton 2009/6/17 Da MUNDA Carlo carlo_damu...@yahoo.fr

Re: [R] is there any R function to read xls (Excel) format files ?

2009-06-17 Thread Gabor Grothendieck
read.xls in the gdata package works on Linux. On Wed, Jun 17, 2009 at 11:37 AM, mau...@alice.it wrote: Sorry for this trivial question. I have just installed R on SuSE/Linux and cannot cope with the character terminal. I am going to install JGR that will make my life easier at searching for

Re: [R] sapply() related query

2009-06-17 Thread Marc Schwartz
On Jun 17, 2009, at 10:06 AM, Girish A.R. wrote: Hi folks, I'm trying to consolidate the outputs (of anova() and lrm()) from multiple runs of single-variable logistic regression. Here's how the output looks:

Re: [R] GAM function with interaction

2009-06-17 Thread Simon Wood
Paul, I think I would try something like yoyoras~te(temp,date) ... to incorportate a continuous interaction of temp and date. Otherwise with the models you are using, if `datecode' is a factor you'll get a smooth for every date, which may be over-flexible, and if datecode is numeric you'll

Re: [R] sapply() related query

2009-06-17 Thread Girish A.R.
Thanks, Marc! This is what I was looking for. best, -Girish PS: Also appreciate your concern about this being a part of a variable selection process. On Jun 17, 9:01 pm, Marc Schwartz marc_schwa...@me.com wrote: On Jun 17, 2009, at 10:06 AM, Girish A.R. wrote: Hi folks, I'm trying to

Re: [R] cumulative sum in data frame

2009-06-17 Thread jim holtman
Here is one way of doing it: x - read.table(textConnection(sitedistancevar1var2 + 1 10 1 0 + 1 20 0 1 + 1 30 1 2 + 1 40 3 3 + 1 50 1 4 + 2 10 1

Re: [R] cumulative sum in data frame

2009-06-17 Thread Jorge Ivan Velez
Dear Steve, Using Jim Holtman's x data, you can also try the following for columns 3 and 4: a - with(x, apply(x[,3:4], 2, tapply, site,function(x) cumsum(x))) x[,c('cvar1','cvar2')] - do.call(cbind,lapply(a, function(x) do.call(c,x))) x HTH, Jorge On Wed, Jun 17, 2009 at 11:48 AM, SEUNG CHEON

[R] tiff() woes

2009-06-17 Thread Federico Calboli
Hello all, a friend has a problem with tiff() which I was unable to help about. I searched the error messages to no avail. When he tries: tiff(filename = FedeWhyDoesntThisBloodyWork.tif, width = 5, height = 5, units = cm, bg = white, res = 1200) Error in tiff(filename =

[R] djustment values not defined

2009-06-17 Thread amor Gandhi
Hello,   I am using mod1 - lrm(y~x1+x2,na.action=na.pass,method=lrm.fit) summary(mod1) and I've got the following error: Error in summary.Design(mod1) : adjustment values not defined here or with datadist for x1 x2   Many thank, Amor [[alternative HTML version deleted]]

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Ravi Varadhan
Hi Avraham, I think this is a bug in solve() and qr.solve(). The structure of the QR object produced by LINPACK and LAPACK are different. In fact, the help page for qr says: qr a matrix with the same dimensions as x. The upper triangle contains the R of the decomposition and the lower

[R] Specifying ui and ci such that ui %*% theta - ci = 0

2009-06-17 Thread Stu @ AGS
Hi, I am a bit stuck on specifying ui and ci. I have read Lange's book ((1999) Numerical Analysis for Statisticians) to his approach and unfortunately his descriptions were not helpful for me. Here is what I have: ui - rbind(c(0, -1, 0), c(0, 0, -1)) ci - c(0, -1, -1))

Re: [R] djustment values not defined

2009-06-17 Thread Frank E Harrell Jr
amor Gandhi wrote: Hello, I am using mod1 - lrm(y~x1+x2,na.action=na.pass,method=lrm.fit) summary(mod1) and I've got the following error: Error in summary.Design(mod1) : adjustment values not defined here or with datadist for x1 x2 Many thank, Amor Please read the documentation for the

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Ravi Varadhan
Avraham, You can make LAPACK work by doing the following: Hinv[, 1] - solve(qr(PLLH, LAPACK=TRUE), c(1,0)) Hinv[, 2] - solve(qr(PLLH, LAPACK=TRUE), c(0,1)) Here is an example: H - matrix(runif(4), 2, 2) H - H + t(H) Hinv - solve(qr(H)) # this is the correct inverse from LINPACK Hinv1 -

[R] nlmeode question

2009-06-17 Thread In-sun Nam Knutsson
Dear All, I like to use nlmeode but so far having a trouble with setting up a function part. It does not allow me to use Cliver etc in the DiffEq and it does not allow me to have Vabs in the ObsEq. Would you kindly let me know what to do? Best wishes, In-Sun FunODE - list( DiffEq=list(

Re: [R] djustment values not defined

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 12:35 PM, amor Gandhi wrote: Hello, I am using mod1 - lrm(y~x1+x2,na.action=na.pass,method=lrm.fit) summary(mod1) and I've got the following error: Error in summary.Design(mod1) : adjustment values not defined here or with datadist for x1 x2 Several of the useful

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Avraham . Adler
Thank you VERY much, that was fantastic. I wish I understood WHY your suggestion works. To extend that to an n-by-n square matrix, the proper procedure would be (example, n=5 - most I would usually use (mixture of lognormals)): Hinv - matrix(NA, 5, 5) Hinv[, 1] - solve(qr(PLLH, LAPACK=TRUE),

[R] searching help for partial matches

2009-06-17 Thread Steve Jaffe
The situation is that I know there is a function and know approximately what the name is, and want to find the exact name. Is there a way of searching for near-matches (similar to unix apropos). For example, I know there is a function called something like allequal (or allequals or AllEquals

Re: [R] Specifying ui and ci such that ui %*% theta - ci = 0

2009-06-17 Thread Allan Engelhardt
My understanding is that optim(method=L-BFGS-B) does box constraints and constrOptim linear constraints. You want box. On 17/06/09 17:51, Stu @ AGS wrote: Hi, [...] My goal is to feed these into constrOptim such that there is no constraint on theta[1] and that theta[2]

Re: [R] how to verify gauss-markov hypothesis for linear model validity?

2009-06-17 Thread Greg Snow
I don't think that your questions are stupid, but they probably are the wrong one(s). There are 2 questions (or sets of questions) when thinking about your data for doing statistical inference. The first question is does this assumption hold exactly? e.g. are the residuals exactly normal?.

Re: [R] searching help for partial matches

2009-06-17 Thread baptiste auguie
Steve Jaffe wrote: The situation is that I know there is a function and know approximately what the name is, and want to find the exact name. Is there a way of searching for near-matches (similar to unix apropos). For example, I know there is a function called something like allequal (or

Re: [R] searching help for partial matches

2009-06-17 Thread Allan Engelhardt
?help.search help.search(allequal) help.search(apropos=allequal) ??allequal On 17/06/09 18:12, Steve Jaffe wrote: The situation is that I know there is a function and know approximately what the name is, and want to find the exact name. Is there a way of searching for near-matches (similar to

Re: [R] searching help for partial matches

2009-06-17 Thread Allan Engelhardt
On 17/06/09 18:20, baptiste auguie wrote: ??Allequal gets me there, admittedly not as cleverly as google would do if I failed to spell it correctly, for instance. ??Allepual No help files found matching ‘Allepual’ using fuzzy matching But it *almost* gets you there; try

Re: [R] searching help for partial matches

2009-06-17 Thread Steve Jaffe
help.search -- excellent I'm a bit confused though -- doc seems to say that ??pattern is same as help.search(pattern) but it doesn't work that way for me...I'd been trying ?? for some time without success. For example, ??allequal #returns No documentation for '?allequal' in specified packages

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Ravi Varadhan
Avraham, You can create a function to do the steps that I showed you, so that it is easy to use: solve.lapack - function(A) { # A function to invert a matrix using LAPACK qrA - qr(A, LAPACK=TRUE) apply(diag(1, ncol(A)), 2, function(x) solve(qrA, x)) }

Re: [R] searching help for partial matches

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 1:31 PM, Steve Jaffe wrote: help.search -- excellent I'm a bit confused though -- doc seems to say that ??pattern is same as help.search(pattern) but it doesn't work that way for me...I'd been trying ?? for some time without success. I thought the docs on this

[R] problem with axis alignment when plotting 2 time series on same graph

2009-06-17 Thread Josef . Kardos
I am trying to plot 2 time series on the same graph. For example, X1 is the vector of dates and times, its class is POSIXt. Y1 is an environmental parameter, e.g. salinity. X2 is a second vector of dates and times, also of class POSIXt.X2 has a different length than X1, but they have the

Re: [R] Coerce rectangular matrix to symmetrical square matrix

2009-06-17 Thread Dimitris Rizopoulos
one way is the following: mat - matrix(1:12, 3, 4, TRUE) dimnames(mat) - list(c(A, E, F), LETTERS[1:4]) cnams - colnames(mat) rnams - rownames(mat) unq.nams - unique(c(cnams, rnams)) out - matrix(0, length(unq.nams), length(unq.nams), dimnames = list(unq.nams, unq.nams)) p1 -

[R] gbm for cost-sensitive binary classification?

2009-06-17 Thread Tang Yuchun
I recently use gbm for a binary classification problem. As expected, it gets very good results, based on Area under ROC with 7-fold cross validation. However, the application (malware detection) is cost-sensitive, getting a FP (classify a clean sample as a dirty one) is much worse than getting

[R] disregard email about plotting 2 time series

2009-06-17 Thread Josef . Kardos
I found the problem. the date range was not exactly overlapping as i had thought. If the range of the 2 time series exactly overlap, then the two graphs overlay correctly. Unless there is another method or package that fixes this, it seems that if the 2 time series have non-matching ranges

[R] where/what is i? for loop (black?) magic

2009-06-17 Thread Liaw, Andy
A colleague and I were trying to understand all the possible things one can do with for loops in R, and found some surprises. I think we've done sufficient detective work to have a good guess as to what's going on underneath, but it would be nice to get some confirmation, and better yet, perhaps

[R] list of data.frames?

2009-06-17 Thread Steve Jaffe
I'm trying to build up a list of data.frames by appending one by one. If x,y,z are data.frames, I can do somelist - list(x, y, z) (or even somelist - list(x=x, y=y, z=z) to get names) But if I start with somelist - list(x,y) and now want to go from this to list(x,y,z) I'm stuck. I've tried

Re: [R] djustment values not defined

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 1:03 PM, David Winsemius wrote: On Jun 17, 2009, at 12:35 PM, amor Gandhi wrote: Hello, I am using mod1 - lrm(y~x1+x2,na.action=na.pass,method=lrm.fit) summary(mod1) and I've got the following error: Error in summary.Design(mod1) : adjustment values not defined here

Re: [R] list of data.frames?

2009-06-17 Thread Dimitris Rizopoulos
try this: dat1 - data.frame(x = rnorm(5)) dat2 - data.frame(y = rnorm(5)) dat3 - data.frame(z = rnorm(5)) lis - list(dat1 = dat1, dat2 = dat3) c(lis, list(dat3 = dat3)) I hope it helps. Best, Dimitris Steve Jaffe wrote: I'm trying to build up a list of data.frames by appending one by one.

[R] RWeka evaluate classifier on test set

2009-06-17 Thread Huihua Lu
Hi everyone, I have a test set with more than 1000 cases, when I use evaluate_Weka_classifier(RWeka)to evaluate my classifier on this test set, the output shows me the result of only 83 cases. I do have missing values in predictors, so I tried na.acton=na.pass, but it dosen't help. Now I

Re: [R] list of data.frames?

2009-06-17 Thread David Winsemius
On Jun 17, 2009, at 2:45 PM, Dimitris Rizopoulos wrote: try this: dat1 - data.frame(x = rnorm(5)) dat2 - data.frame(y = rnorm(5)) dat3 - data.frame(z = rnorm(5)) lis - list(dat1 = dat1, dat2 = dat3) c(lis, list(dat3 = dat3)) Or: lis[[dat3]] - dat3 I hope it helps. Best, Dimitris

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Avraham . Adler
Thank you; that is perfect! Should this bug be reported somewhere? --Avraham Ravi Varadhan rvarad...@jhmi.e

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-17 Thread Albyn Jones
As you seem to be aware, the matrix is poorly conditioned: kappa(PLLH,exact=TRUE) [1] 115868900869 It might be worth your while to think about reparametrizing. albyn On Wed, Jun 17, 2009 at 11:37:48AM -0400, avraham.ad...@guycarp.com wrote: Hello. I am trying to invert a matrix, and I

[R] gbm for cost-sensitive binary classification?

2009-06-17 Thread Tang Yuchun
(sorry to post it again with plain text). I recently use gbm for a binary classification problem. As expected, it gets very good results, based on Area under ROC with 7-fold cross validation. However, the application (malware detection) is cost-sensitive, getting a FP (classify a clean sample

Re: [R] lattice: axis ticks, axis alignment and remove axis from plot

2009-06-17 Thread katharina
Hi *, I solved the tick problem somehow (or rather I noticed that they are actually drawn on a xyplot which is there I really want them), but I'm still wondering and cannot find any information on that, how I align my axis in a xyplot that they both go through 0 (leftsided y-axis through x=0,

Re: [R] list of data.frames?

2009-06-17 Thread Wacek Kusnierczyk
Steve Jaffe wrote: I'm trying to build up a list of data.frames by appending one by one. If x,y,z are data.frames, I can do somelist - list(x, y, z) (or even somelist - list(x=x, y=y, z=z) to get names) But if I start with somelist - list(x,y) and now want to go from this to

[R] Curve fit a nonlinear equation with box constraints: success, many thanks!

2009-06-17 Thread Stu @ AGS
Dear R Helper Community! Thank you for all your help and suggestions. For your reference and any future person searching the archives, here is the solution that did what I wanted it to do. As background, my goal was to find the coefficients for the following equation form: y ~ c1 * x1

[R] Cairo in R for w32?

2009-06-17 Thread cmr.p...@gmail.com
Hello! I've just discovered that my package fails to pass CRAN checks on w32 due to capabilities('cairo') == FALSE. The particular functionality I use is SVG device. According to http://cairographics.org/, Cairo supports w32 platform. Could you please tell me about the reasons to disable Cairo

Re: [R] IP-Address

2009-06-17 Thread edwin
Hi all, Sorry, David has just told my that it was a mistake in my example (Thanks David). I had a wrong idea. The right idea is: make a ip range, when the number increament without an gap (and with maximum number: 255, see example down). In case my initial example would be:

  1   2   >