Re: [R] How to get commands history as a character vector instead of displaying them?

2009-03-30 Thread Yihui Xie
Thanks, Wacek and Romain! Your solutions worked very well in RGui and Rterm in interactive mode. My final purpose was to obtain the file name of the postscript device in Rweb (http://pbil.univ-lyon1.fr/Rweb/); now I found savehistory() would not work because Rweb was non-interactive. I didn't real

Re: [R] Binning

2009-03-30 Thread Gad Abraham
Santosh wrote: Dear useRs... How do you all do binning of an independent variable using R? For example, observations of a dependent variable at times different from a nominal time. Are there any R functions that help with binning? Have a look at ?cut. -- Gad Abraham MEng Student, Dept. CSSE

Re: [R] what is R equivalent of Fortran DOUBLE PRECISION ?

2009-03-30 Thread Steven McKinney
>From the help page for "Foreign" > ?Foreign Numeric vectors in R will be passed as type double * to C (and as double precision to Fortran) Also, see the help page for "double" > ?double R has no single precision data type. All real numbers are stored in double precision format. The f

[R] How to generate natural cubic spline in R?

2009-03-30 Thread minben
Suppose I have two var x and y,now I want to fits a natural cubic spline in x to y,at the same time create new var containing the smoothed values of y. How can I get it? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] How to generate natural cubic spline in R?

2009-03-30 Thread David Winsemius
If one enters: ??"spline" ... You get quite a few matches. The one in the stats functions that probably answers your specific questions is: "splinefun {stats} R Documentation Interpolating Splines Description Perform cubic (or Hermite) spline interpolation of g

Re: [R] two monitors

2009-03-30 Thread Felipe Carrillo
Hi: I use two monitors and I didn't have to do nothing to do what you want done. Try to print an R graph then drag it to the second screen. If that doesn't work, you may need to go to your settings and identify screen one and screen two from the dialog box. Good luck Felipe D. Carrillo Super

[R] To save Trellis Plots on A3 size paper (Portrait and Landscape)

2009-03-30 Thread Debabrata Midya
Dear R users, Thanks in advance. I am Deb, Statistician at NSW Department of Commerce, Sydney. I am using R 2.8.1 on Windows XP. I like to save Trellis Plots on A3 size paper (Portrait and Landscape). Currently, I am using the following command to save a Trellis Plot in pdf [This is an ex

Re: [R] advice for alternative to barchart

2009-03-30 Thread Ted Harding
On 30-Mar-09 23:04:15, kerfuffle wrote: > hi folks, > > I was wondering if anybody could give me some advice. I've created > a stacked barchart, with 'car model' along the x axis, 'number of > cars' along the y axis. There are 45 individuals involved, each of > which can own any number of cars, of

[R] RMySQL compile

2009-03-30 Thread sten...@go.com
I am trying to install RMySQL on OpenSolaris and need to pass some options to configure. Tried the 3 recommended ways of doing it and nothing works, configure cannot find the headers and the libs. I ran configure manually and that worked fine ./configureCC

Re: [R] use R Group SFBA April meeting reminder; video of Feb k

2009-03-30 Thread Rolf Turner
I get to the video screen OK --- there's a large greenish sideways triangle waiting to be clicked on. I do so; there's a message that says it's downloading, with a little progress bar. That seems to complete quite rapidly. Then nothing for a while. Then an error message on the video screen sa

Re: [R] use R Group SFBA April meeting reminder; video of Feb k

2009-03-30 Thread Ted Harding
On 30-Mar-09 23:04:40, Jim Porzak wrote: > Since Sundar beat me to it w/ Firefox 3 test, I checked with IE 7.0 - > works fine for me there also. > > -Jim Interesting! I'm using Iceweasel 2.0.0.19 (Firefox under another name) on Linux. I'll have to check out what blocks it has activated! I put on

Re: [R] Can I read a file into my workspace from Rprofile.site?

2009-03-30 Thread Duncan Murdoch
Elaine Jones wrote: I am running R version 2.8.1 on Windows XP OS. When I launch R, I would like to automatically read a file containing my database connections, user ids, and passwords into my workspace. I tried including this in my Rprofile.site file: ... local({ old <- getOption("defaultPa

[R] Can I read a file into my workspace from Rprofile.site?

2009-03-30 Thread Elaine Jones
I am running R version 2.8.1 on Windows XP OS. When I launch R, I would like to automatically read a file containing my database connections, user ids, and passwords into my workspace. I tried including this in my Rprofile.site file: ... local({ old <- getOption("defaultPackages") options(def

Re: [R] two monitors

2009-03-30 Thread Daniel Viar
Try Edit --> Gui Preferences --> SDI and see if that works. Dan Viar Chesapeake, VA On Mon, Mar 30, 2009 at 5:55 PM, Veerappa Chetty wrote: > Hi, I have set up two monitors. I am using windows XP.  I would like to keep > one window- command line in one monitor and the script and graphs in the >

[R] advice for alternative to barchart

2009-03-30 Thread kerfuffle
hi folks, I was wondering if anybody could give me some advice. I've created a stacked barchart, with 'car model' along the x axis, 'number of cars' along the y axis. There are 45 individuals involved, each of which can own any number of cars, of any model (eg an individual could own two cars o

[R] two monitors

2009-03-30 Thread Veerappa Chetty
Hi, I have set up two monitors. I am using windows XP. I would like to keep one window- command line in one monitor and the script and graphs in the second monitor. How do I set it up? It works for word documents simply by dragging the document. It does not work if I drag and drop the scripts wind

[R] Mapping in R

2009-03-30 Thread Kelsey Scheitlin
Hi, I am looking for a specific mapping capability in R that I can't seem to find, but think exists. I would like to make a border of a map have alternating black and white squares instead of the common latitude and longitude grid. (example: http://www.cccturtle.org/sat_maps/map0bw8.gif). If an

Re: [R] use R Group SFBA April meeting reminder; video of Feb k

2009-03-30 Thread Jim Porzak
Since Sundar beat me to it w/ Firefox 3 test, I checked with IE 7.0 - works fine for me there also. -Jim On Mon, Mar 30, 2009 at 4:00 PM, Sundar Dorai-Raj wrote: > Could be that you have some sort of ad filter in your browser that's > blocking the video? It appears just fine for me in Firefox

Re: [R] ggplot2-geom_text()

2009-03-30 Thread Paul Murrell
Hi Felipe Carrillo wrote: > Hi: I need help with geom_text(). > I would like to count the number of Locations > and put the sum of it right above each bar. > > x <- "Location Lake_dens Fish Pred > Lake1 1.132 1 0.115 > Lake1 0.627 1 0.148 > Lake1 1.324

Re: [R] use R Group SFBA April meeting reminder; video of Feb k

2009-03-30 Thread Sundar Dorai-Raj
Could be that you have some sort of ad filter in your browser that's blocking the video? It appears just fine for me in Firefox 3. On Mon, Mar 30, 2009 at 3:55 PM, Ted Harding wrote: > On 30-Mar-09 22:13:04, Jim Porzak wrote: >> Next week Wednesday evening, April 8th, Mike Driscoll will be talkin

[R] Comparing Points on Two Regression Lines

2009-03-30 Thread AbouEl-Makarim Aboueissa
Dear R users: Suppose I have two different response variables y1, y2 that I regress separately on the different explanatory variables, x1 and x2 respectively. I need to compare points on two regression lines. These are the x and y values for each lines. x1<-c(0.5,1.0,2.5,5.0,10.0) y1<-c(204,4

Re: [R] use R Group SFBA April meeting reminder; video of Feb k

2009-03-30 Thread Ted Harding
On 30-Mar-09 22:13:04, Jim Porzak wrote: > Next week Wednesday evening, April 8th, Mike Driscoll will be talking > about "Building Web Dashboards using R" > see: http://www.meetup.com/R-Users/calendar/9718968/ for details & to > RSVP. > > Also of interest, our member Ron Fredericks has just posted

Re: [R] Comparing Points on Two Regression Lines

2009-03-30 Thread John Fox
Dear Abu, I'm not sure why you're addressing this question to me. It's unclear from your description whether there is one sample with four variables or two independent samples with the same two variables x and y. I'll assume the latter. The formula that you sent appears to assume equal error v

Re: [R] Darker markers for symbols in lattice

2009-03-30 Thread Naomi B. Robbins
Many thanks to Deepayan for providing just what I wanted. I've tried lwd many times and it does not work but lex does the trick. Thanks also to Paul Murrell for his very simple suggestion of using lower case o for an open circle since bold works on letters and to Bert Gunter for suggesting an overp

[R] Help with tm assocation analysis and Rgraphviz installation.

2009-03-30 Thread xinrong lei
Help with tm assocation analysis and Rgraphviz installation. THANK YOU IN ADVANCE Question 1: I saved two txt file in C:\textfile And each txt file contents only one text column, and both have 100 records. I know term “research” occurs 49 times, so I want to find out which other words are

Re: [R] Darker markers for symbols in lattice

2009-03-30 Thread Deepayan Sarkar
On Sun, Mar 29, 2009 at 12:35 PM, Naomi B. Robbins wrote: > In lattice, using the command trellis.par.get for superpose.symbol, plot, > symbol and/or dot.symbol shows that we can specify alpha, cex, col, fill > (for  superpose.symbol and plot.symbol), font, and pch.  Trial and error > shows that t

[R] use R Group SFBA April meeting reminder; video of Feb kickoff

2009-03-30 Thread Jim Porzak
Next week Wednesday evening, April 8th, Mike Driscoll will be talking about "Building Web Dashboards using R" see: http://www.meetup.com/R-Users/calendar/9718968/ for details & to RSVP. Also of interest, our member Ron Fredericks has just posted a well edited video of the February kickoff panel di

[R] Kruskal-Wallis-test: Posthoc-test?

2009-03-30 Thread Rabea Sutter
Hello. We have some questions concerning the statistical analysis of a dataset. We aim to compare the sample means of more than 2 independent samples; the sample sizes are unbalanced. The requirements of normality distribution and variance homogeneity were not met even after transforming the data

Re: [R] ggplot2-geom_text()

2009-03-30 Thread Felipe Carrillo
Thanks Paul, I tried to use ..count.. once but it didn't work. What I realized I was missing 'stat="bin"'. Thanks for your help. --- On Mon, 3/30/09, Paul Murrell wrote: > From: Paul Murrell > Subject: Re: [R] ggplot2-geom_text() > To: mazatlanmex...@yahoo.com > Cc: r-h...@stat.math.ethz.ch

Re: [R] cmprsk- another survival-depedent package causes R crash

2009-03-30 Thread Nguyen Dinh Nguyen
Dear Terry, When I hit cumic function (my saved command, it used to work previously), R was suddenly shut down. Therefore, there is no error message. This happened not only on my PC (window, service pack 3) but also on others from my colleagues. Regards Nguyen Nguyen -Original Message- Fr

Re: [R] Calculating First Occurance by a factor

2009-03-30 Thread hadley wickham
On Mon, Mar 30, 2009 at 2:58 PM, Mike Lawrence wrote: > I discovered Hadley Wickham's "plyr" package last week and have found > it very useful in circumstances like this: > > library(plyr) > > firstfixtime = ddply( >       .data = data >       , .variables = c('Sub','Tr','IA') >       , .fun <- fu

Re: [R] cmprsk- another survival-depedent package causes R crash

2009-03-30 Thread Terry Therneau
> As our package developers discussed about incompatibility between Design and survival packages, I faced another problem with cmprsk- a survival dependent packacge. > The problem is exactly similar to what happened to the Design package that when I just started running cuminc function, R was s

Re: [R] Matrix max by row

2009-03-30 Thread Wacek Kusnierczyk
Bert Gunter wrote: > > Serves me right, I suppose. Timing seems also very dependent on the > dimensions of the matrix. Here's what I got with my inadequate test: > > >> x <- matrix(rnorm(3e5),ncol=3) >> > ## via apply > >> system.time(apply(x,1,max)) >> >user system elapsed

Re: [R] Calculating First Occurance by a factor

2009-03-30 Thread Jason Gullifer
Thank you Mike and Dimitris for your replies. I was able to get Mike's command to work and it does what I want (and fast too!) I hadn't looked into the plyr package at all, but I have seen it load when loading the reshape package. (Another useful package for manipulating data frames!) Thanks agai

Re: [R] Calculating First Occurance by a factor

2009-03-30 Thread Mike Lawrence
I discovered Hadley Wickham's "plyr" package last week and have found it very useful in circumstances like this: library(plyr) firstfixtime = ddply( .data = data , .variables = c('Sub','Tr','IA') , .fun <- function(df){ df$FixTime[which.min(df$FixInx)] }

Re: [R] Calculating First Occurance by a factor

2009-03-30 Thread Dimitris Rizopoulos
one way is: ind <- ave(Data$IA, Data$Sub, Data$Tr, FUN = function (x) !duplicated(x)) Data[as.logical(ind), ] I hope it helps. Best, Dimitris jwg20 wrote: I'm having difficulty finding a solution to my problem that without using a for loop. For the amount of data I (will) have, the for loop

[R] Calculating First Occurance by a factor

2009-03-30 Thread jwg20
I'm having difficulty finding a solution to my problem that without using a for loop. For the amount of data I (will) have, the for loop will probably be too slow. I tried searching around before posting and couldn't find anything, hopefully it's not embarrassingly easy. Consider the data.frame

[R] circular analysis

2009-03-30 Thread Blanka Vlasakova
Hi, I am looking for a way to analyze a dataset with a circular dependent variable and three independent factors. To be specific, the circular variable comprises of arrival times of pollinators to flowers. The independent variables are pollinator species, flower sex and locality. I have failed to f

Re: [R] Mature SOAP Interface for R

2009-03-30 Thread Tobias Verbeke
Michael Lawrence wrote: On Sat, Mar 28, 2009 at 6:08 PM, zubin wrote: Hello, we are writing rich internet user interfaces and like to call R for some of the computational needs on the data, as well as some creation of image files. Our objects communicate via the SOAP interface. We have been

Re: [R] Importing csv file with character values into sqlite3 and subsequent problem in R / RSQLite

2009-03-30 Thread Gabor Grothendieck
There are some examples of reading files into sqlite on the sqldf home page: http://sqldf.googlecode.com On Mon, Mar 30, 2009 at 12:19 PM, Stephan Lindner wrote: > Dear all, > > > I'm trying to import a csv file into sqlite3 and from there into > R. Everything looks fine exepct that R outputs t

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Apparently, the convergence is faster if one uses this new swap function: swapfun <- function(x,N=100) { loc <- c(sample(1:(N/2),size=1,replace=FALSE),sample((N/2):100,1)) tmp <- x[loc[1]] x[loc[1]] <- x[loc[2]] x[loc[2]] <- tmp x } It seems that within 20 millions of iterations, one gets th

[R] ggplot2-geom_text()

2009-03-30 Thread Felipe Carrillo
Hi: I need help with geom_text(). I would like to count the number of Locations and put the sum of it right above each bar. x <- "Location Lake_dens Fish Pred Lake1 1.132 1 0.115 Lake1 0.627 1 0.148 Lake1 1.324 1 0.104 Lake1 1.265

Re: [R] 64 bit compiled version of R on windows

2009-03-30 Thread Duncan Murdoch
On 3/30/2009 12:46 PM, Vadlamani, Satish {FLNA} wrote: Hi: 1) Does anyone have experience with 64 bit compiled version of R on windows? Is this available or one has to compile it oneself? 2) If we do compile the source in 64 bit, would we then need to compile any additional modules also in 64 b

Re: [R] HELP WITH SEM LIBRARY AND WITH THE MODEL'S SPECIFICATION

2009-03-30 Thread John Fox
Dear Costantino, > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Analisi Dati > Sent: March-30-09 11:13 AM > To: r-help@r-project.org > Subject: [R] HELP WITH SEM LIBRARY AND WITH THE MODEL'S SPECIFICATION > > Dear users, > i'

Re: [R] Sliding window over irregular intervals

2009-03-30 Thread Michael Lawrence
On Mon, Mar 30, 2009 at 6:01 AM, Irene Gallego Romero wrote: > Dear all, > > I have some very big data files that look something like this: > > id chr pos ihh1 ihh2 xpehh > rs5748748 22 15795572 0.0230222 0.0268394 -0.153413 > rs5748755 22 15806401 0.0186084 0.0268672 -0.367296 > rs2385785 22 1580

Re: [R] how to input multiple .txt files

2009-03-30 Thread hadley wickham
On Mon, Mar 30, 2009 at 10:33 AM, Mike Lawrence wrote: > To repent for my sins, I'll also suggest that Hadley Wickham's "plyr" > package (http://had.co.nz/plyr/) is also useful/parsimonious in this > context: > > a <- ldply(cust1_files,read.table) You might also want to do names(cust1_files) <-

[R] 64 bit compiled version of R on windows

2009-03-30 Thread Vadlamani, Satish {FLNA}
Hi: 1) Does anyone have experience with 64 bit compiled version of R on windows? Is this available or one has to compile it oneself? 2) If we do compile the source in 64 bit, would we then need to compile any additional modules also in 64 bit? I am just trying to prepare for the time when I will

[R] pgmm (Blundell-Bond) sample needed)

2009-03-30 Thread Millo Giovanni
Dear Ivo, dear list, (see: Message: 70 Date: Thu, 26 Mar 2009 21:39:19 + From: ivo...@gmail.com Subject: [R] pgmm (Blundell-Bond) sample needed) I think I finally figured out how to replicate your supersimple GMM example with pgmm() so as to get the very same results as Stata. Having no other

[R] Importing csv file with character values into sqlite3 and subsequent problem in R / RSQLite

2009-03-30 Thread Stephan Lindner
Dear all, I'm trying to import a csv file into sqlite3 and from there into R. Everything looks fine exepct that R outputs the character values in an odd fashion: they are shown as "\"CHARACTER\"" instead of "CHARACTER", but only if I show the character variable as a vector. Does someone know why

[R] HELP WITH SEM LIBRARY AND WITH THE MODEL'S SPECIFICATION

2009-03-30 Thread Analisi Dati
Dear users, i'm using the sem package in R, because i need to improve a confermative factor analisys. I have so many questions in my survey, and i suppose, for example, that Question 1 (Q1) Q2 and Q3 explain the same thing (factor F1), Q4,Q5 and Q6 explain F2 and Q7 and Q8 explain F3... For ch

[R] NY City Conf for Enthusiastic Users of R, June 18-19, 2009

2009-03-30 Thread HRISHIKESH D. VINOD
Conference on Quantitative Social Science Research Using R June 18-19 (Thursday-Friday), 2009, Fordham University, 113 West 60th Street, New York. (next door to Lincoln Center for Performing Arts). conf. website: http://www.cis.fordham.edu/QR2009 Hrishikesh (Rick) D. Vinod Professor of Economic

[R] Nonparametric analysis of repeated measurements data with sm library

2009-03-30 Thread Alphonse Monkamg
Dear all, Does anybody know how to get more evaluation points in performing Nonparametric analysis of repeated measurements data with "sm" library. The following command gives the estimation for 50 points, by I would like to increase to 100 points But I do not know how to do that. library(sm) pro

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Optim with SANN also solves your example: --- f <- function(x) sum(c(1:50,50:1)*x) swapfun <- function(x,N=100) { loc <- sample(N,size=2,replace=FALSE) tmp <- x[loc[1]] x[loc[1]] <- x[loc[2]] x[loc[2]] <- tmp x } N <- 100 opt1 <- optim(fn=f,par=sam

Re: [R] unicode only works with a second one

2009-03-30 Thread Greg Snow
I don't know how to help with the Unicode issue, but one alternative is the my.symbols function in the TeachingDemos package (see ?ms.male as well as ?my.symbols). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] Mature SOAP Interface for R

2009-03-30 Thread Michael Lawrence
On Sat, Mar 28, 2009 at 6:08 PM, zubin wrote: > Hello, we are writing rich internet user interfaces and like to call R for > some of the computational needs on the data, as well as some creation of > image files. Our objects communicate via the SOAP interface. We have been > researching the var

Re: [R] Column name assignment problem

2009-03-30 Thread Steve Murray
Dear Peter, Jim and all, Thanks for the information regarding how to structure 'assign' commands. I've had a go at doing this, based on your advice, and although I feel I'm a lot closer now, I can't quite get it to work: rnames <- sprintf("%.2f", seq(from = -89.75, to = 89.75, length = 360)) c

Re: [R] how to input multiple .txt files

2009-03-30 Thread Mike Lawrence
To repent for my sins, I'll also suggest that Hadley Wickham's "plyr" package (http://had.co.nz/plyr/) is also useful/parsimonious in this context: a <- ldply(cust1_files,read.table) On Mon, Mar 30, 2009 at 9:32 AM, baptiste auguie wrote: > may i suggest the following, > > > a <- do.call(rbind,

Re: [R] [OT] Contacting "Introductory Statistics for EngineeringExperimentation" authors

2009-03-30 Thread Gaj Vidmar
Two authors appear to be the same as of the book "Analysis of Means" (ANOM), which I read and has a website at http://www.analysisofmeans.com/ If I remember correctly, Mr. Nelson is deceased, but you might nevertheless reach Mrs. Copeland following the Contact Us link at the ANOM website, which

[R] Excellent Talk on Statistics (Good examples of stat. visualization)

2009-03-30 Thread Ken-JP
with very good examples of statistical visualization. "Talks Hans Rosling: Debunking third-world myths with the best stats you've ever seen" http://www.ted.com/index.php/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen.html -- View this message in context: http://www.nabble.com/Excel

Re: [R] (no subject)

2009-03-30 Thread milton ruser
How about you include a thread like "Problem with R 2.3.0 and MySQL on Mandriva-2007". Bests, milton On Mon, Mar 30, 2009 at 7:07 AM, ankhee dutta wrote: > Hi, All > I have a linux system of Mandriva-2007 with R version 2.3.0 and MySQL with > 5.0.0. I have also got DBI-R database interface ve

[R] List assignment in a while loop and timing

2009-03-30 Thread Saptarshi Guha
Hello R users I have question about the time involved in list assignment. Consider the following code snippet(see below). The first line creates a reader object, which is the interface to 1MM key-value pairs (serialized R objects) spanning 50 files (a total of 50MB). rhsqstart initiates the reading

Re: [R] Matrix max by row

2009-03-30 Thread Bert Gunter
Serves me right, I suppose. Timing seems also very dependent on the dimensions of the matrix. Here's what I got with my inadequate test: > x <- matrix(rnorm(3e5),ncol=3) ## via apply > system.time(apply(x,1,max)) user system elapsed 2.090.022.10 ## via pmax > system.time(do.cal

Re: [R] Sliding window over irregular intervals

2009-03-30 Thread David Winsemius
The window you describe is not one I would call sliding and the intervals are regular with an irregular number of events within the windows. One way would be to use the results of trunc(pos/1) as a factor with tapply: (Related functions are floor() and round(), but your pos values appea

[R] Add missing values/timestamps

2009-03-30 Thread j.k
Hello alltogheter, I have the following problem and maybe someone can help me with it. I have a list of values with times. They look like that: V1 V2 1 2008-10-14 08:45:00 94411.08 2 2008-10-14 08:50:00 90745.45 3 2008-10-14 08:55:00 82963.35 4 2008-10-14

[R] [OT] Contacting "Introductory Statistics for Engineering Experimentation" authors

2009-03-30 Thread Douglas Bates
I have been examining the text "Introductory Statistics for Engineering Experimentation" by Peter R. Nelson, Marie Coffin and Karen A.F. Copeland (Elsevier, 2003). There are several interesting data sets used in the book and I plan to create an R package for them. I would like to contact the surv

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
Actually, one can use lpSolve to find a solution to your example. To be more precise, it would be necessary to solve a sequence of linear *integer* programs. The first one would be: max f(x) subject to x >= 0 x <= 100 sum(x) = 100. >From this, one would learn the optimal position of the number

Re: [R] PLS package loading error!

2009-03-30 Thread James W. MacDonald
Hi Damien, How did you install the package? Usually this error pops up when people simply download the zip file and then unzip into their library directory. If you use the package installation functions in R, you shouldn't have this problem: install.packages("pls") Best, Jim mienad wro

Re: [R] Burt table from word frequency list

2009-03-30 Thread Joan-Josep Vallbé
Thank you very much for all your comments, and sorry for the confusion of my messages. My corpus is a collection of responses to an open question from a questionnaire. Since my intention is not to create groups of respondents but to treat all responses as a "whole discourse" on a particular

Re: [R] nls, convergence and starting values

2009-03-30 Thread Christian Ritz
Hi Patrick, there exist specialized functionality in R that offer both automated calculation of starting values and relatively robust optimization, which can be used with success in many common cases of nonlinear regression, also for your data: library(drc) # on CRAN ## Fitting 3-parameter lo

[R] how does stop() interfere with on.exit()?

2009-03-30 Thread Wacek Kusnierczyk
consider the following example: (f = function() on.exit(f()))() # error: evaluation nested too deeply (f = function() { on.exit(f()); stop() })() # error in f(): # error in f(): # ... some 100 lines skipped ... # error: C stack usage is too close to the limit why does

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Hans W. Borchers
Image you want to minimize the following linear function f <- function(x) sum( c(1:50, 50:1) * x / (50*51) ) on the set of all permutations of the numbers 1,..., 100. I wonder how will you do that with lpSolve? I would simply order the coefficients and then sort the numbers 1,...,100 accord

[R] Sliding window over irregular intervals

2009-03-30 Thread Irene Gallego Romero
Dear all, I have some very big data files that look something like this: id chr pos ihh1 ihh2 xpehh rs5748748 22 15795572 0.0230222 0.0268394 -0.153413 rs5748755 22 15806401 0.0186084 0.0268672 -0.367296 rs2385785 22 15807037 0.0198204 0.0186616 0.0602451 rs1981707 22 15809384 0.0299685 0.017676

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Ben Bolker
rkevinbur...@charter.net wrote: > I am sorry but I don't see the connection. with SANN and say 3 > variables one of the steps may increment x[1] by 0.1. Not only is > this a non-discrete integer value but even if I could coerce SANN to > only return discrete integer values for each step in the opti

Re: [R] Column name assignment problem

2009-03-30 Thread Peter Dalgaard
Steve Murray wrote: > Dear all, > > Apologies for yet another question (!). Hopefully it won't be too tricky to > solve. I am attempting to add row and column names (these are in fact > numbers) to each of the tables created by the code (120 in total). > > > # Create index of file names > file

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
I do not really understand your argument regarding the non-linearity of f. Perhaps, it would help us a lot if you defined concretely your objective function or gave us a minimal example fully detailed and defined. Paul On Mon, Mar 30, 2009 at 1:16 PM, wrote: > It would in the stictess sense be

Re: [R] which rows are duplicates?

2009-03-30 Thread Wacek Kusnierczyk
Michael Dewey wrote: > At 05:07 30/03/2009, Aaron M. Swoboda wrote: >> I would like to know which rows are duplicates of each other, not >> simply that a row is duplicate of another row. In the following >> example rows 1 and 3 are duplicates. >> >> > x <- c(1,3,1) >> > y <- c(2,4,2) >> > z <- c(3,

Re: [R] how to input multiple .txt files

2009-03-30 Thread baptiste auguie
may i suggest the following, a <- do.call(rbind, lapply(cust1_files, read.table)) (i believe expanding objects in a for loop belong to the R Inferno) baptiste On 30 Mar 2009, at 12:58, Mike Lawrence wrote: cust1_files = list.files(path=path_to_my_files,pattern='cust1',full.names=TRUE) a

Re: [R] Column name assignment problem

2009-03-30 Thread Steve Murray
Dear all, Apologies for yet another question (!). Hopefully it won't be too tricky to solve. I am attempting to add row and column names (these are in fact numbers) to each of the tables created by the code (120 in total). # Create index of file names files <- print(ls()[1:120], quote=FALSE)

Re: [R] Constrined dependent optimization.

2009-03-30 Thread rkevinburton
It would in the stictess sense be non-linear since it is only defined for descrete interface values for each variable. And in general it would be non-linear anyway. If I only have three variables which can take on values 1,2,3 then f(1,2,3) could equal 0 and f(2,1,3) could equal 10. Thank you f

[R] Burt table from word frequency list

2009-03-30 Thread Alan Zaslavsky
Maybe not terribly hard, depending on exactly what you need. Suppose you turn your text into a character vector 'mytext' of words. Then for a table of words appearing delta words apart (ordered), you can table mytext against itself with a lag: nwords=length(mytext) burttab=table(mytext[-(1:d

Re: [R] how to input multiple .txt files

2009-03-30 Thread Mike Lawrence
oops, didn't read the question fully. If you want to create 2 master files: cust1_files = list.files(path=path_to_my_files,pattern='cust1',full.names=TRUE) a=NULL for(this_file in cust1_files){ a=rbind(a,read.table(this_file)) } write.table(a,'cust1.master.txt') cust2_files = list.files(pa

[R] Wrong path to user defined library for the R Help Files

2009-03-30 Thread Breitbach, Nils
Dear R-Community, since I work on a PC at the University I have not the necessary rights for all devices and therefore my library is located on a net device. The installation process worked and everything is right apart from one little thing - the help files. When I try to search with the funct

Re: [R] how to input multiple .txt files

2009-03-30 Thread Mike Lawrence
my_files = list.files(path=path_to_my_files,pattern='.txt',full.names=TRUE) a=NULL for(this_file in my_files){ a=rbind(a,read.table(this_file)) } write.table(a,my_new_file_name) On Sun, Mar 29, 2009 at 10:37 PM, Qianfeng Li wrote: > > > how to input multiple .txt files? > > A data fol

[R] (no subject)

2009-03-30 Thread ankhee dutta
Hi, All I have a linux system of Mandriva-2007 with R version 2.3.0 and MySQL with 5.0.0. I have also got DBI-R database interface version-0.1-11 installed on my Linux system.While installing RMySQL package version 0.5-11 but facing the problem mentioned below . * Installing *source* package 'R

[R] (no subject)

2009-03-30 Thread ankhee dutta
Hi, All I have a linux system of Mandriva-2007 with R version 2.3.0 and MySQL with 5.0.0. I have also got DBI-R database interface version-0.1-11 installed on my Linux system.While installing RMySQL package version 0.5-11 but facing the problem mentioned below . * Installing *source* package 'R

[R] PLS package loading error!

2009-03-30 Thread mienad
Hi, I am using R 2.8.1 version on Windows with RGui. I have loaded pls package lattest version (2.1-0). When I try to load this package in R using library(pls) command, the following error message appear: Erreur dans library(pls) : 'pls' n'est pas un package valide -- a-t-il été installé < 2

Re: [R] which rows are duplicates?

2009-03-30 Thread Michael Dewey
At 05:07 30/03/2009, Aaron M. Swoboda wrote: I would like to know which rows are duplicates of each other, not simply that a row is duplicate of another row. In the following example rows 1 and 3 are duplicates. > x <- c(1,3,1) > y <- c(2,4,2) > z <- c(3,4,3) > data <- data.frame(x,y,z) x y

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
On Sun, Mar 29, 2009 at 9:45 PM, wrote: > I have an optimization question that I was hoping to get some suggestions on > how best to go about sovling it. I would think there is probably a package > that addresses this problem. > > This is an ordering optimzation problem. Best to describe it wit

Re: [R] interpreting "not defined because of singularities" in lm

2009-03-30 Thread Duncan Murdoch
jibleriz...@yahoo.com wrote: I run lm to fit an OLS model where one of the covariates is a factor with 30 levels. I use contr.treatment() to set the base level of the factor, so when I run lm() no coefficients are estimated for that level. But in addition (and regardless of which level I choos

Re: [R] Column name assignment problem

2009-03-30 Thread Steve Murray
Jim and all, Thanks - I managed to get it working based on your helpful advice. I'm now trying to do something very similar which simply involves changing the names of the variables in column 1 to make them more succinct. I'm trying to do this via the 'levels' command as I figured that I might

[R] what is R equivalent of Fortran DOUBLE PRECISION ?

2009-03-30 Thread mauede
I noticed taht R cannot understand certain Fortran real constant formats. For instance: c14<- as.double( 7.785205408500864D-02) Error: unexpected symbol in " c14<- as.double( 7.785205408500864D" The above "D" is used in Fortran language to indicate the memory starage mode. That is for

Re: [R] "[.data.frame" and lapply

2009-03-30 Thread Wacek Kusnierczyk
> Bert Gunter wrote: > >> "Note that these operations do not match their index arguments in the >> standard way: argument names are ignored and positional matching only is >> used. So m[j=2,i=1] is equivalent to m[2,1] and not to m[1,2]. " >> >> ## Note that the next lines immediately following

Re: [R] "[.data.frame" and lapply

2009-03-30 Thread Wacek Kusnierczyk
Bert Gunter wrote: > Folks: > > I do not wish to agree or disagree with the criticisms of either the speed > or possible design flaws of "[". But let's at least see what the docs say > about the issues, using the simple example you provided: > > > m = matrix(1:9, 3, 3) > md = data.frame(m)

Re: [R] Matrix max by row

2009-03-30 Thread Wacek Kusnierczyk
Rolf Turner wrote: > I tried the following: > > m <- matrix(runif(10),1000,100) > junk <- gc() > print(system.time(for(i in 1:100) X1 <- do.call(pmax,data.frame(m > junk <- gc() > print(system.time(for(i in 1:100) X2 <- apply(m,1,max))) > > and got > >user system elapsed > 2.704 0.

Re: [R] [cluster package question] What is the "sum of the dissimilarities" in the pam command ?

2009-03-30 Thread Martin Maechler
> "TG" == Tal Galili > on Sun, 29 Mar 2009 03:09:17 +0300 writes: TG> Hello Martin Maechler and All, TG> A simple question (I hope): TG> How can I compute the "sum of the dissimilarities" that appears in the pam TG> command (from the cluster package) ? TG> Is it

[R] Odp: How to generate a new column according to some rule?

2009-03-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 30.03.2009 05:17:35: > In a data frame I have a column "date" and a column "time",now I want > to generate a new column which is the mean of the value of time group > by date. In stata the command is > > egen scalls = mean(time),by(date) > > but I don'

Re: [R] adding matrices with common column names

2009-03-30 Thread Murali.MENON
Benjamin, Dimitris, Thanks very much. Neat work! Murali -Original Message- From: Nutter, Benjamin [mailto:nutt...@ccf.org] Sent: 27 March 2009 13:52 To: MENON Murali; r-help@r-project.org Subject: RE: [R] adding matrices with common column names Shucks, Dimitris beat me to it. And his c

[R] Retrieving the context

2009-03-30 Thread Fredrik Karlsson
Dear list, I have a general problem that I really don't know how to solve efficiently in R. Lets say we have a sequence of things, like for instance a string of words, that is stored in a file. We need all the words in a table format, so therefore we create an id for the word, that links the word

[R] Self Organizing Map

2009-03-30 Thread glaporta
Dear list, I really appreciate previous suggestion about self organizing map. I tried to perform SOM analyses with kohonen, som and class packages, but it's not clear to me if these packages are complete to: 1) cluster neurons according to their similarities (U-matrix); 2) assign to SOM neurons va

Re: [R] Warning messages in Splancs package :: no non-missing arguments to min; returning Inf

2009-03-30 Thread Barry Rowlingson
On Mon, Mar 30, 2009 at 7:12 AM, D wrote: > Hi, > > I would need some help with the splans package in R. > > I am using a Shapefile (downloadable at) > http://rapidshare.com/files/215206891/Redlands_Crime.zip > > and the following execution code > > > setwd("C:\\Documents and > Settings\\Dejan\\De

  1   2   >