[R] choose.dir() gone?

2010-09-07 Thread Johannes Graumann
Hi, I fail to find "choose.dir()" in my current R install (see below)? Didn't that exist at some point? How to achieve "file.choose()" equivalent functionality for directories? Thanks for any hints, Joh > sessionInfo() R version 2.11.1 (2010-05-31) x86_64-pc-linux-gnu locale: [1] LC_CTYPE=

Re: [R] Uncompressing data from read.socket

2010-09-07 Thread Dieter Menne
raje...@cse.iitm.ac.in wrote: > > Is it possible to uncompress gzipped data coming over a socket? > As far I remember a message by Brian Ripley (I could not find it, though), it's not possible directly. You have to save as a file and read from disk; see docs on "connection". Dieter -- Vie

Re: [R] how do I transform this to a for loop

2010-09-07 Thread Setlhare Lekgatlhamang
Hi Bill, There is a problem with the for loop. When I copied and pasted in my R console it could not run, instead I got an error message "Error in NCOL(x) : object 'data.ts' not found". Lexi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Be

[R] bigmemory doubt

2010-09-07 Thread raje...@cse.iitm.ac.in
Hi, Is it possible for me to read data from shared memory created by a vc++ program into R using bigmemory? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] Uncompressing data from read.socket

2010-09-07 Thread raje...@cse.iitm.ac.in
Hi, Is it possible to uncompress gzipped data coming over a socket? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.or

Re: [R] problem with max in a function

2010-09-07 Thread Nikhil Kaza
Comments below On Sep 7, 2010, at 9:37 PM, stephen sefick wrote: Here is a striped down example that is not working because of the 1.00 to 1. Any help would be greatly appreciated. measure_bkf <- (structure(list(measurment_num = c(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.2, 2.4

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread Oliver Soong
Thanks, Duncan, for the pointer in the right direction. I didn't realize cmd's treatment of quotes was so odd. For the curious, the quote behavior of cmd (under XP) is here, in the Remarks under Processing quotation marks: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/

Re: [R] dataframe selection using a multi-value key

2010-09-07 Thread Markus Weisner
Hi Erik and Jim. Both solutions did the trick. Thanks you!! --Markus On Tue, Sep 7, 2010 at 9:05 PM, jim holtman wrote: > try this: > > > merged_data = merge(incidents, responses, by=c("INC_NO", "INC_YEAR"), > all=TRUE) > > # responses that don't match > > subset(merged_data, is.na(INC_TYPE),

Re: [R] problem with max in a function

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 10:05 PM, stephen sefick wrote: I'm sorry. In the bkf_max <- grep(max(measure_bkf_not_zero[,"bankfull_depths_m"]), measure_bkf_not_zero[,"bankfull_depths_m"]) it is giving the indexes for 1 5 10 15 16 And it was supposed to yield ... what? I think this is because grep

Re: [R] problem with max in a function

2010-09-07 Thread stephen sefick
I'm sorry. In the bkf_max <- grep(max(measure_bkf_not_zero[,"bankfull_depths_m"]), measure_bkf_not_zero[,"bankfull_depths_m"]) it is giving the indexes for 1 5 10 15 16 I think this is because grep encounters a 1 with either 0. or nothing in front of it. I would like to find the max and then t

Re: [R] how to you output a vector to a column in excel?

2010-09-07 Thread Jorge Ivan Velez
Try vector <- c(1,2,3,4) write.table(data.frame(vector), "example.xls", col.names = TRUE, row.names = FALSE) See ?write.table for more information. HTH, Jorge On Tue, Sep 7, 2010 at 5:33 PM, lord12 <> wrote: > > What is the syntax for this? > > If you have: vector = c(1,2,3,4), how would you

Re: [R] problem with max in a function

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 9:37 PM, stephen sefick wrote: Here is a striped down example that is not working That dreadful phrase... "is not working". When the ESP package comes to fruition, life will be so easy. Until then ... the English language is necessary. Where am we supposed to be looking

Re: [R] R time series analysis

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 9:33 PM, David Winsemius wrote: On Sep 7, 2010, at 7:51 PM, lord12 wrote: For each arima model, can you output an associated confidence interval for the predicted value at each time point? ?arima0 arima0 will return "... a list with components "pred", the predicti

Re: [R] problem with max in a function

2010-09-07 Thread stephen sefick
Here is a striped down example that is not working because of the 1.00 to 1. Any help would be greatly appreciated. measure_bkf <- (structure(list(measurment_num = c(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.2, 2.4, 2.6, 2.8), bankfull_depths_m = c(-0.15, -0.09, -0.00998

Re: [R] multiple graphs

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 8:02 PM, moleps wrote: Dear all, I´m trying to create multiple graphs on the same page, but they are all stacked on top of each other. My code: par(mfrow=c(2,2)) a<-list(levels(bar$h.r)[c(1,3,6)]) print(a) lapply(a,function(x){ a<-subset(bar,h.r==x) wi

Re: [R] R time series analysis

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 7:51 PM, lord12 wrote: For each arima model, can you output an associated confidence interval for the predicted value at each time point? ?arima0 arima0 will return "... a list with components "pred", the predictions, and "se", the estimated standard errors" as time

Re: [R] problem with max in a function

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 9:06 PM, stephen sefick wrote: s <- 1.00 max(s) > sprintf("%.2f", max(s)) [1] "1.00" @ as a string/character object returns 1 is there anyway that I can get it to return 1.00. I am using the results of this max statement in a grep statement and it returns the wrong

[R] multiple graphs

2010-09-07 Thread moleps
Dear all, I´m trying to create multiple graphs on the same page, but they are all stacked on top of each other. My code: par(mfrow=c(2,2)) a<-list(levels(bar$h.r)[c(1,3,6)]) print(a) lapply(a,function(x){ a<-subset(bar,h.r==x) with(a,cdplot(wh~Age,ylab=x)) #plot.new()

Re: [R] R time series analysis

2010-09-07 Thread lord12
For each arima model, can you output an associated confidence interval for the predicted value at each time point? -- View this message in context: http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2530595.html Sent from the R help mailing list archive at Nabble.com. _

[R] problem with max in a function

2010-09-07 Thread stephen sefick
s <- 1.00 max(s) returns 1 is there anyway that I can get it to return 1.00. I am using the results of this max statement in a grep statement and it returns the wrong numbers, I will provide more information and code if it would make more sense in context. -- Stephen Sefick __

Re: [R] dataframe selection using a multi-value key

2010-09-07 Thread jim holtman
try this: > merged_data = merge(incidents, responses, by=c("INC_NO", "INC_YEAR"), > all=TRUE) > # responses that don't match > subset(merged_data, is.na(INC_TYPE), select=c(INC_NO, INC_YEAR, UNIT_TYPE)) INC_NO INC_YEAR UNIT_TYPE 11 8 2018E3 12 8 2018E7 13

Re: [R] dataframe selection using a multi-value key

2010-09-07 Thread Erik Iverson
Hello, On 09/07/2010 07:25 PM, Markus Weisner wrote: I am merging two dataframes using a relational key (incident number and incident year), but not all the records match up. I want to be able to review only the records that cannot be merged for each individual dataframe (essentially trying to

Re: [R] anova of glm output

2010-09-07 Thread Peng, C
The ANOVA adds the factors only in the order given in the model formula from left to right. You may try drop1(out, test="Chisq") -- View this message in context: http://r.789695.n4.nabble.com/anova-of-glm-output-tp2528336p2530620.html Sent from the R help mailing list archive at Nabble.com.

[R] dataframe selection using a multi-value key

2010-09-07 Thread Markus Weisner
I am merging two dataframes using a relational key (incident number and incident year), but not all the records match up. I want to be able to review only the records that cannot be merged for each individual dataframe (essentially trying to select records from one dataframe using a multi-value re

Re: [R] PostScript/PDF graphics with another font

2010-09-07 Thread Paul Murrell
Hi On 7/09/2010 9:00 a.m., Peter wrote: I am using the standard phonetic font "Doulos SIL" in a graph (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=DoulosSILfont) This is an example: windowsFonts(IPA="TT Doulos SIL") barplot(c(1,2,3,4,5),names=c("\u{0251}","\u{0252}","\u{0253}"

Re: [R] change the for loops with lapply

2010-09-07 Thread Changbin Du
Thanks so much, David! The following codes works! result.fun <- lapply(1:2, function(i) cv.fold(i, 3, 0.3)) On Tue, Sep 7, 2010 at 3:35 PM, David Winsemius wrote: > > On Sep 7, 2010, at 5:43 PM, Changbin Du wrote: > > cv.fold<-function(i, size=3, rang=0.3){ >> cat('Fold ', i, '\n') >>

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Oliver Soong > Sent: Tuesday, September 07, 2010 2:01 PM > To: R-lists > Subject: [R] R 2.11, shell, spaces > > Can somebody confirm some unexpected behavior? This is under Wind

Re: [R] repeated measurements ANOVA

2010-09-07 Thread Peng, C
You can find the layout of data for repeated measuremnt ANOVA in examples from UCLA computing page: http://www.ats.ucla.edu/stat/R/seminars/Repeated_Measures/repeated_measures.htm -- View this message in context: http://r.789695.n4.nabble.com/repeated-measurements-ANOVA-tp2530368p2530600.html S

Re: [R] likelyhood maximization problem with polr

2010-09-07 Thread Peng, C
If you can prove that the Fisher information matrix is positive definite, the resulting estimate is MLE. Otherwise you can only claim it a local MLE (the Hessian matrix at the estimate is negative definite). -- View this message in context: http://r.789695.n4.nabble.com/likelyhood-maximiza

Re: [R] how to you output a vector to a column in excel?

2010-09-07 Thread Joshua Wiley
Hi, What *exactly* do you mean when you say "output"? You can write the vector to a .csv file which can easily be read by Excel using write.csv() or more generally write.table() with the appropriate arguments. There is no way (that I know of) in base R to write .xls or .xlsx files, but you can u

[R] Imputation Simulation using MICE

2010-09-07 Thread kungfukid
Hi all, I wish to use the mice package but before that, I tried a simulation to test it: #Generate the complete data matrix X with 2 variables, 1 observations Xcomplete=mvrnorm(1,mu=c(0,0),Sigma=matrix(c(1,0.5,0.5,1),ncol=2)) Error=rnorm(1,0,1) #Create Y as X+Error Y=Xcomplete%*%c(1,

[R] how to you output a vector to a column in excel?

2010-09-07 Thread lord12
What is the syntax for this? If you have: vector = c(1,2,3,4), how would you output this to column A of an excel spreadsheet? -- View this message in context: http://r.789695.n4.nabble.com/how-to-you-output-a-vector-to-a-column-in-excel-tp2530470p2530470.html Sent from the R help mailing list a

[R] problems with siar package

2010-09-07 Thread Julio Lucio Lancelotti
Hi, my name is Julio, I'm trying to run a script, specifically with the siar package on R (I have attached the script) but the program collapses on during the run. The error message says: *** caught segfault *** address 0xb31941cc, cause 'memory not mapped' Traceback: 1: .C("siarmcmcv4", as.i

Re: [R] likelyhood maximization problem with polr

2010-09-07 Thread blackscorpio
Thanks a lot for your answer ! I had already tried to initialize the algorithm with a null vector by setting start=rep(0,6) or a random vector with start=runif(6), and I nearly found the same results as yours. But I am wondering if the solution obtained in this case wouldn't be too far from the b

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread Duncan Murdoch
On 07/09/2010 5:01 PM, Oliver Soong wrote: Can somebody confirm some unexpected behavior? This is under Windows, with R 2.11.0 and 2.11.1. 1. Create a trivial test file (I called it test.R) containing: cat("Success.\n") 2. Load R (Gui or Term) and run: shell("\"C:\\path\\to\\Rscript.exe\" \"C:\

Re: [R] queue implementation?

2010-09-07 Thread Barry Rowlingson
If anyone still wants a queue implementation, I've tidied up my code and added some docs in the file. Info here: http://www.maths.lancs.ac.uk/~rowlings/R/Queue/ Not a package, but a single R file with a few functions in it. If anyone wants to put it in a package, go ahead. Barry __

Re: [R] change the for loops with lapply

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 5:43 PM, Changbin Du wrote: cv.fold<-function(i, size=3, rang=0.3){ cat('Fold ', i, '\n') out.fold.c <-((i-1)*c.each.part +1):(i*c.each.part) out.fold.n <-((i-1)*n.each.part +1):(i*n.each.part) train.cv <- n.cc[-out.fold.c, c(2:2401, 2417)] train

Re: [R] some questions about longitudinal study with baseline

2010-09-07 Thread Frank Harrell
Baseline should appear only as a baseline and should be removed from the set of longitudinal responses. This is often done with a merge( ) operation. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt Unive

[R] Multivariate Regression Trees: how to identify sample units?

2010-09-07 Thread afsouza
Dear friends, I am sudying the mvpart package, that implements Multivariate Regression Trees, aiming at applying it to a biogeographical dataset of tree speces in southern South America. My doubt is how to access plot identities after the tree is produced. For us it is rather important, b

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread Jeff Newmiller
Alternatively, you can surround the path-with-program-file-name in double quotes. "RICHARD M. HEIBERGER" wrote: >On Windows, use the 8.3 name for file and directory names that have >embedded blanks. > >You can discover the 8.3 name directly from R. > >> system(paste(Sys.getenv("COMSPEC"),"/c",

[R] change the for loops with lapply

2010-09-07 Thread Changbin Du
cv.fold<-function(i, size=3, rang=0.3){ cat('Fold ', i, '\n') out.fold.c <-((i-1)*c.each.part +1):(i*c.each.part) out.fold.n <-((i-1)*n.each.part +1):(i*n.each.part) train.cv <- n.cc[-out.fold.c, c(2:2401, 2417)] train.nv <- n.nn[-out.fold.n, c(2:2401, 2417)]

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread RICHARD M. HEIBERGER
Also, see R for Windows FAQ 2.16 R can't find my file, but I know it is there! On Tue, Sep 7, 2010 at 5:01 PM, Oliver Soong wrote: > Can somebody confirm some unexpected behavior?  This is under Windows, > with R 2.11.0 and 2.11.1. __ R-help@r-project

Re: [R] R 2.11, shell, spaces

2010-09-07 Thread RICHARD M. HEIBERGER
On Windows, use the 8.3 name for file and directory names that have embedded blanks. You can discover the 8.3 name directly from R. > system(paste(Sys.getenv("COMSPEC"),"/c", "dir/x c:\\pr*")) Volume in drive C has no label. Volume Serial Number is B869-26CD Directory of c:\ 02/12/2010 03:5

Re: [R] RandomForests Limitations? Work Arounds?

2010-09-07 Thread Liaw, Andy
You're not giving us much to go on, so the info I can give is correspondingly vague. I take it you are using RF in "unsupervised" mode. What RF does in this case is simply generate a second part of the data that have the same marginal distribution as the data you have, but the variables are indep

[R] R 2.11, shell, spaces

2010-09-07 Thread Oliver Soong
Can somebody confirm some unexpected behavior? This is under Windows, with R 2.11.0 and 2.11.1. 1. Create a trivial test file (I called it test.R) containing: cat("Success.\n") 2. Load R (Gui or Term) and run: shell("\"C:\\path\\to\\Rscript.exe\" \"C:\\path\\to\\test.R\"") In my case, I get vari

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread Johann Hibschman
Duncan Murdoch writes: > On 07/09/2010 4:18 PM, Johann Hibschman wrote: >> Going through that code, I settled on the following function to remove >> all but the most needed components: >> >> ## Strip down a glm object, until it can only be used for prediction, >> ## but is nice and small.

[R] trouble with XML

2010-09-07 Thread Erin Hodgess
Dear R People: I'm trying to install ctv (I'm working through the Bivand et al book) But I'm running into a problem: > install.packages("ctv",depen=TRUE) --- Please select a CRAN mirror for use in this session --- also installing the dependency ‘XML’ trying URL 'http://streaming.stat.iastate.e

Re: [R] repeated measurements ANOVA

2010-09-07 Thread Stephan Kolassa
Hi Alex, I'm slightly unclear as to why you would want to restructure your nice six-column data.frame (why six? One column for the data and four for the factors should make five, shouldn't it? I guess you have a subject ID in one column?) into some monstrosity which I assume you would fill wit

Re: [R] Help with decimal points

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 4:38 PM, Amit Patel wrote: I have found a little problem with an R script. I am trying to merge some data and am finding something unusual going on. As shown below I am trying to assign (MatchedValues[Value2,Value]) to (ClusteredData[k,Value]) which are two separate da

Re: [R] Help with decimal points

2010-09-07 Thread Ista Zahn
Hi Amit, MatchedValues$Value is a factor. Converting factors to numeric is a FAQ: see http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f Best, Ista On Tue, Sep 7, 2010 at 4:38 PM, Amit Patel wrote: > Hi > > > I have found a little problem with an R script. I a

Re: [R] Help with decimal points

2010-09-07 Thread Sarah Goslee
MatchedValues is a factor rather than numeric, and so is giving you results you don't expect. "4420" is the level of the factor, out of the 6618 total levels. Probably the best thing to do is figure out why your data are factors when you expect numbers. Sarah On Tue, Sep 7, 2010 at 4:38 PM, Amit

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread Duncan Murdoch
On 07/09/2010 4:18 PM, Johann Hibschman wrote: David Winsemius writes: > Just tested my theory and it seems to be holding up. Took the example > on the predict help page, set three of the variable length components > not needed in the predict operations to NULL and the code still runs > fi

[R] Help with decimal points

2010-09-07 Thread Amit Patel
Hi I have found a little problem with an R script. I am trying to merge some data and am finding something unusual going on. As shown below I am trying to assign (MatchedValues[Value2,Value]) to (ClusteredData[k,Value]) which are two separate dataframes. 1) By the following command you can s

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread Johann Hibschman
David Winsemius writes: > Just tested my theory and it seems to be holding up. Took the example > on the predict help page, set three of the variable length components > not needed in the predict operations to NULL and the code still runs > fine. It does not appear that either predict.glm or pred

[R] Res: Re: Package wavelets

2010-09-07 Thread Marize Simões
Hi, In the decomposition of the dwt When I generate the out their levels goes of the 0 to 15 in the decompositions And i like to known how i do to visualise In the out the most concern levels for me for exemple levels 7 to 14. I like to can say what levels I want visualise. Is it possible

[R] RandomForests Limitations? Work Arounds?

2010-09-07 Thread Michael Lindgren
Greetings, I want to inquire about the memory limitations of the randomForest package. I am attempting to perform clustering analysis using RF but I keep getting the message that RF cannot allocate a vector of a given size. I am currently using the 32-bit version of R to run this analysis, are

[R] repeated measurements ANOVA

2010-09-07 Thread Walther, Alexander
Dear list, i am setting up a GLM for a repeated measurement ANOVA using the lm and ANOVA function. my design contains four factors with 5, 5, 2 and 2 (= 14) levels, respectively. the data are stored in a data.frame with six columns, one for the data themselves and the remainings for the factor

[R] Question About rscaleUsage in Bayesm

2010-09-07 Thread Ziad.Elmously
To Whom It May Concern, In using the Bayesm package titled "rscaleUsage," it does not reports "mudraw," "taudramw," "sigmadraw," "Lambdadraw," and "edraw." However, it does not report the transformed y ratings or latent z scores. Is there any way to infer the value for y and z? Ziad

Re: [R] Something similar to layout in lattice or ggplot

2010-09-07 Thread Abhijit Dasgupta, PhD
Thank you all for the suggestions. They have all been immensely helpful. Abhijit On 9/7/10 10:44 AM, ONKELINX, Thierry wrote: Dear Abhijit, In ggplot you can use facetting (facet_grid() or facet_wrap()) to create subplot based on the same dataset. Or you can work with viewport() if you want s

[R] adding variable to netCDF file

2010-09-07 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
I would like to open an existing netCDF file and add a variable to it. I am using the ncdf package. This test code gives the idea of what I am trying to do: library(ncdf) print('here we go') print('first, construct netCDF file') t<-dim.def.ncdf('t','',1:1,unlim=T,create_dimvar=F) print('definin

Re: [R] question on "optim"

2010-09-07 Thread Ben Bolker
On 10-09-07 02:48 PM, Hey Sky wrote: > thanks. Ben > > after read your email, I realized the initial value of w[5]=0 is a > stupid mistake. and I have changed it. but I am sorry I cannot > reproduce the result, convergence, as you get. the error message is > . any suggestion about > it? When I

Re: [R] How to run R on Emacs+ESS

2010-09-07 Thread Duke
On 9/6/10 12:18 PM, Stephen Liu wrote: Hi folks, Debian 504 64-bit I found following document; http://www.biostat.wisc.edu/~kbroman/Rintro/ Whether it is the right document for installing Emacs+ESS and R so that R can run on Emacs? A lot on the web. Google gave me for example: http://www.u

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 3:16 PM, David Winsemius wrote: On Sep 7, 2010, at 2:53 PM, Johann Hibschman wrote: David Winsemius writes: On Sep 7, 2010, at 11:02 AM, Johann Hibschman wrote: Even so, I would prefer to only save the coefficients Have you read through the Value section of glm's hel

Re: [R] some questions about longitudinal study with baseline

2010-09-07 Thread Peng, C
You may be interested in the tutorial of repeated measure ANOVA at UCLA computing page at: http://www.ats.ucla.edu/stat/R/seminars/Repeated_Measures/repeated_measures.htm -- View this message in context: http://r.789695.n4.nabble.com/some-questions-about-longitudinal-study-with-baseline-tp253

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 2:53 PM, Johann Hibschman wrote: David Winsemius writes: On Sep 7, 2010, at 11:02 AM, Johann Hibschman wrote: Even so, I would prefer to only save the coefficients Have you read through the Value section of glm's help page? ...and ?coef I have; it's easy to get the

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread Johann Hibschman
David Winsemius writes: > On Sep 7, 2010, at 11:02 AM, Johann Hibschman wrote: >> Even so, I would prefer to only save the coefficients > > Have you read through the Value section of glm's help page? > > ...and > > ?coef I have; it's easy to get the coefficients. The part I'm struggling with is

Re: [R] question on "optim"

2010-09-07 Thread Hey Sky
thanks. Ben after read your email, I realized the initial value of w[5]=0 is a stupid mistake. and I have changed it. but I am sorry I cannot reproduce the result, convergence, as you get. the error message is . any suggestion about it? and could you plz recommend some R books on optimization,

Re: [R] remove accents in strings

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 2:29 PM, Matt Shotwell wrote: Weird, my (Ubuntu, s don't tell Dirk) iconv doesn't add the backticks or single quotes. I don't see any promise in the help page that iconv should substitute anything for the accents. It just says each OS may have its own behavior and

Re: [R] remove accents in strings

2010-09-07 Thread Matt Shotwell
Weird, my (Ubuntu, s don't tell Dirk) iconv doesn't add the backticks or single quotes. > tst <- c("à", "è", "ì", "ò", "ù" , "À", "È", "Ì", "Ò", "Ù", "á", + "é", "í", "ó", "ú", "ý" , "Á", "É", "Í", "Ó", "Ú", "Ý") > iconv(tst, to="ASCII//TRANSLIT") [1] "a" "e" "i" "o" "u" "A" "E" "I" "O" "U"

Re: [R] path analysis

2010-09-07 Thread Mark Difford
Guy, For a partial least squares approach look at packages plspm and pathmox. Also look at sem.additions. Regards, Mark. -- View this message in context: http://r.789695.n4.nabble.com/path-analysis-tp2528558p2530207.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] remove accents in strings

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 1:35 PM, Matt Shotwell wrote: If you know the encoding of the string, or if its encoding is the current locale encoding, then you can use the iconv function to convert the string to ASCII. Something like: iconv(accented.string, to="ASCII//TRANSLIT") While 7-bit ASCII doe

Re: [R] a^c(1:3)

2010-09-07 Thread Ben Bolker
Feng Li stat.su.se> writes: > > Very fruitful, thanks all of you:) > ?sweep may be useful as well (I don't think anyone has mentioned it yet, sorry if redundant). It handles row/column-wise operations in a way that is independent of the underlying column/row ordering or recycling rules. _

Re: [R] a^c(1:3)

2010-09-07 Thread Feng Li
Very fruitful, thanks all of you:) Feng [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and prov

Re: [R] remove accents in strings

2010-09-07 Thread Matt Shotwell
If you know the encoding of the string, or if its encoding is the current locale encoding, then you can use the iconv function to convert the string to ASCII. Something like: iconv(accented.string, to="ASCII//TRANSLIT") While 7-bit ASCII does not permit accented characters, extended (8-bit) ASCII

Re: [R] R program google search

2010-09-07 Thread Waverley @ Palo Alto
Hi, I have sent some request as how to embed the Google search API in R? I remember on one mailing list people talked about this previously using R. I did some analysis on this and found that google API (SOAP based) has retired and was replaced with the AJAX search API. I found the following per

[R] TukeyHSD responses in R

2010-09-07 Thread adriana1986
Hi All, Does anyone know how to get contrast statements or an output similar to TukeyHSD when doing survival analysis with the coxph function? Thanks, Adriana -- View this message in context: http://r.789695.n4.nabble.com/TukeyHSD-responses-in-R-tp2530120p2530120.html Sent from the R help mail

Re: [R] Display R graphics windows in second monitor

2010-09-07 Thread Gunnar Carnwath
Perfect, Thanks! From: Greg Snow Sent: Tue, September 7, 2010 10:54:25 AM Subject: RE: [R] Display R graphics windows in second monitor I assume that you are using the GUI version then.  There are a couple of ways you can do this.   1. With R running clic

Re: [R] Plotting longitudinal data

2010-09-07 Thread Joshua Wiley
Hi, Reading in (and slightly editing your data, so that patient_id is a factor, and the date is class date). Results of dput() provided for others' benefit. dat <- structure(list(V1 = c("7213", "1", "4797", "2399", "2400", "7230", "2", "4798", "4799", "2401", "3", "7233", "4", "4800", "2402", "7

Re: [R] path analysis

2010-09-07 Thread JLucke
There are three paths to path analysis in R: the SEM package; the LAVAAN package; and the OpenMx approach. The first two are R programs. The last accesses the program OpenMx. Guy rotem Sent by: r-help-boun...@r-project.org 09/06/2010 10:37 AM To r-help@r-project.org cc Subject [R] pat

[R] some questions about longitudinal study with baseline

2010-09-07 Thread array chip
Hi all, I asked this before the holiday, didn't get any response. So would like to resend the message, hope to get any fresh attention. Since this is not purely lme technical question, so I also cc-ed R general mailing list, hope to get some suggestions from there as well. I asked some ques

[R] remove accents in strings

2010-09-07 Thread lamack lamack
Dear all, there is a R function to remove all accents in strings? best regards. JL [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] Percentile rank for each element in list

2010-09-07 Thread Peng, C
It seems to produce some strange values: > xx=1:10 > which(xx==quantile(x,0.2,type=3)) [1] 5 > which(xx==quantile(x,0.5,type=3)) integer(0) -- View this message in context: http://r.789695.n4.nabble.com/Percentile-rank-for-each-element-in-list-tp2529523p2530060.html Sent from the R help mailin

Re: [R] Plotting longitudinal data

2010-09-07 Thread Dennis Murphy
Hi: There are several problems; see inline. On Tue, Sep 7, 2010 at 9:27 AM, Jukka Koskela wrote: > Hello, > > Hope that someone could help me plotting longitudinal data below: > Firstly, you want to use NA in place of NULL as the missing value code. This is easy to change in a text editor. > >

[R] R cannot be started

2010-09-07 Thread Tao
I used Rtools for installing a package under Windows XP. I used commands like R CMD INSTALL (build, check) in the CMD window. It worked well until I found that my revised package can be updated with R CMD INSTALL. After I restarted my computer, R cannot be started any more. I double click the R ic

[R] rscaleUsage Function

2010-09-07 Thread Ziad.Elmously
To Whom It May Concern, In using the Bayesm package titled "rscaleUsage," it does not reports "mudraw," "taudramw," "sigmadraw," "Lambdadraw," and "edraw." However, it does not report the transformed y ratings or latent z scores. Is there any way to infer the value for y and z? Ziad Elmou

Re: [R] Display R graphics windows in second monitor

2010-09-07 Thread Gunnar Carnwath
I am using Windows 7 and installed R using all the default settings.   Gunnar Carnwath PhD Candidate, University of Montana College of Forestry and Conservation 509.675.1540 From:

[R] average columns of data frame corresponding to replicates

2010-09-07 Thread Juliet Hannah
Hi Group, I have a data frame below. Within this data frame there are samples (columns) that are measured more than once. Samples are indicated by "idx". So "id1" is present in columns 1, 3, and 5. Not every id is repeated. I would like to create a new data frame so that the repeated ids are av

Re: [R] Display R graphics windows in second monitor

2010-09-07 Thread Greg Snow
I assume that you are using the GUI version then. There are a couple of ways you can do this. 1. With R running click on the "Edit" menu, then on "GUI preferences" and a new dialog box will pop up. At the top choose the SDI radio button. Save the settings, quit R and restart. Now every windo

Re: [R] a^c(1:3)

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 12:35 PM, Feng Li wrote: Dear R, I have two small questions confused me recently. Now assume I have a matrix "a", like this, a <- matrix(1:6, 2, 3) a [,1] [,2] [,3] [1,]135 [2,]246 I sometimes need each row of "a" raised to a different expo

Re: [R] a^c(1:3)

2010-09-07 Thread Erik Iverson
Feng, Hello, all of this behavior comes down to argument recycling. Feng Li wrote: Dear R, I have two small questions confused me recently. Now assume I have a matrix "a", like this, a <- matrix(1:6, 2, 3) a [,1] [,2] [,3] [1,]135 [2,]246 I sometimes need each

Re: [R] a^c(1:3)

2010-09-07 Thread Dimitris Rizopoulos
"^" is vectorized operator, so a^c(2,3) is essentially the same as a^rep(c(2,3), length.out = length(a)) which is c(a)^rep(c(2,3), length.out = length(a)) but put back in a matrix format (i.e., with rows and columns). Now, if you want each column in different power, you need to explicitly

Re: [R] Something similar to layout in lattice or ggplot

2010-09-07 Thread Greg Snow
For lattice graphics look at ?print.trellis and pay particular attention to the position, split, and more arguments, also look at the examples on that page. The interface is a bit different from layout, but it allows for multiple independent plots on the same page. -- Gregory (Greg) L. Snow P

Re: [R] Percentile rank for each element in list

2010-09-07 Thread Arun.stat
Otherwise you can try following: x <- c(1,5,100,300,250,200,550,900,1000) which(x==quantile(x,0.25,type=3)) This will always return number within your vector. See further information with ?'quantile' Thanks and regards, -- View this message in context: http://r.789695.n4.nabble.com/Percentil

Re: [R] Display R graphics windows in second monitor

2010-09-07 Thread Greg Snow
What operating system are you using and how do you run R within that OS? -- 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-help-boun...@r- > project.org] O

[R] a^c(1:3)

2010-09-07 Thread Feng Li
Dear R, I have two small questions confused me recently. Now assume I have a matrix "a", like this, > a <- matrix(1:6, 2, 3) > a [,1] [,2] [,3] [1,]135 [2,]246 I sometimes need each row of "a" raised to a different exponent. So I do a trick like this, > a^c(2, 3)

Re: [R] R package to identify model

2010-09-07 Thread Greg Snow
I think that I am the one to blame for the first references to the possibility of an ESP package on this list (though I picked up the idea from the perl.misc newsgroup). ESP is the acronym for Extra Sensory Perception which is the pseudoscience dealing with people supposedly being able predict

[R] AHRQ - Creation of Comorbidity Variables

2010-09-07 Thread GL
If there are any other users who use AHRQ's SAS code comoanaly2010 and comformat2010 to create comorbidity variables, I thought you might be interested in the following PRELIM code we wrote to mimic its functionality in R. It seems to yield similar results, but may contain errors. Please feel free

[R] Plotting longitudinal data

2010-09-07 Thread Jukka Koskela
Hello, Hope that someone could help me plotting longitudinal data below: 7213330001 0.8300 13.05.091 1 330001 0.8700 09.02.05NULL 4797330001 0.7700 21.03.07NULL 2399330001 0.7800 12.04.06NULL 240033

Re: [R] Saving fits (glm, nls) without data

2010-09-07 Thread Dennis Murphy
Hi: If all you want are the coefficients and covariance matrix from a glm fit, use coef(model) to extract the coefficients (as David mentioned) summary(model)$cov.unscaledto get the unscaled covariance matrix of the coefficients. [and summary(model)$cov.scaledfor the covariance matrix

Re: [R] boundary correction - univariate kernel density estimation

2010-09-07 Thread David Winsemius
On Sep 7, 2010, at 12:04 PM, sbillin2 wrote: Hey, Does anyone know of a package in R that provides univariate kernel density estimation with boundary correction ? What? you don't believe that tunneling occurs at finite barriers? or how to easily extend an existing bivariate kernel density

  1   2   >