[R] where two matrices differ?

2011-05-31 Thread Alaios
Dear all, I have a few matrices that are roughly the same (same dimensions). How I can find fast which are the elements that differ? Best Regards Alex __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the p

Re: [R] where two matrices differ?

2011-05-31 Thread Alaios
Thanks alot. Unfortunately I can not apply this to much bigger matrices as I can not visually check all the components. Regards Alex --- On Tue, 5/31/11, Scott Chamberlain wrote: From: Scott Chamberlain Subject: Re: [R] where two matrices differ? To: "Alaios" Cc: R-help@r-projec

[R] based on mean and std

2011-06-02 Thread Alaios
Dear all, I have a few gaussian distributions with known (mean and sd). How can I plot in R easily the cdf of them? In matlab there is a guid where you can give the values and have the plots ready. Is anything like that in R? Best Regards Alex __ R-

[R] Plot cdf, pdf

2011-06-02 Thread Alaios
Dear all, do you know any easy way based on a vector input how to plot easily cdf and pdf. I would like to thank you in advance for your help Regards Alex __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] trheshold matrix

2011-06-03 Thread Alaios
Dear all I want to put zeros and ones in matrix I have if the values are over a threshold For that I use: origBoolmap<- (origmap >thresh ) origBoolmap[thresh < origmap] <- 1 origBoolmap[thresh >= origmap] <- 0 Could you please tell me if the first line out of the three is useless? I have check

[R] Plot many x and y

2011-06-06 Thread Alaios
Dear all could you please plot many x's and y's with one legend per plot? I would like to thank you in advance for your help Best Regards Alex. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

[R] Measure execution time

2011-01-27 Thread Alaios
Dear list members, I would like to measure how much time one function call makes from the time is call until the time it returns. Could you please tell me if that is possible in R? Best Regards Alex __ R-help@r-project.org mailing list https://stat.e

[R] adaptIntegral takes too much time

2011-01-27 Thread Alaios
Hello Dear List members, as you can see (and guess) from the code below adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(.,.)) $integral [1] 9.997e-09 $error [1] 1.665168e-16 $functionEvaluations [1] 17 $returnCode [1] 0 > adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(1,1)) the

[R] Measure execution time

2011-01-28 Thread Alaios
Dear list members, I would like to measure how much time one function call makes from the time is call until the time it returns. Could you please tell me if that is possible in R? Best Regards Alex __ R-help@r-project.org mailing list https://stat.e

[R] R version

2011-01-31 Thread Alaios
Hello could you please explain me if I am running a 64bit version of R or a 32 bit? R --version R version 2.12.1 Patched (2011-01-30 r54169)

[R] Help me apply mapply

2011-02-02 Thread Alaios
Hello all I would like to ask your help use mapply. I have a function called findCell that takes two arguments(x,sr) where x is a vector of size two (e.g x<-c(2,3) and sr is a matrix. I would like to call many times the findCell function (thus I need mapply) for different x inputs but always for

[R] Loop to mapply. Error

2011-02-03 Thread Alaios
Goodmorning List Member, I would like to ask your help using mapply or Vectorize to make a loop more efficient. I have a m*4 matrix called borders and I would like to add a 5th column. Thus first A. I add the new 5th column borders<-cbind(borders,matrix(data=NA,nrow=nrow(borders))) B. For every c

Re: [R] looping variable names

2011-02-03 Thread Alaios
Hello I would like to ask you if I can use the same method but for functions. That means that I want not to assign some value but a function. So is it possible to try something like that: for (i in 1:10) for (j in 1:10) assign(paste("var",i,j,sep=""),myfunction) I would like to thank you in a

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Alaios
rders[1:2,1:2] Var1 Var2 1 -1.000 -1 2 -0.667 -1 > From: Petr PIKAL > Subject: Odp: [R] Loop to mapply. Error > To: "Alaios" > Cc: R-help@r-project.org > Date: Thursday, February 3, 2011, 11:02 AM > Hi > > Well, no data so a wild guess. You

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Alaios
I would like to thank you very much both. Your replies helped me understand. I will bookmark you replies for future reference :) Best Regards Alex --- On Thu, 2/3/11, Kenn Konstabel wrote: From: Kenn Konstabel Subject: Re: [R] Odp: Loop to mapply. Error To: "Alaios" Cc: "

[R] "Matrix' with Functions

2011-02-03 Thread Alaios
Dear R members, I have a quite large of function that are named like that f11,f12,...f15 f21,f22,...f25 .. f51,f52,...f52 These are static (hard-coded) functions that the only common they have is that they take the same number and type of input fij(a,b,c,d). As you might understand this is reall

Re: [R] "Matrix' with Functions

2011-02-03 Thread Alaios
Dear all, I would like to thank you for your contribution. I think I got more that one good solutions to work on. Best Regards Alex --- On Thu, 2/3/11, Bert Gunter wrote: From: Bert Gunter Subject: Re: [R] "Matrix' with Functions To: "Samuel Le" Cc: "Alaios&quo

[R] Lightweight store plots as images.

2011-02-05 Thread Alaios
Dear all I would like to store a few hundrends images to my hard disk so I need your comment that is the most efficient way in R to do for i in c(1:100){ A. create plot with title # I do not want to give output to screen\ B. store it as an image using plot's title as filename C. Destroy tha

[R] Image to plot

2011-02-06 Thread Alaios
Dear all I would like to plot the contents of a matrix as an Image. I found this code here http://www.phaget4.org/R/image_matrix.html but this is not only what I want. Instead of having inside every cell the color of the cell it would be nice to have also the arithmetic value over the background

Re: [R] Image to plot

2011-02-07 Thread Alaios
Thanks a lot. That did the trick :) --- On Mon, 2/7/11, Jim Lemon wrote: > From: Jim Lemon > Subject: Re: [R] Image to plot > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, February 7, 2011, 9:39 AM > On 02/07/2011 06:37 PM, Alaios > wrote: > &

Re: [R] Image to plot

2011-02-07 Thread Alaios
t Regards Alex --- On Mon, 2/7/11, Jim Lemon wrote: > From: Jim Lemon > Subject: Re: [R] Image to plot > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, February 7, 2011, 9:39 AM > On 02/07/2011 06:37 PM, Alaios > wrote: > > Dear all I would lik

[R] color2d.maplot error

2011-02-07 Thread Alaios
Dear all I am using color2D.maplot to map some matrixes to plot. everything works fine. It seems that when my matrix contains only the same value color2D.maplot returns the following error: color2D.matplot(estimatedsr,redrange=c(0,1),greenrange=c(0,.5),bluerange=c(0,.5),xlab="x",ylab="y",main=

[R] color2D.maplot fixed color range

2011-02-09 Thread Alaios
Dear all, I have -one matrix sr ([200,200]) which is the original file -25 matrixes estimatedsr ([200,200]) which are an estimation of the sr. As I am plotting these matrixes I want to have ONE common way that the cells are colored. Eg. Values from 10-20--> red color, 20-30-->blue color (or som

[R] Matrix of Matrices?

2011-02-10 Thread Alaios
Dear all I have a few matrices that I would like to store alltogether under a bigger object. My matrixes with the same name were calculated inside a loop like for (few times){ estimatedsr<- this is my matrix savematrixasimagefile(); } which means that I was losing all that instances.

Re: [R] Matrix of Matrices?

2011-02-11 Thread Alaios
/11/11, Petr Savicky wrote: > From: Petr Savicky > Subject: Re: [R] Matrix of Matrices? > To: r-help@r-project.org > Date: Friday, February 11, 2011, 12:22 PM > On Thu, Feb 10, 2011 at 11:54:50PM > -0800, Alaios wrote: > > Dear all I have a few matrices that I would lik

[R] monitor variable change

2011-02-16 Thread Alaios
Dear all I would like to ask you if there is a way in R to monitor in R when a value changes. Right now I use the sprintf('my variables is %d \n, j) to print the value of the variable. Is it possible when a 'big' for loop executes to open in a new window to dynamically check only the variabl

[R] sprintf does not print

2011-02-16 Thread Alaios
Dear all I have an sprintf inside a loop to track changes in variable's value. This sprintf statement works if I copy and paste it inside R sprintf('I did the the %d,%d \n',k,l) but when this is inside a loop I get no message. listcounter<-1 for (k in c(1:mmax)){ # for (l in c(1:nmax)){

Re: [R] monitor variable change

2011-02-16 Thread Alaios
I think we are both talking for watchpoints-breakpoints --- On Wed, 2/16/11, Rainer M Krug wrote: > From: Rainer M Krug > Subject: Re: [R] monitor variable change > To: "Alaios" > Cc: R-help@r-project.org > Date: Wednesday, February 16, 2011, 9:54 AM > -

Re: [R] sprintf does not print

2011-02-16 Thread Alaios
Thank you very much both. You made it clear :) Regards Alex --- On Wed, 2/16/11, ted.hard...@wlandres.net wrote: > From: ted.hard...@wlandres.net > Subject: Re: [R] sprintf does not print > To: "R help" > Cc: "Alaios" > Date: Wednesday, February 16, 20

[R] multi process support in R

2011-02-17 Thread Alaios
Dear all, two days ago I was trying to run a bunch of adaptIntegrate() functions (double integrals) into my 4 core pc. As I was not satisfied about my pc's performance I tried also to run my code to another computer that has 8 or 16 cores. Unfortunately I didnt get any really decent improvemen

[R] color.scale error

2011-02-17 Thread Alaios
Dear all when I call color.scale like this: require('plotrix') colcolor<-color.scale(c(range_sr,sr),extremes=c("red","blue")) Error in if (min(reds) < 0 || max(reds) > 1) reds <- rescale(reds, c(0, : missing value where TRUE/FALSE needed range_sr [1] -10.00 44.02977813958366

Re: [R] color.scale error

2011-02-18 Thread Alaios
Dear Jim, this is just to confirm that it your solution worked :) Regards Alex --- On Fri, 2/18/11, Jim Lemon wrote: > From: Jim Lemon > Subject: Re: [R] color.scale error > To: "Alaios" > Cc: R-help@r-project.org > Date: Friday, February 18, 2011, 9:10 AM > On

[R] How two compare two matrixes

2011-03-03 Thread Alaios
Dear all I have two 10*10 matrixes and I would like to compare theirs contents. By the word content I mean to check visually (not with any mathematical formulation) how similar are the contents. I also know edit that prints my matrix in the scree but still one edit blocks the prompt to launch a

Re: [R] How two compare two matrixes

2011-03-04 Thread Alaios
That's the problem Even a 10*10 matrix does not fit to the screen (10 columns do not fit in one screen's row) and thus I do not get a well aligned matrix printed. This is that makes comparisons not that easy to the eye. >From the other hand with edit(mymatrix) I get scrolls so I can scroll to on

[R] Make R 'Beep'

2011-03-08 Thread Alaios
Dear all, I would like to ask you if R can produce any kind of sound. It would be useful when code execution stops R to notify me by playing some sound. Is that possible in R? I would like to thank you in advance for your help Best Regards Alex __ R

Re: [R] multi process support in R

2011-03-28 Thread Alaios
he i,j values so each cores saves at the right place inside the lst matrix. Could you please help me with that? Regards Alex --- On Thu, 2/17/11, Ben Haller wrote: > From: Ben Haller > Subject: Re: [R] multi process support in R > To: "Alaios" > Cc: R-help@r-project.org &

[R] From a list to a double-list/matrix

2011-03-28 Thread Alaios
Dear all , I would like to extend a list structure to a structure that can hold much more date. Please find a small example of my code and my questions regarding it: lst <- list() for (k in c(1:mmax)){ # 1 ..max as the f.fxy gets as input order-1. for (l in c(1:nmax)){ sr[findCoord(c(

Re: [R] Make R 'Beep'

2011-03-29 Thread Alaios
Tried it ! Worked ! Thanks a lot --- On Tue, 3/8/11, Jim Lemon wrote: > From: Jim Lemon > Subject: Re: [R] Make R 'Beep' > To: "Alaios" > Cc: R-help@r-project.org > Date: Tuesday, March 8, 2011, 10:14 AM > On 03/08/2011 09:01 PM, Alaios > wrote: >

[R] Many cores support in R (Multicore Package)

2011-03-29 Thread Alaios
Dear all, I am trying to improve my code for many cores. I have started with multicore package and the function mclapply. A multicore version of the lcapply. One problem I have is that when I use this function (you can copy and paste the below) require('multicore') returni <-function(i) {i} sys

[R] a for loop to lapply

2011-03-29 Thread Alaios
Dear all, I am trying to learn lapply. I would like, as a test case, to try the lapply alternative for the Shadowlist<-array(data=NA,dim=c(dimx,dimy,dimmaps)) for (i in c(1:dimx)){ Shadowlist[,,i]<-i } ---so I wrote the following--- returni <-function(i,ShadowMatrix) {ShadowMatrix<-i} la

[R] For->lapply->parallel apply

2011-04-09 Thread Alaios
Dear all, I would like to ask your help understand the subsequent steps for making my program faster. The following code: Gauslist<-array(data=NA,dim=c(dimx,dimy,dimz)) for (i in c(1:dimz)){ print(sprintf('Creating the %d map',i)); Gauslist[,,i]<-f <- GaussRF(x=x, y=y, model=model, grid=

[R] Mclapply and print statement

2011-04-11 Thread Alaios
Dear all. I am using the mclapply function to split my code to the many cores my system has. It seems that is working fine. This is the parallel version of lcapply. The only problem that I seem to have is that the printf cannot print messages. The ideal to me is to have fro my function an outpu

[R] Comparing execution times

2011-04-11 Thread Alaios
Dear all, In my 'simple' computer I was running some experiments to help me understand how faster a multicore lapply will be. I thought it might be interesting for some people to look at the results. Even though are not accurate, still might be a good indicator how much improvement there can be

[R] AR(1)

2011-04-13 Thread Alaios
Dear all, I would like to ask you if you know any AR(1) function that can create a sequence of values for different time lags. The AR(1) based on a starting value and with the gaussian error can produce this time lags. Could you please help me find a function that can do and does not depend on

[R] Help me create a hyper-structure

2011-04-16 Thread Alaios
Dear all I would like to have in R a big struct containing a smaller struct. I have tried something that I would like to share and ask your help make it work 1) I would like to have a small struct with the following three fields xorder (an integer ranging from 0 to 20) yorder (an integer rangi

Re: [R] Help me create a hyper-structure

2011-04-16 Thread Alaios
ubject: Re: [R] Help me create a hyper-structure > To: r-h...@stat.math.ethz.ch > Date: Saturday, April 16, 2011, 3:39 PM > Alaios > yahoo.com> writes: > > > > > Dear all > > I would like to have in R a big struct containing a > smaller struct. > >

[R] mapply to lapply

2011-04-18 Thread Alaios
Dear all, I would like to ask your help concerning converting a mapply function to lapply. The reason is that I would like to use mclapply which requires lapply syntax. The command I would like to convert is: F2[i+1,j+1]<-sum(mapply(Fwithcellvalue,i=i,j=j,a=cells[,2],b=cells[,4],c=cells[,1],d=c

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Alaios
of assignments or not? I would like to thank you in advance for your help Best Regards Alex --- On Sat, 4/16/11, Ben Bolker wrote: > From: Ben Bolker > Subject: Re: [R] Help me create a hyper-structure > To: r-h...@stat.math.ethz.ch > Date: Saturday, April 16, 2011, 3

Re: [R] mapply to lapply

2011-04-18 Thread Alaios
rgument "i" is missing, with no default What do you think I should try out now? Vielen Dank Alex --- On Mon, 4/18/11, Andreas Borg wrote: > From: Andreas Borg > Subject: Re: [R] mapply to lapply > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, Apr

Re: [R] mapply to lapply

2011-04-18 Thread Alaios
Thanks you very much. You made it work! Cheers --- On Mon, 4/18/11, Kenn Konstabel wrote: > From: Kenn Konstabel > Subject: Re: [R] mapply to lapply > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, April 18, 2011, 1:06 PM > On Mon, Apr 18, 2011 at 2:10 PM,

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Alaios
Thank you very much . That was really helpful. I will keep this email for future reference Regards --- On Mon, 4/18/11, Duncan Murdoch wrote: > From: Duncan Murdoch > Subject: Re: [R] Help me create a hyper-structure > To: "Alaios" > Cc: r-h...@stat.math.ethz.ch, "

[R] From nested loop to mclapply

2011-04-18 Thread Alaios
Dear all, I am trying to find a decent way to speed up my code. So far I have used mclapply with really good results (parallel version of lapply). I have a nested loop that I would like to help me convert it to lapply for (i in seq(from=-1,to=1-2/ncol(sr),length=ncol(sr))){ for (j in s

Re: [R] From nested loop to mclapply

2011-04-19 Thread Alaios
elp Best Regards Alex --- On Mon, 4/18/11, Allan Engelhardt wrote: > From: Allan Engelhardt > Subject: Re: [R] From nested loop to mclapply > To: "Alaios" > Cc: R-help@r-project.org > Date: Monday, April 18, 2011, 5:36 PM > Try help("expand.grid", > pa

[R] How to program with colleagues

2011-04-19 Thread Alaios
Dear all, my colleagues and I have to write some R code for some of our projects. I would like to ask you help to organize us a little. a. Do you know if there is any system that can convert our R scripts to html pages with some nice dependency graphs (which functions calls which). b. Could you

[R] 'Structure' compatible between Matlab and R

2011-04-21 Thread Alaios
Dear all, I would like to store some data in a such way that I can import and export the data from matlab to R (And vice versa). I have a matrix of size 512*512 size. I would like to have 101 of such matrices. (that is easy so far) and then I would like to have 35times the 101 matrices. That mea

[R] ggplot

2011-04-22 Thread Alaios
Hello everyone, I am using ggplot to plot but I am getting the following error which I do not understand Error: geom_text requires the following missing aesthetics: label My code is dimx<-256 library(ggplot2) dev.new() xandy<-expand.grid(seq(1:dimx),seq(1:dimy)) xx<-data.frame(xandy

[R] postscript( does not save the plot

2011-08-16 Thread Alaios
Dear all, I am using the following code to write the plot to an eps format postscript(file="test.eps",horizontal=FALSE) boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c

Re: [R] postscript( does not save the plot

2011-08-17 Thread Alaios
value",boxwex=0.5) dev.off() To not bother you with the details, the only difference is the pars =list(whisklwd=0,staplelwd=0) at the end of the boxplot , which I use to remove the whiskers fromt he blot. B.R From: Marc Schwartz Cc: "R-help@r-proj

Re: [R] postscript( does not save the plot

2011-08-19 Thread Alaios
        test[270, 1:500], test[330, 1:500], test[390, 1:500],         names = c("1", "3", "5", "8", "10", "13", "1"), outline = FALSE,         ylim=c(0.01, 50), log = "y", xlab = "xvalue", ylab = "yvalue",

Re: [R] postscript( does not save the plot

2011-08-19 Thread Alaios
> > B.R > Alex > > > > > From: Marc Schwartz > > Cc: "R-help@r-project.org" > Sent: Wednesday, August 17, 2011 5:48 PM > Subject: Re: [R] postscript( does not save the plot > > Not sure what output you get in the fi

[R] ggplot2 to create a "square" plot

2011-08-31 Thread Alaios
Dear all, I am using ggplot with geom_tile to print as an image a matrix  I have. My matrix is a squared one of 512*512 cells.  The code that does that is written below > print(v + geom_tile(aes(fill=dB))+ > opts(axis.text.x=theme_text(size=20),axis.text.y=theme_text(size=20), > axis.title.x=

Re: [R] ggplot2 to create a "square" plot

2011-08-31 Thread Alaios
Dear Dennis, I would like to thank you for your reply. I also checked the web sites that you gave me, it is hard to find everything about ggplot2 at one place with concrete examples that help you understand directly what you are plotting. As you have already mentioned ggsave can save the image a

Re: [R] ggplot2 to create a "square" plot

2011-09-02 Thread Alaios
Dear Dennis, I wouldl ike to thank you for your answer. That did it work. how can I know remove the space between the axis labels and the image (blue-red area)? Right now things look like are floating a bit. I want the x,y labels to reduce the overall gap. I would like to thank you in advance f

[R] changing axis labels

2012-06-06 Thread Alaios
Dear all, I am making a function for creating plots and part of this function is to change the labels to x axis that instead of number contains percentage number. I want to change the x axis to depict the percentage value of the presented data x<-c(501:600) y<-c(201:300) plot(x,y,axes=F) axis(2

Re: [R] changing axis labels

2012-06-06 Thread Alaios
Great :) To: R help Sent: Wednesday, June 6, 2012 9:40 AM Subject: changing axis labels Dear all, I am making a function for creating plots and part of this function is to change the labels to x axis that instead of number contains percentage number. I wa

[R] Fitting and Plotting the fitted distributions

2012-07-01 Thread Alaios
Dear all, I have wrote some sample code that would allow me easier fit fast many distributions and check which of the fits performs better. My sample code (that you can of course execute it looks like that) distrList<-list(   "exponential",  "geometric", "log-normal",  "normal", "Poisson") f

[R] Mclapply prints once

2011-07-22 Thread Alaios
Dear all I have the following code that works in paraller (and is pretty fast actually) The only problem I still have is that every core just prints only once. dimz<-1000 Shadowlist<-mclapply(1:dimz, function(i) {   print(sprintf('Creating the %d map',i));    

[R] Variables in a Tabular form. easily saved in a txt file

2012-07-26 Thread Alaios
Dear all, I would like to save few variable-names with their values in a tabular form, with that I mean that files can be printed easily in R in a tabular form and also saved in a ascii file that when one opens it see also the variables in a nice tabular format. IS that possible? Below a small

[R] Convert variable to STring

2012-07-30 Thread Alaios
Dear all, I have a variable that I would like also to use it as a string. The reasons is that I want to collect results from different function to one table.. So when I use the  colnames(mymatrix) <-c(function1.function2,function3) the function1, function2, function3 to be "converted" to simple s

[R] TimeStamps to seconds

2012-07-31 Thread Alaios
Dear all, I am having a matrix that stores data information in the following format. > roofPart1$TimeStamps[1:5,] [,1] [,2] [,3] [,4] [,5]   [,6] [1,] 2011    7   21   15   25 20.609 [2,] 2011    7   21   15   25 23.265 [3,] 2011    7   21   15   25 26.000 [4,] 2011    7   21   15   25 28.671

[R] Sum two Vectors of different length

2012-08-03 Thread Alaios
Dear all, in one part of my code I want to sum two vectors element-wise the problem is that either the 1st vector or the 2nd vector always have one or two less elements example of my problem In TotalVector + (datalist2[[1]]$dataset$Results[[j]]$Results[[time]]$Sweep) :   Länge des längeren Objek

[R] Plot not too dense line plot

2012-09-10 Thread Alaios
Dear all, I am including in a plot 6 different lines (?lines) with 6 different line types. The problem is that I have so dense information that the line types are not visible any more.   In the code below myLength<-length(currentSet) plot(seq(from=1,to=myMax,length.out=myLength),currentSet, typ

[R] read.table with double precision

2011-11-17 Thread Alaios
Dear all I have a txt file with the following contents 1 50.790643000 6.063498 2 50.790738000 6.063471 3 50.791081000 6.063380 4 50.791189000 6.063552 I am usind read.table('myfile.txt',sep=" ") which unfortunately returns only integers and not dou

[R] create variable names using paste

2011-11-20 Thread Alaios
Dear all, I would like based on a variable values, like threshold<- 90 to create variables name that will load data sets For example paste('mystring',threshold,sep="")<-load('myfile') How I can doi something like that in R? B.R Alex [[alternative HTML version deleted]] _

[R] REad bitmap files

2011-11-23 Thread Alaios
Dear all, I am looking for a function that can read a simple bmp file and return me a matrix with their corresponding values. I have already looked in the packages require(ReadImages) require(pixmap) and also did apropos("image") but I could not find something that can do something like that

Re: [R] REad bitmap files

2011-11-23 Thread Alaios
I want to confirm that it worked (took some time though to find the needed libraries!) now I get from the readGal the following struct > str(store) Formal class 'SpatialGridDataFrame' [package "sp"] with 6 slots   ..@ data   :'data.frame': 65536 obs. of  1 variable:   .. ..$ band1: int [1:655

[R] readGDAL or raster for reading bit map files

2011-11-24 Thread Alaios
Dear all, I have asked yesterday of how I can read a simple bitmap file in R cran. I was suggest to use either readGDAL or raster for loading my bitmap a. I have done it with readGDAL like     store<-readGDAL(fname='lena256.bmp')     and it works,... but it converts my matrix-like notion of a b

Re: [R] readGDAL or raster for reading bit map files

2011-11-24 Thread Alaios
Thanks a lot! That worked. I have two R related questions when I use the   store<-readGDAL(fname='lena256.bmp') this returns the struct below > str(store) Formal class 'SpatialGridDataFrame' [package "sp"] with 6 slots   ..@ data   :'data.frame': 65536 obs. of  1 variable:   .. ..$ band1: int

[R] Handling Packages

2011-11-25 Thread Alaios
Dear all, I have two questions regarding packaging. a. What is the inverse action of require(). I want to "detach" one of the two libraries I loaded as there are two functions with the same name and come from two different libraries b. If I do not "detach" the one library how I can refer to the

[R] All combinations

2011-11-30 Thread Alaios
Dear all, I would like something simple to do in R that I do not know how I should search for it. Let's say that I have a list of a<-c(1,2,3,4,5) b<-(6,7,8) and I want to get back all their possible cominations like 1,6 1,7 1,8 2,6 2,7 2,8 3,6 3,7 3,8 and so on. How I can do that? B.R Alex

[R] find and replace string

2011-12-02 Thread Alaios
Dear all, I would like to search in a string for the second occurrence of a symbol and replace the symbol after it For example my strings look like sta_+1+0_field2ndtry_$01.cfg I want to find the digit that comes after the second +, in that case is zero and then over a loop create the strin

Re: [R] find and replace string

2011-12-02 Thread Alaios
You are too good :) Thanks a lot have a nice weekend B.R Alex From: jim holtman Cc: "R-help@r-project.org" Sent: Friday, December 2, 2011 1:51 PM Subject: Re: [R] find and replace string try this: > x <- c('sta_+1+0_field2ndtry_$01.cfg' +      , 'sta_

[R] simple fit

2011-12-08 Thread Alaios
Dear all,  I have a formula of the form y=ax+b I know everything except b. How I can ask R to do fitting to find only the value of b? I already know the lm() but it always return both an intercept point (b) and the a. What should I do ? I would like to thank you in advance for your help B.R Al

[R] Search a string inside a data.frame

2011-12-21 Thread Alaios
Dear all, I have a string and I want to search for its existance inside a data.frame (or in a column of the data.frame). One way is for me to do this manually: Make a for loop for the number of elements and compare one by one element. Is there though any more improved way to do that? B.R Alex

[R] Gps fraction of degrees function

2011-12-21 Thread Alaios
Dear all,   I have the following written example > coords <- "51°30'48.58\"N" > > as.integer(strsplit(coords, "°")[[1]][1]) [1] 51 > as.integer(strsplit(strsplit(coords, "°")[[1]][2], "'")[[1]][1]) [1] 30 > as.numeric(strsplit(strsplit(strsplit(coords, "°")[[1]][2], "'")[[1]][2], > "\"")[[1]][1]

[R] regular expressions in R

2011-12-21 Thread Alaios
Dear all I would like to ask from dir function in R (?dir) to give me only the files that end with .txt or .doc. The dir functions supports the use of patterns (is not that regular expressions) for doing that.   print(dir(i,full.names=TRUE,pattern=.)) Could you please help me compose such a

[R] Create and Initialize List values

2012-01-03 Thread Alaios
Dear all, seasons greetings, I had made a list of elements that I want to have  # list generator Agent<-list(id=NA, position=list(x=NA,y=NA)) # Make list of Agents AgentList<-rep(list(CRAgent),5) # Initialization. Is it shorter to do that with a lapply statement? for (i in c(1:length(CRAgentList

[R] Open Street map problem

2012-01-09 Thread Alaios
Dear all, I would like to use R to create a map , with some points with no copyright. I am trying to use the open street map interface of Rgooglemaps package. It seems that I am getting internal server error source('make2DaysMaps.R') [1] "http://tile.openstreetmap.org/cgi-bin/export?bbox=-74.021

[R] plot, xlim to cut data set

2012-01-09 Thread Alaios
Dear all, I would like to tell plot to limit the plotted area into values (for the x axis) that are from X1 to X2. I have tried to use xlim=c(X1,X2) inside plot.. but unfortunately this does only change the labeling of the xaxis and not the values plotted there. How I can do that in R? B.R Alex

[R] remove elements from matrix

2011-09-30 Thread Alaios
Dear all, I have a numeric vector that contains indices. I also have two matrices of [1,m] dimension and of [m,n] dimension. I want for every indexto remove the current element from the [1,m] vector an the row from the [m,n] matrix. How I can do that efficiently in R? So to say not have a for loo

[R] integrate two lines to one

2011-09-30 Thread Alaios
Dear all, I would like to put these two lines together logictoReduce<-((Overloads-1)%%FreqN)==(SpanIndex-1) #0...3 refer to sub spans 1 to 4 Overloads<-Overloads[logictoReduce==TRUE] and do it like this Overloads<-Overloads[((Overloads-1)%%FreqN)==(SpanIndex-1)] which does not seem to work.

[R] is member

2011-09-30 Thread Alaios
Dear all, I have a vector with number that some of them are part of the   seq(1,800,4). How can I check which of the numbers belong to the seq(1,800,4)   LEt's say that is called myvector the vector with the numbers. Is there in R something like this? is.member(myvector,seq(1,800,4))   I would like

Re: [R] is member

2011-09-30 Thread Alaios
ement(myvector, seq(1,800,4)) or, if you like typing percent signs,   myvector %in% seq(1,800,4) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Alaios > Sent:

Re: [R] is member

2011-10-02 Thread Alaios
0,4) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Alaios > Sent: Friday, September 30, 2011 9:26 AM > To: R-help@r-project.org > Subject: [R] is member &g

[R] Concecutive zeros and ones

2011-10-06 Thread Alaios
Dear all, I have  a data series (might be vector or matrix) which is composed only from zeros and ones like the following example 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0 I want to be able to return back the length of concecutive zeros and the length of concecutive ones. For that I want to have somethi

[R] apply and functions with many arguments

2011-10-06 Thread Alaios
Dear all, I would like to use the following function fitdist(data, distr, method=c("mle", "mme", "qme", "mge"), start=NULL, fix.arg=NULL, ...) for many different distr values like distr=c("norm","lnorm","pois") (just a small example) and take back into a list the parameter name which is what is

Re: [R] apply and functions with many arguments

2011-10-06 Thread Alaios
s to work. I am not sure though if there is a strict performance penalty. B.R Alex From: Paul Hiemstra Cc: "R-help@r-project.org" Sent: Thursday, October 6, 2011 10:07 AM Subject: Re: [R] apply and functions with many arguments On 10/06/2011 08:03 AM, Alai

Re: [R] Concecutive zeros and ones

2011-10-06 Thread Alaios
Great :) From: Dimitris Rizopoulos Cc: "R-help@r-project.org" Sent: Thursday, October 6, 2011 9:22 AM Subject: Re: [R] Concecutive zeros and ones Check function rle(). I hope it helps. Best, Dimitris On 10/6/2011 9:18 AM, Alaios wrote: >

[R] Limitations of R

2011-10-06 Thread Alaios
Dear all, I have a few binary files like 9Gb or even of 50Gb. I would like to ask you what are the known limits of the R for the data processing part, I have a system with a lot of RAM (500Gb) but I am not sure about the "internal" limitations of the R. How long for example a vector can be? C

[R] Handling Time in R

2011-10-07 Thread Alaios
Dear all, I would like to ask your help regarding handling time stamps in R. I think first I need a reference to read about their logic and how I should handle them. For example, this is a struct I have str(MyStruct$TimeStamps)  num [1:100, 1:6] 2011 2011 2011 2011 2011 ... MyStruct$TimeStamp

<    1   2   3   4   5   >