Re: [R] substrings

2007-08-09 Thread Vladimir Eremeev
Is this what you want? > a<-c("a b c","1 2 3","q - 5") > a [1] "a b c" "1 2 3" "q - 5" > sapply(strsplit(a,"[[:blank:]]"),function(x)x[1]) [1] "a" "1" "q" Edna Bell wrote: > > I have a set of character results. If one of the characters is a > blank space, followed by other characters, I want

Re: [R] substrings

2007-08-09 Thread Vladimir Eremeev
one more, shorter, solution. > a [1] "a b c" "1 2 3" "q- 5" > gsub("\\s.+","",a) [1] "a" "1" "q-" Edna Bell wrote: > > I have a set of character results. If one of the characters is a > blank space, followed by other characters, I want to end at the blank > space. > > I tried strsplit, b

Re: [R] Very new - beginners questions

2007-08-13 Thread Vladimir Eremeev
Hi. You should study "An Introduction to R" manual. It is installed with R in PDF format and is accessible from the menu (Help -> Manuals (in PDF) -> ) There are several links in the R web site. Go to http://www.r-project.org/ and see links under the word "Documentation" in the left frame. There

Re: [R] vertically oriented color key in heatmaps

2007-08-13 Thread Vladimir Eremeev
colorbar() from the package matlab. nightly.py wrote: > > Hi, I have some data which I was plotting using image(). I wanted to > add a vertical color key to the plot and I found that heatmap.2 in > gplots does let me add a color key. However, I was thinking of a > vertical bar with the co

Re: [R] diffusing GIS data in maps

2007-08-14 Thread Vladimir Eremeev
Hi. You will find some useful information in the http://r-spatial.sourceforge.net/ Particularly, Fig. 07 in the Graph gallery. Package spmaps can be used to extract desired boundaries from the mapdata and convert them to the format suitable for sp and others. Lawrence D. Brenninkmeyer wro

Re: [R] Possible to "import" histograms in R?

2007-08-15 Thread Vladimir Eremeev
Nick Chorley-3 wrote: > > I have a large amount of data that I would like to create a histogram of > and > plot and do things with in R. It is pretty much impossible to read the > data > into R, so I have written a program to bin the data and now have a list of > counts in each bin. Is it possib

Re: [R] Possible to "import" histograms in R?

2007-08-15 Thread Vladimir Eremeev
Hello Nick, Wednesday, August 15, 2007, 1:18:34 PM, you wrote: NC> On 15/08/07, Vladimir Eremeev <[EMAIL PROTECTED]> wrote: NC> Nick Chorley-3 wrote: >> >> I have a large amount of data that I would like to create a histogram of >> and >> plot and do

Re: [R] R on a flash drive

2007-08-20 Thread Vladimir Eremeev
This is a FAQ. http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Can-I-run-R-from-a-CD-or-USB-drive_003f Erin Hodgess wrote: > > Dear R People: > Has anyone run R from a flash drive, please? > If so, how did it work, please? > Thanks in advance! > -- View this message in context: http

Re: [R] prediction interval for multiple future observations

2007-08-20 Thread Vladimir Eremeev
Vlad Skvortsov wrote: > > '?predict.lm' says that the prediction intervals returned by predict() > are for single observation only. Is there a way to specify the desired > number of observations to construct the interval for? > You can generate the desired sequence of new values using seq o

Re: [R] Partial comparison in string vector

2007-08-21 Thread Vladimir Eremeev
Hi! seq(along=x) %in% grep("e",x) Steve Powell-4 wrote: > > I have a vector of strings > x=c("w","ex","ee") > And I want to get a logical vector showing the positions where my search > string "e" matches the elements partially, i.e. is at least the left-hand > part of the target strings, i.e.

[R] Variable c and function c

2007-08-21 Thread Vladimir Eremeev
I have found the error in my script which was semi-automatically translated from the other person's MATLAB code. The error is that c was assigned a value inside a function. That is the function body contained the following instructions c<-nw*czr d<-nw*cz rFren<-0.5*(abs((cz-c)/(cz+c))^2+abs

Re: [R] Package installation

2007-08-24 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > This is a source code package. > Install Rtools (http://www.murdoch-sutherland.com/Rtools/), then you > should be able to compile source packages from the Windows command prompt > > For example, > > c:\downloads>R CMD INSTALL biOps_0.1

Re: [R] Package installation

2007-08-24 Thread Vladimir Eremeev
This is a source code package. Install Rtools (http://www.murdoch-sutherland.com/Rtools/), then you should be able to compile source packages from the Windows command prompt For example, c:\downloads>R CMD INSTALL biOps_0.1-1.tar.gz provided you have downloaded the file biOps_0.1-1.tar.gz to

[R] bug in DEoptim package

2007-08-30 Thread Vladimir Eremeev
(the same mail was sent to the author) When I called the function DEoptim with control=list(strategy=1) or control=list(strategy=2) I got the error: Error in mui[rtd + 1, i] : incorrect number of dimensions Analysis of the source code of the DEoptim reveals the following fragment if (con$

Re: [R] R CMD BATCH: cat does not print

2007-08-30 Thread Vladimir Eremeev
Use rscript Rscript myscript.R or Rscript -e 'cat("Hello!\n")' will show Hello! on the console. R CMD BATCH writes its output to the file myscript.Rout Paul Smith wrote: > > Dear All, > > I am trying to write my first R script. The code is simply > > cat("Hello!\n") > > However, when I

[R] How to mask or escape "="

2007-08-30 Thread Vladimir Eremeev
-- View this message in context: http://www.nabble.com/How-to-mask-or-escape-%22%3D%22-tf4354174.html#a12406926 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-

[R] How to mask or escape "=" in Windows command prompt?

2007-08-30 Thread Vladimir Eremeev
I have defined a function with several arguments and have it stored in the .RData file. The 'function head' is defined as follows EstimALIConc <-function(sdname,SZ,W,farea,watri,biomodel,start.part=1,nparts=20,method=c("optim","DEoptim")) { [ blah-blah-blah ] (function body doesn't matter) }

Re: [R] How to signal the end of the table?

2007-08-30 Thread Vladimir Eremeev
For example, fp<-file("abc.csv","r") c.row<-scan(file=fp,sep=",",nlines=1) # "what" argument is omitted for bevity as it doesn't matter rows<-c.row while(length(c.row)>0) { c.row<-scan(file=fp,sep=";",nlines=1); rows<-rbind(rows,c.row) } close(fp) If you want to read a file by parts, the

[R] About "=" in command line in windows.

2007-08-31 Thread Vladimir Eremeev
It seems, I don't understand something, or there is a bug in R. I have made some experiments after my yesterday post about using "=" with -e switch to the Rscript. Now, I've found: (1) C:\users\wl\trainings\r>rscript --verbose -e "mean(x=1:3)" running 'C:\Program Files\R\bin\Rterm.exe --slave

[R] clustering analysis is certainly possible with R.

2007-09-10 Thread Vladimir Eremeev
See the article "Cluster" in R Task Views http://cran.at.r-project.org/src/contrib/Views/Cluster.html It lists names of packages for clustering analysis, which you can install. Or, go to choose another CRAN mirror closest to you from the R web site, then click on 'Task views' in the left frame.

[R] how to resample (or resize) matrix?

2006-07-27 Thread Vladimir Eremeev
Dear r-help, I have a matrix, suppose, 10x10, and I need the matrix 5x5, having in each cell a mean value of the cells from the initial matrix. Please, point me to a function in R, which can help me doing that. Digging the documentation and mail archives didn't give me a result. Tha

Re: [R] how to resample (or resize) matrix?

2006-07-27 Thread Vladimir Eremeev
 [9,]    9   19   29   39   49   59   69   79   89    99 jh> [10,]   10   20   30   40   50   60   70   80   90   100 >> rmean jh> [,1] [,2] [,3] [,4] [,5] jh> [1,]  6.5 26.5 46.5 66.5 86.5 jh> [2,]  8.5 28.5 48.5 68.5 88.5 jh> [3,] 10.5 30.5 50.5 70.5 90.5 jh> [4,] 12.5 32

Re: [R] how to resample (or resize) matrix?

2006-07-27 Thread Vladimir Eremeev
Dear Robin, Thank you, seems it is what I need. --- Best regards, Vladimirmailto:[EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

Re: [R] how to resample (or resize) matrix?

2006-07-27 Thread Vladimir Eremeev
Dear Sean, Thursday, July 27, 2006, 3:31:31 PM, you wrote: SOR> Hi Vladimir, SOR> I was wondering whether this was image related :-) Yes, that's right, I am doing image processing with R. SOR> would one of the image related libraries do it for you? SOR> looking at SOR> http://cran.r-project.org

[R] plot correlation matrix

2006-09-21 Thread Vladimir Eremeev
Dear useRs, While exploring new R packages, I have found the Rattle. This screenshot http://rattle.togaware.com/rattle-correlation.png is very interesting (others are in http://rattle.togaware.com/rattle-screenshots.html ). Which function was used to produce this plot? Is such plotting of the cor

[R] package usage statistics.

2006-09-26 Thread Vladimir Eremeev
Dear useRs, Is it possible to get the R package usage statistics? That is, does R contain any tools to estimate which packages were used and how often? I am going to temporary change the workplace and packing the data and their processing scripts on my computer in order to continue my

Re: [R] package usage statistics. (UPDATE)

2006-09-26 Thread Vladimir Eremeev
Here is the perl script with some comments #!/bin/perl -w use File::Find; # we use the standard Perl module. # its procedure will scan the directory tree and put all package names to the hash # along with counting the number of their loadings. %pkgs=("base"=>-1,# w

Re: [R] package usage statistics. (UPDATE)

2006-09-26 Thread Vladimir Eremeev
Dear Roger, Tuesday, September 26, 2006, 4:16:38 PM, you wrote: RB> On Tue, 26 Sep 2006, Vladimir Eremeev wrote: >> Here is the perl script with some comments RB> ?? Sorry, forgot to mention, this script is designed to run from the root of the working directory tree. It scans a

[R] or, you could consider R-spatial.

2007-04-05 Thread Vladimir Eremeev
http://r-spatial.sourceforge.net Linda Smith wrote: > > I have a netcdf gridded file with LCC projection. I can easily use > image.plot to visualize it. However, as the axises are in X,Y, not Lat and > Lon, I could not add state or country maps onto it (or lat lon > information). > I do have

Re: [R] reading of a matrix

2007-04-05 Thread Vladimir Eremeev
Schmitt, Corinna wrote: > > I still have problems with the reading of a matrix. > > Input: matrixData6.txt > > A-Paar B-Paar C-Paar D-Paar E-Paar > A 1 3 5 7 9 > B 2 4 6 8 10 > > > R-commands: > y=read.table(file="Z:/Software/R-Programme/matrixData6.txt") > y > > Result: > A.Paar B

Re: [R] how to image.plot a XY grid file into a lat-lon map

2007-04-05 Thread Vladimir Eremeev
If your country or state borders are polygons or polylines, you could convert them to desired projection using the function project from the package rgdal. Latitude-longitude grid also could be added by generating desired polylines in lat-lon and converting them to the desired projection using p

[R] how to exclude some packages from help.search() ?

2007-04-06 Thread Vladimir Eremeev
I have installed RGTk2 to satisfy other package requirements. I am not planning to use it in my own work. Occasionally I search through the R help using the help.search() function, and every time it returns me lots of references to the functions in the RGtk2 package, which I don't need. I would

Re: [R] how to image.plot a XY grid file into a lat-lon map

2007-04-09 Thread Vladimir Eremeev
Hello Linda, Friday, April 6, 2007, 2:47:43 AM, you wrote: LS> On 4/5/07, Vladimir Eremeev <[EMAIL PROTECTED]> wrote: VE>> If your country or state borders are polygons or polylines, you could convert VE>> them to desired projection using VE>> the function project

Re: [R] using install.packages via proxy

2007-04-12 Thread Vladimir Eremeev
What operating system do you use? If you use Windows, than open the Control Panel, double click on the System icon, go to "Advanced" tab, press "Environment variables" button, then press "New" to create one more new variable, enter "http_proxy" as the "Name" of variable, and "http://address.of.y

Re: [R] Export multiple data files from R

2007-04-17 Thread Vladimir Eremeev
You didn't describe the exact format of the .gpr files. There are 32 heading lines in each file, which are now hidden from R community. You 'skip' 31 of them in read.table, and one more plays header ('header=T'). Since you are using read.table, your files are usual ascii files. You shoud use 'cat

Re: [R] A structured output from for(i...)?

2007-04-19 Thread Vladimir Eremeev
Try using cat, paste(c("c(",paste (. .. .. collapse=","),")")), format, formatC and others francogrex wrote: > > Hello I am using the "for (i...)" and a sink() into a file. But the output > I am having is not arranged in either a vector or any other good > structure. I would like to have the o

Re: [R] automating merging operations from multiple dataframes

2007-04-23 Thread Vladimir Eremeev
Consider sapply and get. There might be something like the following (untested) fn<-function(l){ # l is supposed to be a letter. Errors will occur otherwise. #constructing names dfr.name<-paste(toupper(l),"INDSLIM",sep="") column.name<-paste(tolower(l),"region",sep="") #retrieving data fr

Re: [R] Random Number Generator of Park and Miller

2007-04-23 Thread Vladimir Eremeev
gracezhang wrote: > > Hi, > > I failed to search for R package providing random number generator of > "Park and Miller". > Anyone know any R package supporting this kind of function? > I failed too. However, here is the source code http://www.firstpr.com.au/dsp/rand31/ which can be either ea

Re: [R] Random Number Generator of Park and Miller

2007-04-23 Thread Vladimir Eremeev
By the way, AFAIK, R uses the Mersenne-Twister random number generator, which "has a much better reputation for producing numbers than any linear congruential PRNG" (the same url, http://www.firstpr.com.au/dsp/rand31/) gracezhang wrote: > > I failed to search for R package providing random numb

Re: [R] adding a column to a matrix

2007-04-26 Thread Vladimir Eremeev
m<-cbind(m,0) m[m[,3]>m[,4],5]<-1 colnames(m)[5]<-"censoring" raymond chiruka wrote: > > i would like to add a variable to an existing matrix by manipulating 2 > previous variables eg for the data > m > treat strata censti survTime > [1,] 1 2 284.684074 690.49

Re: [R] searching for special variables

2007-05-03 Thread Vladimir Eremeev
ls(pattern=".*777.*") Schmitt, Corinna wrote: > > Dear R-Experts, > > in my program I have a big workspace. Now I want to look for all > variables which have the letters "777" in their name (e.g. ask777first) > and afterwards I need to delete those variables. How can I reach this > aim? > -

Re: [R] searching for special variables

2007-05-03 Thread Vladimir Eremeev
sorry, forgot to delete objects. rm(list=ls(pattern=".*777.*")) Vladimir Eremeev wrote: > > ls(pattern=".*777.*") > > > Schmitt, Corinna wrote: >> >> in my program I have a big workspace. Now I want to look for all >> variables which h

Re: [R] adding a column to a matrix

2007-05-03 Thread Vladimir Eremeev
t; l used matrix to genarate the data rc> thanks in advance rc> Vladimir Eremeev <[EMAIL PROTECTED]> wrote: rc> m<-cbind(m,0) m[m[,3]>>m[,4],5]<-1 rc> colnames(m)[5]<-"censoring" rc> raymond chiruka wrote: >> >> i would like to add a

Re: [R] convert text to exprission good for lm arguments

2007-05-03 Thread Vladimir Eremeev
Vadim Ogranovich wrote: > > Hi, > > I ran into a problem of converting a text representation of an expression > into parsed expression to be further evaluated inside lm (). > >> n <- 100 >> data <- data.frame(x= rnorm (n), y= rnorm (n)) >> data. lm <- lm (y ~ x, data=data) >> >> ## this

Re: [R] upgrade to 2.5

2007-05-03 Thread Vladimir Eremeev
I usually install a new version over the old one (in the same directory). I did this since R 1.xx, using windows 2000 and then windows XP. No bugs were found, everything always works fine. Iasonas Lamprianou wrote: > > Hi I am using R version 2.4.1. How can I upgrade to version 2.5 without > h

Re: [R] Error in if (!length(fname) || !any(fname == zname)) { :

2007-05-04 Thread Vladimir Eremeev
For me, the simplest way to find, what is wrong, would be tracing the R code: library(debug) mtrace(cph) cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18] +colon[,20]+colon[,9], surv=TRUE) ... then find the place of the error and analyze how to adjust the function call arguments to av

Re: [R] Library & Package for Tobit regression

2007-05-04 Thread Vladimir Eremeev
Here is some information on this regression in R http://tolstoy.newcastle.edu.au/R/help/06/02/21153.html Abdus Sattar wrote: > > I am want to use tobit regression for left censored panel/longitudinal > data. Could you please provide me the name of "library" and/or "package" > that will give me

Re: [R] Error in if (!length(fname) || !any(fname == zname)) { :

2007-05-04 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > For me, the simplest way to find, what is wrong, would be tracing the R > code: > > library(debug) > mtrace(cph) > cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18] > +colon[,20]+colon[,9], surv=TRUE) > > ... then find the

Re: [R] creating a new column

2007-05-07 Thread Vladimir Eremeev
To create 6th column in the matrix m, you should use the cbind function. To calculate the vector of pairwise min or max values, you should use the pmin and pmax functions: act.surv.time<-pmin(m[,"censoringTime"],m[,"survivalTime"]) m<-cbind(m,act.surv.time) raymond chiruka wrote: > > hie l wou

[R] looking for equivalent of matlab's medfilt1 function

2007-05-07 Thread Vladimir Eremeev
Dear all, I have several files with Matlab code, which I am translating to R. For the zero-level approach, I took the very old shell script from R-help archives, which has made some obvious leg-work such as replacement of "=" with "<-". Now I am translating indexing, matrix operations and funct

[R] Piecewise cubic Hermite interpolation

2007-05-08 Thread Vladimir Eremeev
Which function implements the piecewise cubic Hermite interpolation? I am looking for equivalent of matlab's interp1 with the method = 'pchip' Here is the reference http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/interp1.html&; -- View this me

Re: [R] trouble with help

2007-05-08 Thread Vladimir Eremeev
Did you try manually opening the file mentioned in the browser (Z:\Software\R\R-2.5.0\doc\html\index.html) ? Does this file exist? Was the html help installed? Schmitt, Corinna wrote: > > Hallo, > > I just updated to the new version of R by installing everything new. Now > I have a problem wi

Re: [R] trouble with help

2007-05-08 Thread Vladimir Eremeev
he html help? > > Corinna > > -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Im Auftrag von Vladimir Eremeev > Gesendet: Dienstag, 8. Mai 2007 12:22 > An: r-help@stat.math.ethz.ch > Betreff: Re: [R] trouble with help > > Did you

Re: [R] minimum of each row in a matrix

2007-05-08 Thread Vladimir Eremeev
Looks like you are reading manuals and these mailings insufficiently carefully. ?apply says that if its second argument is 1, it gives you what you want. Gabor Csardi has also written you this. If you have several vectors, not a single matrix, you can use pmin: pmin(a[1,],a[2,],a[3,],a[4,],a[5,

Re: [R] Piecewise cubic Hermite interpolation [FOUND]

2007-05-10 Thread Vladimir Eremeev
'pchip' from the 'signal' package seems to do the desirable operations. Vladimir Eremeev wrote: > > Which function implements the piecewise cubic Hermite interpolation? > > I am looking for equivalent of matlab's interp1 with the method = 'p

Re: [R] how to control the sampling to make each sample unique

2007-05-10 Thread Vladimir Eremeev
Urania Sun wrote: > > I have a dataset of 1 records which I want to use to compare two > prediction models. > > I split the records into test dataset (size = ntest) and training dataset > (size = ntrain). Then I run the two models. > > Now I want to shuffle the data and rerun the models. I

Re: [R] Batch

2007-05-14 Thread Vladimir Eremeev
elyakhlifi mustapha wrote: > > I saw the R-help to run some R programs in batch I used it like this > >> R CMD BATCH C:/Documents and Settings/melyakhlifi/Bureau/calcara.r > Erreur : erreur de syntaxe dans "R CMD" > > but without success!!!I don't work on linux but on windows IS it the same >

Re: [R] space in R

2007-05-15 Thread Vladimir Eremeev
elyakhlifi mustapha wrote: > > hello, > can you help me I need to seperate words and symbol in a mathematics > formula as follow > > C744=(C627*C177)/100 > > How could I do please? > If you need to simply split a character vector, use strsplit. This and previous your posts suggest you need

[R] qr.solve and lm

2007-05-15 Thread Vladimir Eremeev
Dear R experts, I have a Matlab code which I am translating to R in order to examine and enhance it. First of all, I need to reproduce in R the results which were already obtained in Matlab (to make sure that everything is correct). There are some matrix manipulations and '\' operation among the

Re: [R] qr.solve and lm (addition)

2007-05-15 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > Dear R experts, > > I have a Matlab code which I am translating to R in order to examine and > enhance it. > First of all, I need to reproduce in R the results which were already > obtained in Matlab (to make sure that everything is correct)

Re: [R] qr.solve and lm (SOLVED)

2007-05-15 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > Dear R experts, > > I have a Matlab code which I am translating to R in order to examine and > enhance it. > First of all, I need to reproduce in R the results which were already > obtained in Matlab (to make sure that everything is correct)

Re: [R] drop a letter

2007-05-16 Thread Vladimir Eremeev
elyakhlifi mustapha wrote: > > hello, > how can I do to drop C from this character "C325" ? > 1. if C is always single and always first: > substring("C325",2) 2. more generic solution, drops all letters > sp<-unlist(strsplit("C325",split="[A-Z]")) > sp<-sp[nchar(sp)>0] > sp -- View this m

Re: [R] Running R function as a Batch process

2007-05-16 Thread Vladimir Eremeev
d. sarthi maheshwari wrote: > > Hi, > > I am struggling with using R CMD BATCH command. Kindly suggest solution to > the following problem. > > I have a function named CinC with accept two input parameters. This can be > shown as: > > CinC <- function(start, end) > > where start and end bot

Re: [R] rJava problem

2007-05-17 Thread Vladimir Eremeev
mister_bluesman wrote: > > Basically, I’m trying to install rJava on my windows XP machine. I think I > have succeeded in doing so as it appears in the list when i type library() > in R. > > However, when i type ‘library(rJava)’ I get an error dialog box saying: > > 'This application has fail

Re: [R] rJava problem

2007-05-17 Thread Vladimir Eremeev
mister_bluesman wrote: > > Ah thanks for that. That seems to have done the trick. But I'm not > sure whether I have copied the right jvm.dll file into the path. > > I have 3 places where a jvm.dll file can be found: > > ~\Java\jre1.6.0_01\bin\client -this is the one i copied > ~\Ja

Re: [R] using lm() with variable formula

2007-05-21 Thread Vladimir Eremeev
I was solving similar problem some time ago. Here is my script. I had a data frame, containing a response and several other variables, which were assumed predictors. I was trying to choose the best linear approximation. This approach now seems to me useless, please, don't blame me for that. Howeve

[R] ... and 5 cents more.

2007-05-21 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > I was solving similar problem some time ago. > Here is my script. > I had a data frame, containing a response and several other variables, > which were assumed predictors. > I was trying to choose the best linear approximation. > This app

Re: [R] Legend outside plotting area

2007-05-22 Thread Vladimir Eremeev
RSiteSearch("legend outside plot") will bring you many links to the discussions of this question. layout perfectly allows everything. typical sequence looks like this This divides the device region by two parts one below another: layout(matrix(c(1,2),byrow=TRUE), heights=[blah-blah-blah], [some

[R] Please, remind a function name

2007-05-22 Thread Vladimir Eremeev
Sorry, I'm stuck. :) I am writing a function, which would fit either one linear model or another one, depending on its argument model.type. And I don't want to use several if's, because R allows doing it with much more beauty. That is I am looking for prettier alternative to the following AB2C<

Re: [R] Parallel processes

2007-05-22 Thread Vladimir Eremeev
snow still exists, and there is one more package snowFT on CRAN (FT stands for Fault Tolerant) Probably, you didn't find it because of typing its name in capitals. hodgess wrote: > > According to the R-help, at one time there was a package called SNOW. It > doesn't seem > to exist anymore. >

Re: [R] Parallel processes

2007-05-22 Thread Vladimir Eremeev
There are R interfaces to MPI and PVM on CRAN, which are Rmpi and RPVM, respectively. hodgess wrote: > > I was wondering if there were any packages for parallel programming in R. > > According to the R-help, at one time there was a package called SNOW. It > doesn't seem > to exist anymor

Re: [R] Please, remind a function name

2007-05-22 Thread Vladimir Eremeev
") { > .Class <- method > NextMethod("mymodel") > } > > mymodel.S <- function(a, b, method = "S") cat("S:", a, b, method, "\n") > mymodel.HK <- function(a, b, method = "S") cat("HK:", a, b

Re: [R] about lex/yacc

2007-05-23 Thread Vladimir Eremeev
These are not functions. These are separate products (one more is bison), aimed to help in creating programming language interpreters. You should know the C programming language and be familiar with the algorithm theory, the finite state machine theory and with the LALR grammatics, in order to su

Re: [R] Please, remind a function name

2007-05-23 Thread Vladimir Eremeev
Great! I was thinking about adding such a feature in the future. Gabor Grothendieck wrote: > > Note that a significant difference between the two solutions is that > the OO solution allows new methods corresponding to "method=" > to be added without changing the function holding the statements.

Re: [R] how to mimic plot=F for truehist?

2007-05-25 Thread Vladimir Eremeev
By defining your own function. You can get the function body by typing its name in the R command line and pressing Enter. Copy-paste the function body in ascii file (source R code), redefine it as you like, for example, by adding desired argument and code for processing it, then source that file

Re: [R] creating txt file from data.frame

2007-05-28 Thread Vladimir Eremeev
apply(dfr,1,FUN=function(x){ cat(c(x[1], ifelse(x[2]==x[3],x[2],paste(x[2],x[3],sep="-")),"\n"), file="filename.txt") }) This code assumes the data frame with at least 3 columns, errors will occur if there will

Re: [R] search path question

2007-05-29 Thread Vladimir Eremeev
Yes, it is. The original is here http://finzi.psych.upenn.edu/R/Rhelp02a/archive/92829.html However, it requires some modifications. Here they are. Sorry, I can test it only in Windows. search.source <- function(file, path=Sys.getenv("PATH"), ...) { for(p in strsplit(path,.Platform$path.se

[R] Where is CRAN mirror address stored?

2007-05-31 Thread Vladimir Eremeev
When I update.packages(), R shows the dialog window, listing CRAN mirrors and asks to choose the CRAN mirror to use in this session. Then, R uses this address and never asks again until quit. Is there any way to make R ask for the CRAN mirror again, except restarting it? I am just trying to save

Re: [R] Accessing plots in Trellis graphics

2007-05-31 Thread Vladimir Eremeev
I used similar empty space to place the legend, by specifying the placement coordinates to the key argument of xyplot. This was rather long time ago, and I had to explicitly form the list, used as the key argument for this function. Lattice has evolved since that, some automation has appeared. T

Re: [R] determining a parent function name

2007-05-31 Thread Vladimir Eremeev
Does tail(capture.output(traceback()),n=1) do what you want? that is error <- function(...) { msg <- paste(..., sep = "") if(!length(msg)) msg <- "" if(require(tcltk, quiet = TRUE)) { tt <- tktoplevel() tkwm.title(tt, "Error") tkmsg <- tktext(tt, bg = "white") pa

Re: [R] determining a parent function name

2007-05-31 Thread Vladimir Eremeev
Vladimir Eremeev wrote: > > Does > tail(capture.output(traceback()),n=1) > do what you want? > > that is > Hmmm... Seems, no... Having the earlier error() definition and bar<-function() error("asdasdf") ft<-function() bar() > ft() I

Re: [R] Why is the R mailing list so hard to figure out?

2007-06-05 Thread Vladimir Eremeev
irishhacker wrote: > > Why does the R mailing list need such an unusual and customized user > interface? > There was a discussion of this some time ago on the list. I believe, RSiteSearch("r-help mailing list forum") or some other similar keywords will find it. irishhacker wrote: > > What's

Re: [R] Neural Net. in R

2007-06-06 Thread Vladimir Eremeev
I have written some bindings from the SNNS (Stuttgart Neural Network Simulator) to R. However, this work is not finished since the lack of interest to it and lack of time. At the moment, I use the mixture of scripts for R, cmd.exe, bash, and SNNS' batchman (latter two under cygwin) in my work. SN

Re: [R] Selecting all values smaller than X in a dataframe

2007-06-11 Thread Vladimir Eremeev
Christoph Scherber-2 wrote: > > Dear R users, > > I have a correlation matrix for a dataframe called "synth", for which I > now want to select only those cells that have correlations larger than > +/-0.6: > > synth=data.frame(x=rnorm(10,1),y=rnorm(10,2),z=rnorm(10,0.5)) > > w=cor(synth,use=

Re: [R] selecting characters from a line of text

2007-06-12 Thread Vladimir Eremeev
Tim Holland wrote: > > Is there a way in R to select certain characters from a line of text? I > have some data that is presently in a large number of text files, and I > would like to be able to select elements of each text file (elements are > always on the same line, in the same position) an

Re: [R] dyn.load( ) problem

2007-06-12 Thread Vladimir Eremeev
Ian McCarthy wrote: > > I am trying to access a dll with dyn.load, but I get an error message box > titled "R Console: Rgui.exe - Unable to Locate Component". The error > message itself states "this application has failed to start because > libifcoremdd.dll was not found. Re-installing the appli

Re: [R] Read Windows-like .INI files into R data structure?

2007-06-13 Thread Vladimir Eremeev
One more question, inspired by this one, just to increase my R skill level. Earl F. Glynn wrote: > > I need to process some datasets where the configuration information was > stored in .INI-like files, i.e., text files with sections like this: > > [Section1] > var1=value1 > var2=value2 > [Sect

Re: [R] Read Windows-like .INI files into R data structure?

2007-06-13 Thread Vladimir Eremeev
Christophe Pallier wrote: > >> "var1=value1", "A=value3" is almost pure R code. >> Is it possible to use this feature to solve the problem? > > Along the same lines: you may write a short script that converts the ini > file into R code that can be sourced. > >>From your example, you can genera

Re: [R] Formatted Data File Question for Clustering -Quickie Project

2007-06-14 Thread Vladimir Eremeev
The "R Data Import/Export" guide was mentioned already, it contains everything you should know about data exchange between R and other software. In case it says nothing about dates, try as.Date() and strftime(). For your example below, as.Date("1/31/1994",format="%m/%d/%Y") works. ngottlieb w

Re: [R] test if files in current folder

2007-06-14 Thread Vladimir Eremeev
runner wrote: > > I want to test if the files are already in my current folder before I > download or copy from somewhere else. What's in my mind is to check if a > file is open-able in current folder. Is there a way to do this, like in > Perl: > if (open()) { do sth}? > > To put it another w

Re: [R] Redirecting print output

2007-07-24 Thread Vladimir Eremeev
Stan Hopkins wrote: > > I see a rich set of graphic device functions to redirect that output. Are > there commands to redirect text as well. I have a set of functions that > execute many linear regression tests serially and I want to capture this > in a file for printing. > > Thanks, > > St

Re: [R] values from a linear model

2007-07-24 Thread Vladimir Eremeev
Manuele Pesenti wrote: > > Dear R users, > how can I extrapolate values listed in the summary of an lm model but not > directly available between object values such as the the standard errors > of > the calculated parameters? > > for example I got a model: > > mod <- lm(Crd ~ 1 + Week, data

Re: [R] plots

2007-07-25 Thread Vladimir Eremeev
amna khan wrote: > > I did not find any function of graph which plot one variable on x-axis and > 2 > or more than 2 variables on y-axis. > You can use xyplot() from the package lattice. library(lattice) xyplot(y1+y2+y3~x) I suspect, the problem is, that plot() erases everything that was plot

Re: [R] problem with sub !

2007-07-25 Thread Vladimir Eremeev
Try Sys.setlocale(). marco.R.help marco.R.help wrote: > > I am trying to use "sub" to replace patterns in a character array that > contains german names with german special characters. I have the following > problem: > >> sub("\\xdf","ss","Wei\xdferitzkreis") > Error in sub(pattern, repla

Re: [R] Download multiple stock quotes in a loop

2007-07-26 Thread Vladimir Eremeev
Owe Jessen wrote: > > Hi all, > > this should be a simple question, but I haven't been able to do it > right. I am trying to download multiple stock quotes in a loop, so that > every timeseries is safed with the symbol of the stock. Can anybody help > me out? Here's the code: > > require(t

Re: [R] exporting character vector to text files

2007-07-27 Thread Vladimir Eremeev
Use get() instead of eval(). And, probably, some arguments are missing in call to paste(). Maybe, extension? That is, for(i in test) write.table(get(i),file=paste(i,"txt",sep="."),row.names=FALSE,sep="\t") If you want file names matching exactly names of your matrices, and being without ext

Re: [R] Call R program from C++ code

2007-07-30 Thread Vladimir Eremeev
"Writing R Extensions" manual contains chapters dedicated to parsing and evaluating of the R extensions from C. Also, I vaguely remember I've seen something like "Embedding R" somewhere in manuals. R can be compiled as a shared library object, that you can dynamically load from your application an

Re: [R] regular expressions : extracting numbers

2007-07-30 Thread Vladimir Eremeev
GOUACHE David wrote: > > Hello all, > > I have a vector of character strings, in which I have letters, numbers, > and symbols. What I wish to do is obtain a vector of the same length with > just the numbers. > A quick example - > > extract of the original vector : > "lema, rb 2%" "rb 2%" "rb

Re: [R] Call R program from C++ code

2007-07-30 Thread Vladimir Eremeev
; That's would be great if R programs K> can be "compiled" as shared library object(.lib? or .dll ? ) Can you please K> give more details about that? K> Best, K> Feng K> -Original Message- K> From: [EMAIL PROTECTED] K> [mailto:[EMAIL PROTECTED] On Behal

Re: [R] Prompt comes too late

2007-07-31 Thread Vladimir Eremeev
You can use choose.files(caption="Choose data file please!",multi=FALSE,filters=Filters["All"]) This will show the prompt in the file selection dialog and also allows you to restrict the list of possible choises with a filter. Ralf Finne wrote: > > I am trying to make a program to ask the use

  1   2   >