Re: [R] <= returns wrong result? Why

2010-01-12 Thread Liviu Andronic
On 1/13/10, Trafim Vanishek wrote: > this is the output result > > Rk[47] <= RB[21] > [1] FALSE > > > Rk[47] > [1] 0.002842007 > > > RB[21] > [1] 0.002842007 > I would suspect that, if you're looking at all the digits, the two are not exactly the same. I would try round(Rk[47], 10) <= round

[R] need a clarification on logistic regression

2010-01-12 Thread Ahmet Temiz
hello I need a clarification. in logistic regression, saturated model having all combinations and interactions of variables should be constructed in this way ? : > rsat2=glm(cbind(landp,landa) ~ as.factor(rlito)*as.factor(rslp)*as.factor(rasp)*as.factor(rplc)*as.factor(rwi),family= binomial(li

Re: [R] decompress tar.gz and zip files

2010-01-12 Thread Prof Brian Ripley
On Wed, 13 Jan 2010, Nathan S. Watson-Haigh wrote: Can anyone point me in the right direction for decompressing text files that are compressed as tar.gz or zip files? ?unztar ?unz ?unzip Note that neither .tar.gz nor .zip formats are restricted to a single file and more usually hold a collec

Re: [R] Placing eps files from R into Adobe InDesign documents: specifying fontfamily

2010-01-12 Thread S Devriese
On 01/12/2010 04:36 PM, dwalcerz wrote: > > This is a solution I am posting for a problem that others may have. > > If you want to: > 1. Place lattice graphics from R into an Adobe InDesign document, and > 2. Use the export as eps function in R to maximize resolution (it is much > better than e

[R] <= returns wrong result? Why

2010-01-12 Thread Trafim Vanishek
Dear all, Does anybody know the probable reason why <= gives false when it should give true? These two variables are of the same type, and everything works in the cycle but then it stops when they are equal. this is the output result > Rk[47] <= RB[21] [1] FALSE > Rk[47] [1] 0.002842007 > RB[21

[R] decompress tar.gz and zip files

2010-01-12 Thread Nathan S. Watson-Haigh
Can anyone point me in the right direction for decompressing text files that are compressed as tar.gz or zip files? Cheers, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsvil

Re: [R] Dynamic file / url name with read.csv

2010-01-12 Thread Kevin Middleton
A few suggestions: Don't mix ' and " Use paste() Don't include an extraneous ; SymA<- "SPY" Sym1<- paste("http://ichart.finance.yahoo.com/table.csv?s=",SymA,"&ignore=.csv",sep="";) Symbol<- read.csv(Sym1, stringsAsFactors=F) On Jan 12, 2010, at 10:03 PM, B S wrote: > > Hi- > > I would

[R] Dynamic file / url name with read.csv

2010-01-12 Thread B S
Hi- I would like to be able to change the value of SymA below and download a file from the corresponding URL.  Hardcoded, this line works fine: Symbol<- read.csv("http://ichart.finance.yahoo.com/table.csv?s=SPY&ignore=.csv";, stringsAsFactors=F) However, when I incorporate using a variable

Re: [R] Recommended visualization for hierarchical data

2010-01-12 Thread Rex C. Eastbourne
On Tue, Jan 12, 2010 at 8:58 PM, Simon Knapp wrote: > Not sure if there are any 'recommended' visualisations, but the following > is > a start (you will need to tune the scaling of the x-axis label and state > identifiers). > > In the plot produced, the widths of the 'columns' are proportional o

Re: [R] Recommended visualization for hierarchical data

2010-01-12 Thread Simon Knapp
Not sure if there are any 'recommended' visualisations, but the following is a start (you will need to tune the scaling of the x-axis label and state identifiers). In the plot produced, the widths of the 'columns' are proportional of purchases occurring in the state, and the height of the 'boxes'

[R] "select: bad file descriptor" in the multicore package

2010-01-12 Thread Hao Cen
Hi, I wonder anyone knows what causes the error message "select: bad file descriptor" in the multicore package. This error sometimes occurs and sometimes doesn't. I couldn't find any documentation on this error about this package. thanks Jeff __ R-hel

Re: [R] Recommended visualization for hierarchical data

2010-01-12 Thread Rex C. Eastbourne
On Tue, Jan 12, 2010 at 5:26 PM, Rex C. Eastbourne wrote: > Let's say I have data in the following schema that describes the number of > purchases a company has received from each County in the US: > > State | County | Purchases > --- > NJ | Mercer | 550 > CA |

Re: [R] parsing protocol of states

2010-01-12 Thread jim holtman
You might try this to get the data into a dataframe that would be easier to process. You can subset and split the dataframe to look at different combination. > str01 <- "2007-10-12 11:50:05 state B. ,2007-10-12 11:50:05 state C. ,2007-10-12 13:23:24 state D. ,2007-10-12 13:23:43 state E. ,2007-10

[R] Ask about large data set

2010-01-12 Thread Yi Du
Hi, Is that okay to let R to read data set more than 1 rows and use it to do some kernel density estimation? Thanks. Yi -- Yi Du Ph. D student in Economics University of Missouri Department of Economics 118 Professional Building Columbia MO 65211 1-573-239-6467 [[alternative HTML

[R] Recommended visualization for hierarchical data

2010-01-12 Thread Rex C. Eastbourne
Let's say I have data in the following schema that describes the number of purchases a company has received from each County in the US: State | County | Purchases --- NJ | Mercer | 550 CA | Orange | 23 I would like to visualize what states contribute the m

Re: [R] Calculate the percentages of the "numbers" in every column.

2010-01-12 Thread Simon Knapp
tmp <- scan() 0 2 1 0 1 0 2 1 2 3 0 0 0 0 1 0 0 2 3 1 dat <- matrix(tmp, byrow=T, ncol=4) apply(dat, 2, function(x, min.val, max.val) { tmp <- table(x)/length(x) res <- rep(0, max.val - min.val + 1) res[as.numeric(names(tmp)) - min.val + 1] <- tmp res }, 0, 3) Should do it (but I

Re: [R] optimization challenge

2010-01-12 Thread Albyn Jones
Greg Nice problem: I wasted my whole day on it :-) I was explaining my plan for a solution to a colleague who is a computer scientist, he pointed out that I was trying to re-invent the wheel known as dynamic programming. here is my code, apparently it is called "bottom up dynamic programming".

Re: [R] rotate y axis label and resize its font

2010-01-12 Thread Peter Alspach
Tena koe Elaine Check the information about setting graphics parameters by typing ?par # or help(par) at the R prompt. In particular, check cex.lab, cex.col and las HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.o

[R] rotate y axis label and resize its font

2010-01-12 Thread elaine kuo
Dear , As a newbit to R learning boxplot, please kindly share how to rotate y axis lable by 90 degrees or 180 degrees clockwise. Also, please advise how to resize the label font and change its color. Thank you Elaine [[alternative HTML version deleted]]

Re: [R] some help regarding combining columns from different files

2010-01-12 Thread Simon Knapp
Hi Hari, You have not given examples of 'list1.bp.files.names' or 'list2.bp.files.names' and hence it is difficult to determine what the code is trying to achieve. I will assume you want to create all pairwise merges of the attached files. If this is indeed what you are doing, the problem is not a

[R] FW: Problems connecting with MySQL using odbcDriverConnect (RODBC package) on Linux

2010-01-12 Thread Marcus, Jeffrey
I think I figured this out. I should not have put the Driver name in braces. Changing it from {MySQL} to MySQL seems to work. -Original Message- From: Marcus, Jeffrey Sent: Tuesday, January 12, 2010 6:09 PM To: 'r-help@r-project.org' Subject: Problems connecting with MySQL using odbcDriv

Re: [R] Forming Portfolios for Fama / French Regression

2010-01-12 Thread jude.ryan
Kai, Your question is best addressed to "r-sig-fina...@stat.math.ethz.ch" as it is finance related question. Jude ___ Jude Ryan Director, Client Analytical Services Strategy & Business Development UBS Financial Services Inc. 1200 Harbor Boulevard,

[R] Problems connecting with MySQL using odbcDriverConnect (RODBC package) on Linux

2010-01-12 Thread Marcus, Jeffrey
I am sure I'm doing something wrong here but not sure what. Our system administrator recently installed UnixODBC and the MyODBC driver on a Linux box running Linux version 2.6 x86_64. I have an .odbc.ini file in my home directory with following lines: [mydb] Description = MySQL server on my-se

Re: [R] R for windows 64 bit

2010-01-12 Thread Uwe Ligges
On 12.01.2010 21:07, Alexander Shenkin wrote: Hi Alessia, Note that, while your physical limit might be 6 GB, Windows memory management allows more memory than that to be allocated (aka Virtual Memory, or at least that's what they called it in XP). Windows swaps out memory from RAM to the hard

[R] parsing protocol of states

2010-01-12 Thread Andreas Wittmann
Dear R-users, actually i try to parse some state protocols for my work. i an easy stetting the code below works fine, if states are reached only once. in harder settings it could be possible that one state gets visited more times. in this case for me its interesting to see how much waiting tim

Re: [R] expand.grid game --- never mind, I figured it out!

2010-01-12 Thread Rolf Turner
I re-read the solution that you posted and realized where my thinking was going wrong. Sorry (again!) for being a thicko. cheers, Rolf Turner On 13/01/2010, at 9:19 AM, Greg Snow wrote: How trivial is probably subjective, I don't think it is much above trivial. I w

Re: [R] trouble with installing SJava

2010-01-12 Thread Martin Morgan
Jiiindo wrote: > Colleagues, > How i can solve this error when i install SJava package A more recent version of SJava is available with > source('http://bioconductor.org/biocLite.R') > biocLite('SJava') rJava is an alternative. Martin > Thanks > > R CMD INSTALL -c /usr/lo

[R] Strange behavior when trying to piggyback off of "fitdistr"

2010-01-12 Thread Adler, Avraham
Hello. I am not certain even how to search the archives for this particular question, so if there is an obvious answer, please smack me with a large halibut and send me to the URLs. I have been experimenting with fitting curves by using both maximum likelihood and maximum spacing estimation te

Re: [R] some help regarding combining columns from different files

2010-01-12 Thread Harikrishnadhar
Hi Jim, I am want to merge two files into one file : Here is my code . But the problem with this is that I am getting the 2nd file appended to the first when i write temp3 in my code to the text file. I am not sure what mistake I am doing . also find the test files to run the code . Please help

Re: [R] Drop last numeral

2010-01-12 Thread LCOG1
The Below worked best for my purposes. Thanks everyone. Data<-c("1131", "1132", "1731" ,"1732" ,"1821" ,"1822", "2221" ,"", "2241" ,"2242","414342" ,"414371" ,"414372") substr(Data,1,nchar(Data)-1) LCOG1 wrote: > > Hello all, > Frustrated and i know you can help > > I need to dr

Re: [R] expand.grid game

2010-01-12 Thread Rolf Turner
On 13/01/2010, at 9:19 AM, Greg Snow wrote: How trivial is probably subjective, I don't think it is much above trivial. I would not have been surprised to see this question on an exam in my undergraduate (300 or junior level) probability course (the hard part was remembering the details f

[R] [Solved][Code Snippets] Dropping Empty Regressors

2010-01-12 Thread Idgarad
To make a long story short I was doing some in-sample testing in which some dynamically created regressors would end up either all true or all false based on the validation portion. In my case a new mainframe configuration (this is a crappy way to handle a level shift but I do what I can.) So here

Re: [R] LD50 and SE in GLMM (lmer)

2010-01-12 Thread Linda Bürgi
Thank you very much for the code Bill! I only had to change very few things to make it work for probit and lmer (instead of glmmPQL) and it works perfectly! Here's my code (I had some trouble with the output style glm.dose, so I just have it come out as an ugly list now, which isn't a problem

Re: [R] expand.grid game

2010-01-12 Thread Greg Snow
How trivial is probably subjective, I don't think it is much above trivial. I would not have been surprised to see this question on an exam in my undergraduate (300 or junior level) probability course (the hard part was remembering the details from that class from over 20 years ago). My favori

Re: [R] Making routine faster by using apply instead of for-loop

2010-01-12 Thread Peter Ehlers
Your code is doing too many needless things. The following takes about one second on my slow Vista laptop. n <- 500 mat <- matrix(1:(n*n), n) v <- n:1 z <- 2*1:(n/2) w <- c(z, rev(z)) for(i in seq_len(n)){ for(j in seq_len(n)){ if(v[j] + w[i] <= n)(mat[i,j] <- NA) } } rownames(mat) <- v c

Re: [R] Making routine faster by using apply instead of for-loop

2010-01-12 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Etienne Stockhausen > Sent: Tuesday, January 12, 2010 10:59 AM > To: r-help@r-project.org > Subject: [R] Making routine faster by using apply instead of for-loop > > Hey everybod

Re: [R] Drop last numeral

2010-01-12 Thread Steve Taylor
Try this: substr(Data,1,nchar(Data)-1) Steve >>> From: LCOG1 To: Date: 13/Jan/2010 9:15 a.m. Subject: [R] Drop last numeral Hello all, Frustrated and i know you can help I need to drop the last numeral of each of my values in my data set. So for the following i have tried the ?substri

Re: [R] Drop last numeral

2010-01-12 Thread Greg Snow
In addition to the substring and regular expression solutions, if you are certain that everything will be numeric (and integer as in your examples), then you could just convert to numeric, divide by 10, and then drop the decimal (floor or as.integer). -- Gregory (Greg) L. Snow Ph.D. Statistica

Re: [R] R for windows 64 bit

2010-01-12 Thread Alexander Shenkin
Hi Alessia, Note that, while your physical limit might be 6 GB, Windows memory management allows more memory than that to be allocated (aka Virtual Memory, or at least that's what they called it in XP). Windows swaps out memory from RAM to the hard disk and back when necessary (please excuse the

Re: [R] how to handle missing values "." when importing data in R

2010-01-12 Thread karena
thank you guys. All the columns of my data are numeric. I tried both methods, and they both work. I appreciate your help. -k -- View this message in context: http://n4.nabble.com/how-to-handle-missing-values-when-importing-data-in-R-tp1012298p1012397.html Sent from the R help mailing list arc

Re: [R] Drop last numeral

2010-01-12 Thread Dennis Murphy
Also try sub('[0-9]$', '', Data) [1] "113" "113" "173" "173" "182" "182" "222" "222" "224" [10] "224" "41434" "41437" "41437" HTH, Dennis On Tue, Jan 12, 2010 at 10:36 AM, LCOG1 wrote: > > Hello all, > Frustrated and i know you can help > > I need to drop the last numeral of

Re: [R] Non-metric multidimensional scaling (NMDS) help

2010-01-12 Thread Gavin Simpson
On Tue, 2010-01-12 at 10:28 -0800, kellys17 wrote: > Hi, > > I am currently working on some data and feel that NMDS would return an > excellent result. With my current data set however I have been experiencing > some problems and cannot carry out metaMDS. I have tried with a few smaller > data se

Re: [R] Drop last numeral

2010-01-12 Thread Nutter, Benjamin
Data<-c("1131", "1132", "1731" ,"1732" ,"1821" ,"1822", "2221" ,"", "2241" ,"2242","414342" ,"414371" ,"414372") Bldgid<-substring(as.character(Data),1,nchar(Data)-1) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of LCOG1 Sent: Tu

[R] Drop last numeral

2010-01-12 Thread LCOG1
Hello all, Frustrated and i know you can help I need to drop the last numeral of each of my values in my data set. So for the following i have tried the ?substring but since i have to specify the length, but because my data are of varying lengths it doenst work so well Data<-c("1131", "1132

Re: [R] expand.grid game

2010-01-12 Thread baptiste auguie
Nice --- am I missing something or was this closed form solution not entirely trivial to find? I ought to compile the various clever solutions given in this thread someday, it's fascinating! Thanks, baptiste 2010/1/12 Greg Snow : > This also has a closed form solution: > >> choose(16+8-1,7) - c

Re: [R] The TeX-source for the package manual.

2010-01-12 Thread Rolf Turner
On 13/01/2010, at 3:40 AM, BXC (Bendix Carstensen) wrote: I have noted that the later versions of Rcmd check cleans out the directory pkg.Rcheck so that only package-manual.log and package- manual.pdf are left. Formerly the package-manual.tex was around too --- very handy for various purpos

Re: [R] expand.grid game

2010-01-12 Thread Greg Snow
This also has a closed form solution: > choose(16+8-1,7) - choose(7+8-1, 7) - 7*choose(6+8-1,7) [1] 229713 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailt

Re: [R] how to handle missing values "." when importing data in R

2010-01-12 Thread jim holtman
What is the structure of the data that you are reading in? Are you using 'read.table', 'scan', etc.? Are all the columns numeric, or do you just want to change some of them? If you have used 'na.strings' to cause the values of the missing data to be set to NA, then you can iterate through the ap

[R] Making routine faster by using apply instead of for-loop

2010-01-12 Thread Etienne Stockhausen
Hey everybody, I have a small problem with a routine, which prepares some data for plotting. I've made a small example: c=10 mat=data.frame(matrix(1:(c*c),c,c)) row.names(mat)=seq(c,1,length=c) names(mat)=c(seq(2,c,length=c/2),seq(c,2,length=c/2)) v=as.numeric(row.names(mat)) w

Re: [R] optim: abnormal termination in lnsrch (resend)

2010-01-12 Thread Berend Hasselman
Mario Valle wrote: > > [sorry, forgot some details...] > > I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to > minimize a certain function. > Often the minimization ends with the message: > ERROR: ABNORMAL_TERMINATION_IN_LNSRCH > > What is optim() trying to say? > What hav

[R] post-hoc after ancova

2010-01-12 Thread Mahua Ghara
I have done ancova with categorical and continuous predictor variables. The categorical predictor variable shows significant effect on the dependent variable. I would like to do a post-hoc test to see which groups in the categorical variable differ. I have explored Tukey test in multcomp package.

Re: [R] Conditional Sampling

2010-01-12 Thread Greg Snow
The last 2 lines of your code can be replaced with: M <- replicate(1000, sample(Y,5,replace=FALSE) ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-h

Re: [R] optim: abnormal termination in lnsrch (resend)

2010-01-12 Thread Ravi Varadhan
Mario, It seems likely that your function is not smooth in the parameters. This may create problems for some optimizers that require smoothness. However, I was able to get good convergence with `spg' function in my "BB" package. Here is how it works: > require(BB) Loading required package: B

Re: [R] how to handle missing values "." when importing data in

2010-01-12 Thread Ted Harding
On 12-Jan-10 17:46:47, karena wrote: > hi, I have a question about importing data in R. > > I want to import a file which has missing value in it, and the missing > values are denoted as ".", I want to first read in the file, and then > change the "." into the number zero "0". > > how can I do th

Re: [R] svm

2010-01-12 Thread Amy Hessen
Hi Steve, Thank you so much for your reply. I really needed to know how SVM works without removing the class label while receiving it in the formula parameter. It does not if I remove the class label. Cheers, Amy > Date: Sat, 9 Jan 2010 15:48:49 -0500 > Subject: Re: [R] svm > From: ma

[R] Non-metric multidimensional scaling (NMDS) help

2010-01-12 Thread kellys17
Hi, I am currently working on some data and feel that NMDS would return an excellent result. With my current data set however I have been experiencing some problems and cannot carry out metaMDS. I have tried with a few smaller data sets which I created for practice sake and this has worked fine.

[R] optimization challenge

2010-01-12 Thread Greg Snow
I have a challenge that I want to share with the group. This is not homework (but I may assign it as such if I teach the appropriate class again) and I have found one solution, so don't need anything urgent. This is more for fun to see if others can find a better solution than I did. The chall

Re: [R] how to handle missing values "." when importing data in R

2010-01-12 Thread karena
Hi, tim, thank you very much for the reply, but I am really a new user. How to change all NAs to zero? thanks again. karena jholtman wrote: > > ?read.table > > na.strings='.' > > Then change all NAs to zero df$col[is.na(df$col)] <- 0 > > On Tue, Jan 12, 2010 at 12:46 PM, karena wrote

[R] Calculate the percentages of the "numbers" in every column.

2010-01-12 Thread Kelvin
Dear friends, I have a table like this, I have A B C D ... levels, the first column you see is just the index, and there are different numbers in the table. A B C D ... 10 2 1 0 21 0 2 1 32 3 0 0 40 0 1 0 50 2 3 1 ... I want to calculat

Re: [R] getting p values

2010-01-12 Thread Duncan Murdoch
On 12/01/2010 10:47 AM, Rosario Garcia Gil wrote: Dear colleges I need to get the p values for a table with 15000 entries of t values. Does any of you know how to do it? I can, of course, get one by one but that is not sensible. Put the t values into a vector, then use pt() in an appropria

Re: [R] how to handle missing values "." when importing data in R

2010-01-12 Thread jim holtman
?read.table na.strings='.' Then change all NAs to zero df$col[is.na(df$col)] <- 0 On Tue, Jan 12, 2010 at 12:46 PM, karena wrote: > > hi, I have a question about importing data in R. > > I want to import a file which has missing value in it, and the missing > values are denoted as ".", I w

Re: [R] Functions for QUAIDS and nonlinear SUR?

2010-01-12 Thread Arne Henningsen
On Sat, Jan 9, 2010 at 1:21 AM, Werner W. wrote: > I would like to estimate a quadratic almost ideal demand system in R which is > estimated usually by nonlinear seemingly unrelated regression. But there is no > such function in R yet The "systemfit" package has the function nlsystemfit() for est

[R] how to handle missing values "." when importing data in R

2010-01-12 Thread karena
hi, I have a question about importing data in R. I want to import a file which has missing value in it, and the missing values are denoted as ".", I want to first read in the file, and then change the "." into the number zero "0". how can I do that? thank you, karena -- View this message in c

[R] optim: abnormal termination in lnsrch (resend)

2010-01-12 Thread Mario Valle
Attached a script that reproduces the problem. My function is fold.val() and at the end seems the curve contained in lnsrch.dat is fitted quite well, but optim generates the error. Thanks again! mario - I'm using optim(param, fun, method='L-BFGS-B', lowe

Re: [R] sparseM and kronecker product_R latest version

2010-01-12 Thread alessia matano
I see, now I got it. and thanks for the example with matrix. best alessia 2010/1/12 Martin Maechler : >> "am" == alessia matano >>     on Mon, 11 Jan 2010 16:20:57 +0100 writes: > >    am> Many thanks for it. >    am> However it is strange that when I put the numbers rather than ncol(R)

Re: [R] apply a function down each column

2010-01-12 Thread Peter Ehlers
Laetitia, I was just responding to your comment that "R complains about a syntax error". But I realize now that "2x" would probably cause an "unexpected symbol" error. Here's what I get when I run your loop; what do you get? > for (x in 1:(nrow(dat)-1)) { + a <- as.character(dat[(2x-1),1]) Err

Re: [R] barplot: border color when stacked

2010-01-12 Thread Henrique Dallazuanna
You can edit the barplot function to do this: mybarplot <- function (height, width = 1, space = NULL, names.arg = NULL, legend.text = NULL, beside = FALSE, horiz = FALSE, density = NULL, angle = 45, col = NULL, border = par("fg"), main = NULL, sub = NULL, xlab = NULL, ylab = NULL, xlim

[R] barplot: border color when stacked

2010-01-12 Thread RINNER Heinrich
Dear R-users, I am using R version 2.10.1 under windows. In a barplot, I want to mark one of the bars with a special border color. For example: barplot(c(3, 7, 11), border = c(NA, "red", NA)) But how to do this when the bars are stacked? for example: barplot(matrix(1:6, ncol=3)) # border of seco

[R] getting p values

2010-01-12 Thread Rosario Garcia Gil
Dear colleges I need to get the p values for a table with 15000 entries of t values. Does any of you know how to do it? I can, of course, get one by one but that is not sensible. Thanks Rosario __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Placing eps files from R into Adobe InDesign documents: specifying fontfamily

2010-01-12 Thread dwalcerz
This is a solution I am posting for a problem that others may have. If you want to: 1. Place lattice graphics from R into an Adobe InDesign document, and 2. Use the export as eps function in R to maximize resolution (it is much better than exporting as a metafile or bitmap), and 3. Use long st

Re: [R] optim: abnormal termination in lnsrch (resend)

2010-01-12 Thread Ravi Varadhan
You forgot a lot of details. Can you send us more information about the "fn" and also some minimal code that can reproduce the problem? Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and H

[R] optim: abnormal termination in lnsrch (resend)

2010-01-12 Thread Mario Valle
[sorry, forgot some details...] I'm using optim(param, fun, method='L-BFGS-B', lower=lo, upper=up) to minimize a certain function. Often the minimization ends with the message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH What is optim() trying to say? What have I to change in my function to make the

[R] optim: abnormal termination in lnsrch

2010-01-12 Thread Mario Valle
I'm using optim() to minimize a certain function. Often the minimization ends with the message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH What is optim() trying to say? What have I to change in my function to make the minimization succeed? Do you think using BBoptim() instead of optim() changes anyth

Re: [R] List arguments from data frame columns in formula

2010-01-12 Thread npobedina
Thanks a lot for help! :) I've invented a more complicated way to make it work: f <- as.formula(paste("data.y~", paste( names(data.x), collapse = "+"))) fml<-glm(f, data=data.x,family=binomial) Try this: glm(y ~ ., family = binomial, data = data, ...) -- View this message in context: http:

Re: [R] Conditional Sampling

2010-01-12 Thread ehcpieterse
Thanks Ted, it's exactly what I'm after. Thanks for the help. -- View this message in context: http://n4.nabble.com/Conditional-Sampling-tp1012072p1012180.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

[R] Multiple symbols per single line in a legend

2010-01-12 Thread Primoz PETERLIN
Hello everybody, Is it possible to coax legend() into displaying more than one simbol per line in legend? I have a graph like the one attached to this mail; I would like to reorganize the legend in such a way that the duplicate text would be omitted, i.e., the first line would read "increasing f

[R] problem with bio3d package

2010-01-12 Thread rgfrance
Hello, I have a problem, when I run read.fasta.pdb I get this error: pdb/seq: 1 name: dcluster.1 Error: subscript out of bounds My FASTA file is the sequence of the bovine insuline. Thanks in advance, Rg -- View this message in context: http://n4.nabble.com/problem-with-bio3d-package-tp10121

Re: [R] List arguments from data frame columns in formula

2010-01-12 Thread Gabor Grothendieck
Try this: glm(y ~ ., family = binomial, data = data, ...) On Tue, Jan 12, 2010 at 9:45 AM, npobedina wrote: > > Hi! > I'm trying to run logistic regression on a dataset which is contained in > dataframe "data" ("y" is in the first col, and 28 parameters for the model). > How can I write formula

[R] List arguments from data frame columns in formula

2010-01-12 Thread npobedina
Hi! I'm trying to run logistic regression on a dataset which is contained in dataframe "data" ("y" is in the first col, and 28 parameters for the model). How can I write formula for function `glm` without listing explicitly all 28 paramaters? `glm(data[,1]~data[,2]+data[,3]+data[,4]+...,family=bin

[R] The TeX-source for the package manual.

2010-01-12 Thread BXC (Bendix Carstensen)
I have noted that the later versions of Rcmd check cleans out the directory pkg.Rcheck so that only package-manual.log and package-manual.pdf are left. Formerly the package-manual.tex was around too --- very handy for various purposes. Is there a way to generate the .tex - version of the manual

Re: [R] Conditional Sampling

2010-01-12 Thread Ted Harding
On 12-Jan-10 14:00:24, ehcpieterse wrote: > Thanks Ted, your solution does make perfect sense. > > The only question I still have is that I would like to sample > the remaining 5 observations after I have randomly selected the > first 10. Given the initial 10, I would like to sample the > followin

Re: [R] Solving graph theory problems with R ? (minimum vertex cover)

2010-01-12 Thread Magnus Torfason
On 1/12/2010 12:12 AM, Johannes Hüsing wrote: Tal Galili schrieb: My specific problem is called: Minimum vertex cover for a hypergraph I know nothing about the problem at hand, but on the Wikipedia page it says that the problem can be formulated as an integer linear program. There is an R pack

Re: [R] apply a function down each column

2010-01-12 Thread Laetitia Schmid
Dear Peter, thank you for the suggestion. Unfortunately the star did not help. Did it work for you? For me it seems incomplete somehow. Laetitia From: Peter Ehlers [ehl...@ucalgary.ca] Sent: Tuesday, January 12, 2010 09:54 AM To: Laetitia Schmid Cc: Steve

Re: [R] Conditional Sampling

2010-01-12 Thread Magnus Torfason
Would the following work, or is there a reason why it would not? risk.set <- 1:100 first.10 <- sample(risk.set, 10) remainder <- setdiff(risk.set, first.10) for ( i in 1:1000 ) { next.5 <- sample(remainder, 5) do.something.with(next.5) } Best, Magnus On 1/12/2010 9:00 AM, ehcpiet

Re: [R] sparseM and kronecker product_R latest version

2010-01-12 Thread Martin Maechler
> "am" == alessia matano > on Mon, 11 Jan 2010 16:20:57 +0100 writes: am> Many thanks for it. am> However it is strange that when I put the numbers rather than ncol(R) am> (a matrix with ncol=36698) it worked. Look below >> dim(res2) am> [1] 170471 25822 >> D

Re: [R] Conditional Sampling

2010-01-12 Thread ehcpieterse
Thanks Ted, your solution does make perfect sense. The only question I still have is that I would like to sample the remaining 5 observations after I have randomly selected the first 10. Given the initial 10, I would like to sample the following 5 say 1,000 times to get a simulated conditional sa

Re: [R] Drought Severity Index (DSI)

2010-01-12 Thread Muhammad Rahiz
Thanks Steve! Muhammad Rahiz | Doctoral Student in Regional Climate Modeling Climate Research Laboratory, School of Geography & the Environment Oxford University Centre for the Environment South Parks Road, Oxford, OX1 3QY, United Kingdom Tel: +44 (0)

Re: [R] Drought Severity Index (DSI)

2010-01-12 Thread Steve_Friedman
A few years ago, I work with Stuart Gage who had developed a Heat / Precipitation Index as a measure of drought severity. It works just as well if not better than the Palmer Drought Index. You can find the formula in this only pdf report: Climate Variability in the North Central Region: http:/

[R] trouble with installing SJava

2010-01-12 Thread Jiiindo
Colleagues, How i can solve this error when i install SJava package Thanks R CMD INSTALL -c /usr/local/lib/R/SJava_0.69-0.tar.gz * installing to library ‘/usr/local/lib/R/site-library’ * installing *source* package ‘SJava’ ... checking for java... /usr/lib/jvm/java-6-sun/bin/jav

Re: [R] Conditional Sampling

2010-01-12 Thread Ted Harding
On 12-Jan-10 12:58:13, ehcpieterse wrote: > Hi, > > I am hoping someone can help me with a sampling question. > > I am using the following function to sample 10 unique observations: > x <- sample(1:100, 10, replace=F) > Given the first 10 observations, I need to sample another 5 unique > observat

[R] Pharmacokinetic and pharmacodynamic modeling and simulation

2010-01-12 Thread Dick Verkerk
Pharmacokinetic and pharmacodynamic modeling and simulation By Dr. Jan Freijer March 18, 2010 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 for clinical trial s

Re: [R] Beginer data.frame

2010-01-12 Thread Gabor Grothendieck
See help(grepl) so using built in data frame CO2 this gets rows whose Plant column start with Qn: subset(CO2, grepl("^Qn", Plant)) On Tue, Jan 12, 2010 at 6:17 AM, Jean-Baptiste Combes wrote: > Hello, > > I use R 2.10, and I am new in R (I used to use SAS and lately Stata), I am > using XP. > >

Re: [R] plot ylab on the right

2010-01-12 Thread Mister Vanhalen
It's works perfectly ! ;) Thank you very much !! M & A On Tue, Jan 12, 2010 at 11:56 AM, Jim Lemon wrote: > On 01/12/2010 09:41 PM, Mister Vanhalen wrote: > >> Hello, >> >> I have a graphic and I want to plot the yaxis AND ylab on the right. >> I manage to plot axis on the right with axis(4) bu

[R] Conditional Sampling

2010-01-12 Thread ehcpieterse
Hi, I am hoping someone can help me with a sampling question. I am using the following function to sample 10 unique observations: x <- sample(1:100, 10, replace=F) Given the first 10 observations, I need to sample another 5 unique observations from the remainder. I essentially want to do a Monte

Re: [R] coerce vector into array - change filling sequence

2010-01-12 Thread Stephan Kolassa
Hi, you can permute array dimensions using aperm(): x <- 1 : 24 z <- array(x, dim=c(6,2,2)) y <- aperm(z,perm=c(3,2,1)) y[1,1,] HTH, Stephan Kohleth Chia schrieb: Dear all, When I coerce a vector into a multi dimensional array, I would like R to start filling the array along the last dimen

[R] coerce vector into array - change filling sequence

2010-01-12 Thread Kohleth Chia
Dear all, When I coerce a vector into a multi dimensional array, I would like R to start filling the array along the last dimension, then the 2nd last etc. Let's jump straight into an example. x <- 1 : 24 y <- array(dim=c(2,2,6)) I would like to have: y[1,1,1] = 1 y[1,1,2] = 2 ... y[1,1,6] = 6

[R] time series analys by resting the effect of a covariate

2010-01-12 Thread Simone Santoro
Hi, Does anyone know a way to estimate the existence of a temporal trend (each unit of the sample is a count) by resting the possible effect of a covariate (i.e. climatic factor)? I have periodical counts of several species of waterbirds during the last 13 years and I want to know if, resting

Re: [R] Beginer data.frame

2010-01-12 Thread David Winsemius
On Jan 12, 2010, at 6:17 AM, Jean-Baptiste Combes wrote: Hello, I use R 2.10, and I am new in R (I used to use SAS and lately Stata), I am using XP. I have a data which has a data.frame format called x.df (read from a csv file). I want to take from this data observations for which the

Re: [R] Beginer data.frame

2010-01-12 Thread K. Elo
Hi! Jean-Baptiste Combes wrote: > Hello, > > I use R 2.10, and I am new in R (I used to use SAS and lately Stata), I am > using XP. > > I have a data which has a data.frame format called x.df (read from a csv > file). I want to take from this data observations for which the variable > "Code" sta

Re: [R] Beginer data.frame

2010-01-12 Thread Stephan Kolassa
Hi Jean-Baptiste, two points: 1) Your variable "df" is a *local* variable which you define in your function myfunc(), so it is not known outside myfunc(). When you ask is.data.frame(df), R looks at the global definition of df - which is the density function of the F distribution. To make your

  1   2   >