Re: [R] Make a loop more efficient

2010-10-06 Thread alaios
Thank you very much both of you. I will check and post back later if needed. Best Regards Alex -- View this message in context: http://r.789695.n4.nabble.com/Make-a-loop-more-efficient-tp2955912p2964346.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Linear Integration

2010-10-06 Thread alaios
I would like to thank you for your reply. Yes I had this conversation of how to find the cells that are touched. I did that with these two lines: temp-(floor(cbind(seq(x[1],xr[1],by=0.01),lineeq(x,xr #. cellid2 -unique( floor(cbind(seq(x[1],xr[1], by=0.01), lineeq(x,xr)) ) ) # cell ids

[R] Looking for a book/tutorial with the following context:

2010-10-06 Thread alaios
Hello everyone. It is time to start writing more and more function and I want to read in a good reference -book ( I can buy one, especially if it is second handed :P) -online tutorial -any other guide -How functions really work in R -How to write bigger R programs -If there are local function

[R] Make a loop more efficient

2010-10-05 Thread Alaios
Hello everyone I need some advice if the following might be easier implemented. There are n matrixes each matrix needs to calculate one value for the rest n-1 matrixes (but not for itself). I implemented this one by two nested loops for (i in c(1:length(CRX))) { for (j in

[R] Linear Integration

2010-10-05 Thread Alaios
Hello I would like to calculate a weighted line integral. The integral is calculated by the cells that this lines trasverses (the small cells belong to matrix (m*n) that represent the value that a specific area has. I need to calculate the weights by finding out how much the line touches or

[R] print-show-display a matrix

2010-10-04 Thread Alaios
Hello. I want to print the value a matrix has. The matrix's size is not too big (100*100 cells). I tried print(matrixname) but as it does not fit very well on my screen R splits it into several small matrixes that do overflow my screen. IS it possible somehow to display this matrix as one (even

[R] efficient list indexing

2010-09-22 Thread Alaios
Hello everyone, I need some help with lists inside lists (a good way to emulate a struct)\ Assume that there is a small list called fred: fred - list(happy = 1:10, name = squash) and a big list called bigfred that includes fred list 5 times bigfred - rep(fred,5) Is it possible somehow to

Re: [R] efficient list indexing

2010-09-22 Thread Alaios
news:4c99e118.2010...@pburns.seanet.com... I'm confused by what you are looking for. There's some slight possibility that you are looking for double bracket subscripting with a vector: list(a=1:5, b=letters)[[c(2,4)]] [1] d On 22/09/2010 10:58, Alaios wrote: Hello everyone, I need some

Re: [R] efficient list indexing

2010-09-22 Thread Alaios
For some reason I did not receive your email. Sorry for the inconvenience caused From: Dennis Murphy djmu...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Wed, September 22, 2010 1:46:28 PM Subject: Re: [R] efficient list indexing Hi: I believe we had this

Re: [R] Interpolate? a line

2010-09-21 Thread Alaios
, Alaios wrote: I would like to thank you again for your help. But it seems that the floor function (ceiling, round too) create more dots in the matrix that line really touches. You said cells not dots. Are you trying to change the problem now? My concern is rather that it can still miss cells

[R] Indexing sublists inside lists.

2010-09-21 Thread Alaios
: Re: [R] Object oriented programming in R. On Sep 14, 2010, at 9:29 AM, Alaios wrote: I would like to thank you very much all that you helped me so far. So I tried to check how the following works fred - list(happy = 1:10, name = squash) rep(fred, 5) This returns the following : fred[1

Re: [R] Interpolate? a line

2010-09-17 Thread Alaios
I would like to thank you again for your help. But it seems that the floor function (ceiling, round too) create more dots in the matrix that line really touches. unique( floor( cbind( seq(2,62, by=0.1), linefn(seq(2,62, by=0.1)) ) ) ) You can see that in the picture below

[R] count frequency

2010-09-17 Thread Alaios
Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,] 59 32 [581,] 60 32 [582,] 60 33 [583,] 60 33 [584,] 60 33 [585,] 60 33 [586,] 60 33 [587,] 60

Re: [R] count frequency

2010-09-17 Thread Alaios
17 29 18 18 30 19 19 29 20 20 29 Best Regards Alex From: Jorge Ivan Velez jorgeivanve...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Fri, September 17, 2010 4:24:59 PM Subject: Re: [R] count frequency Alaios, Try as.data.frame(table(x[,1

Re: [R] count frequency

2010-09-17 Thread Alaios
My bad :( unfortunately does not work correct. This is some of the output of the table .. [494,] 50 27 [495,] 50 27 [496,] 50 27 [497,] 50 28 [498,] 50 28 [499,] 50 28 [500,] 50 28 [501,] 51 28 [502,] 51 28 [503,] 51 28 [504,] 51 28 [505,]

Re: [R] count frequency

2010-09-17 Thread Alaios
You are pretty good. Worked nicely :) Thanks! Alex From: Henrique Dallazuanna www...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Fri, September 17, 2010 4:58:50 PM Subject: Re: [R] count frequency So try this : aggregate(rep(1, nrow(x)),

[R] help me understand how things work.

2010-09-16 Thread Alaios
Hello I have some strange output from R and I try to understand how R works. Could you please help me with that? temp - rbind (c(10,1),c(99,98)) temp [,1] [,2] [1,] 101 [2,] 99 98 dist(temp) 1 2 131.6435 sqrt(dist(temp)) 1 2 11.47360 so far so good.

Re: [R] help me understand how things work.

2010-09-16 Thread Alaios
, September 16, 2010 1:28:31 PM Subject: Re: [R] help me understand how things work. ?dist BTW, to me this does not happens. x - matrix(rnorm(100), nrow=5) d - dist(x) 1/sqrt(d) 1/sqrt(dist(x)) Hope it helps mario On 16-Sep-10 12:02, Alaios wrote: Hello I have some

[R] Interpolate? a line

2010-09-15 Thread Alaios
Hello everyone. I have created a 100*100 matrix in R. Let's now say that I have a line that starts from (2,3) point and ends to the (62,34) point. In other words this line starts at cell (2,3) and ends at cell (62,34). Is it possible to get by some R function all the matrix's cells that this

Re: [R] Interpolate? a line

2010-09-15 Thread Alaios
Thank you very much. I am trying to execute it line by line to get some understanding how this works. Could you please explain me what these two lines do? tie - m[,2] == c(-Inf, m[-nrow(m),2]) m - m[ !tie, ] I would like to thank you in advance for your help Best Regards Alex

[R] Object oriented programming in R.

2010-09-14 Thread Alaios
Hello everyone. I would like to create many objects with R. Does R support objects? The number of objects needed is not predetermined and it is a parameter specified by the user. If the user selects to create many objects like 100, would it be possible to handle each one by some index? I would

Re: [R] Object oriented programming in R.

2010-09-14 Thread Alaios
: Tue, September 14, 2010 10:11:36 AM Subject: Re: [R] Object oriented programming in R. Hello Alaios, I see a bunch of good materials here: http://www.google.co.il/search?sourceid=chromeie=UTF-8q=Object+oriented+programming+in+R Did you look into them ? Contact Details

Re: [R] Object oriented programming in R.

2010-09-14 Thread Alaios
Regards Alex From: Tal Galili tal.gal...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Tue, September 14, 2010 10:11:36 AM Subject: Re: [R] Object oriented programming in R. Hello Alaios, I see a bunch of good materials here: http://www.google.co.il/search

Re: [R] Object oriented programming in R.

2010-09-14 Thread Alaios
. Hello Alaios, I see a bunch of good materials here: http://www.google.co.il/search?sourceid=chromeie=UTF-8q=Object+oriented+programming+in+R R Did you look into them ? Contact Details:--- Contact me: tal.gal

[R] Line integral with R

2010-09-13 Thread Alaios
Hello. I would like to calculate with R the weighted line integral of a loss field. Where should I start searching about weighted integration in R? I would like to thank you in advance for your help Best Regards Alex [[alternative HTML version deleted]]

[R] print matrix values and if statement

2010-09-13 Thread Alaios
Hello everyone, I have a 2x2 matrix filled with zeros and some more values around zeros. I would like to print only the non-zero values and to keep the coords of the places that the values are not zero. Could you please help me with that? I would like to thank you in advance for your help

[R] array of objects

2010-09-13 Thread Alaios
Hello everyone. I would like to create some agents that span over a specific area map.Every agent needs to have its own data structures like one or two matrices and one list. I think that the best way to do this is to create objects and every instance of an object will be used for a single

[R] See what is inside a matrix

2010-09-09 Thread Alaios
Hello everyone.. Is there any graphical tool to help me see what is inside a matrix? I have 100x100 dimensions matrix and as you already know as it does not fit on my screen R splits it into pieces. I would like to thank you in advance for your help Best Regards Alex

[R] Uniform Distribution

2010-09-08 Thread Alaios
Hello, I would like to uniformly distribute values from 0 to 200. Can someone help me find the appropriate uniform distribution generator? I would like to thank you in advance for your help. Best Regards Alex [[alternative HTML version deleted]]

Re: [R] Uniform Distribution

2010-09-08 Thread Alaios
Subject: Re: [R] Uniform Distribution On Wed, 2010-09-08 at 06:36 -0700, Alaios wrote: Hello, I would like to uniformly distribute values from 0 to 200. Can someone help me find the appropriate uniform distribution generator? I would like to thank you in advance for your help. Best

[R] Matrixes inside matrixes

2010-09-08 Thread Alaios
Hello everyone, Could you please help me find out if R supports matrixes inside matrixes? This is what I would like to do I have an area map of humidity per km. I would like at every cell to keep also information about the height of this area, the current temperature etc. Is something like

[R] How do u create a virtual map?

2010-09-07 Thread Alaios
Hello everyone. I would like to simulate a small map area and store information regarding it. I am trying to find out what might be the best way to do that and I need some feedback, as you might be more experienced. Usually a map can be described by a k * m dimensions matrix where every cell

[R] Two images functions

2010-09-06 Thread Alaios
Hello everyone. I would like to ask you what happens when two functions with the same name exist. I discovered this today when I wrote ?images (I was trying to understand how it works) ?images gave me the following output: Help on topic 'image' was found in the following packages: Image (in

[R] How R converts data between objects

2010-09-06 Thread Alaios
Hello everyone. I would kindly request your help concerning how R converts data between different structrures. In the following example please keep attention on the following two 1) I create f - GaussRF(x=x, y=y, model=model, grid=TRUE,param=c(mean, variance, nugget, scale, alpha)) with

[R] Installing packages and passing parameters

2010-08-05 Thread Alaios
Hello I am trying to install the RandomFields package by using install.packages(RandomFields) but the process fails. I think that if I pass to the g++ compiler the -lgfortran option might work. Could you please help me do this? I would like to thank you in advance for your help Best Regards

[R] georR package users

2010-08-02 Thread Alaios
Greeting to everyone. I am looking for geoR users In geoR package there is a function called grf() According to the geoR short manual grf() takes the following arguments * n number of points (spatial locations) in each simulations. * grid optional. An n × 2 matrix with coordinates of

[R] Question about geoR package.

2010-07-29 Thread Alaios
Hello in geoR package there is a function called grf() According to the geoR short manual grf() takes the following arguments * n number of points (spatial locations) in each simulations. * grid optional. An n × 2 matrix with coordinates of the simulated data. * nx

Re: [R] Beginner stucked with raster + geoR package.

2010-07-29 Thread Alaios
. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jul 28, 2010, at 6:53 PM, Alaios wrote: Can someone help me please with step 5? r - setValues(r,temp) # Unfortunately this ends with the message: Error in setValues(r, temp) : values must be a vector

[R] Understanding how R works

2010-07-28 Thread Alaios
Hello everyone. I am more than new into R. Today I have started reading about grf function that is included in geoR package. According the manual (vignette?) grf() generates (unconditional) simulations of Gaussian random fields for given covariance parameters. geoR2RF converts model

[R] Beginner stucked with raster + geoR package.

2010-07-28 Thread Alaios
Hello everyone. I am trying to build up understanding in R by trying to develop just some simple scenarios. I would like to explain you what I am trying to do and what I did so far. I would like to put inside a RasterLayer (raster package) a Gaussian field (for given covariance) using grf

Re: [R] Beginner stucked with raster + geoR package.

2010-07-28 Thread Alaios
Can someone help me please with step 5? r - setValues(r,temp) # Unfortunately this ends with the message: Error in setValues(r, temp) : values must be a vector How to make temp a vector? To: r-help@r-project.org Sent: Wed, July 28, 2010 3:55:54 PM Subject:

[R] Creating a map .

2010-07-26 Thread Alaios
Hello. I would try to explain what I would like to implement so to suggest me what to try out. I would like to create an area of X*X km that would be used to Simulate an area map (eg. city's area, suburban area). -X would be a parameter so I do not want it to be fixed -In this map I would

[R] what is a vignette?

2010-07-26 Thread Alaios
I am trying to find a simple R guide that explain what a vignette is but so far I didnt make any progress. I tried to search inside R's built in help.start() but it only returns results how to see vignettes. So could you please tell me what a vignette is and if you can also could you give some

[R] = vs - operator

2010-07-26 Thread Alaios
Hello I notice that in Linux the = operator works like the - operator So a=3 is similar to a-3. Could you please verify me that is correct? I would like to use = operator. Do you think that might be a problem in the future? Best Regards Alex __

[R] Syntax Highlightning and Editor for Linux

2010-07-23 Thread alaios
Hello to the community . First post :) I would like to ask you which text editor do you use in Linux and how did you setup the syntax highlightning? one more question is it possible to debug any program in R by inserting breakpoints? I would like to thank you in advance for your help Best

Re: [R] Syntax Highlightning and Editor for Linux

2010-07-23 Thread Alaios
that are inside the file without executing the source(myfile.R) command first? Best Regards Alex - Original Message From: Duncan Murdoch murdoch.dun...@gmail.com To: alaios ala...@yahoo.com Cc: r-help@r-project.org Sent: Fri, July 23, 2010 2:13:48 PM Subject: Re: [R] Syntax Highlightning

Re: [R] Syntax Highlightning and Editor for Linux

2010-07-23 Thread Alaios
/article/using-gedit-or-rgedit-r simple send code to terminal shortcuts (much simpler than emacs, in my [[elided Yahoo spam]] /federico On Fri, Jul 23, 2010 at 2:42 PM, Rainer M Krug r.m.k...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/07/2010 14:17, Alaios wrote: I

<    1   2   3   4   5