[R] linking options -lblas

2011-10-22 Thread jgarcia
Hi all, I want to install some packages in R in a computer where I haven't root privilegues, and R is already installed. The system manager is extremely busy and at the moment I'm afraid that I have to manage my own installations. So, I am trying to install 'quadprog' and I'm getting the message:

[R] html help not built

2010-04-07 Thread jgarcia
Hi, I've just installed R 2.10.1 for linux, and html help has not been built (just the index page of each package but not the documentation for the individual functions in the packages. I cannot see any flag in the ./configure to set if html is going to be build. Please could you tell me what

[R] --enable-prebuilt-html

2010-04-07 Thread jgarcia
Hi, Sorry about my last question. I've found the solution in the documentation, and yes; there is a flag in ./configure I did not see. Thanks Javier --- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] html help not built

2010-04-07 Thread jgarcia
Hi Duncan, I must be misunderstanding something. It is not that I want them built at installation time, but when I try to display the html help for any function the html page is not built; e.g. cliking on the link to get() in the base library, the message appears: An error occurred while loading

[R] Selective load of .First() function just for Rgui.exe

2010-02-12 Thread jgarcia
Hi all, I have a .First - function() {...} in the Rprofile.site file. Through .First() I'm adding several menus to the GUI to access several functions I've been developing for own use. However, I also need to launch R scripts silently in a batch way, and in this case I get the error message:

[R] Problem with writeBin and importing into gfortran compiled programs

2010-01-07 Thread jgarcia
Hi all, I'm having problems trying to export binary arrays from R and importing them into fortran (linux openSUSE 10.3 (x86_64), gfortran compiler, fortran 90/95 program). Let's say the problem can be expressed as: R part whini - runif(1000) writeBin(whini,fwhini.dat) f90 part

Re: [R] Problem with writeBin and importing into gfortran compiled programs

2010-01-07 Thread jgarcia
and Duncan, Javier --- jgarcia-2 wrote: f90 part PROGRAM foo INTEGER, PARAMETER :: DP = KIND(1.0D0) INTEGER :: status REAL(DP), DIMENSION(10,100) :: whini OPEN(UNIT=5, FILE='fwhini.dat', STATUS='OLD', ACTION='READ', FORM='UNFORMATTED', IOSTAT=status) READ(5) whini CLOSE

[R] hdf5 package

2009-12-14 Thread jgarcia
Hi all, I'm testing the use of the hdf5 R library under Windows XP. With some simple example (an R list with several subobjects as showed in the examples in the library) the library exports and imports .hdf files adequately. However, if I try to open the exported file with another program

[R] pdf transparency not working with Latex documents

2009-05-09 Thread jgarcia
Hello, I' using the pdf() device with bg=transparent to create plots to be used within a latex (beamer) presentation. Later on, I see that the background of my pdf() graphics is solid white in the final presentation. I'm using R-2.6.0, and I have also tried to set the version argument in pdf()

[R] pdf transparency not working with Latex documents. Solved

2009-05-09 Thread jgarcia
Hi, I've found that after the call to pdf(), I had a posterior line: par(bg=white) that was creating this white background. Setting this to transparent works fine. Thanks, Javier ... Hello, I' using the pdf() device with bg=transparent to create plots to be used within a latex (beamer)

[R] visualization of sub-parts in 3D arrays

2009-05-07 Thread jgarcia
Hello all; Let's say we have a block of 3D data belonging to cubic cells, and increasing indexes are ordered x: from west to east y: from north to south z: from top to bottom --- nx - 25 ny - 12 nz - 4 my.array - array(NA,dim=c(nx,ny,nz)) for(z in 1:nz){ my.array[,,z] - runif(nx*ny,z-1,z)

Re: [R] send command to other program

2009-04-29 Thread jgarcia
Hi, Consider also that you may easily modify system names from inside your R script as: system(mv oldname newname) Best Regards, Javier ... thoeb wrote: Hello, does anybody know about how to send a command or a text line from R to another program? I have written a script in which several

Re: [R] how to split and handle a big R program into multiple files

2009-04-23 Thread jgarcia
source() and the use of functions ... Javier --- I am working on a program totally written in R which is now getting bigger and bigger so that editling the only file that contains all the functions is becoming more and more unmanageable. I wonder whether it is possible to spread the R code,

Re: [R] Mapping in R

2009-03-31 Thread jgarcia
It is relatively easy to do a small function for this in R: a) select the desired width for your border b) through a fix number or through the use of pretty(), establish the number of rectangles you want along your border. Then e.g., you can use rect() you build the sequence of black-white

[R] snow Error.

2009-03-27 Thread jgarcia
Hello, I have a program that used to run well in October, it uses library snow. Since then, one change has ocurred (snow library has been updated) and another could have ocurred (I've unadvertently modified something). Anyway, now when I make the call: parallel.model.results -

Re: [R] R: Fortran-90 and R

2009-03-26 Thread jgarcia
Perhaps you should consider also the possibility of simply export the data from the R workspace to the system and make your fortran code to read these system files. On Thu, 2009-03-26 at 11:01 +0100, mau...@alice.it wrote: I do hope the chapte about Interfacing R and Fortran is sufficient. I

[R] sink() within a loop

2008-11-05 Thread jgarcia
Hello; It seems to me that this could even by a FAQ, but I cannot find an answer: Why a piece of code that uses sink() does not sinks anything if it is executed within a for loop? Thanks, Javier __ R-help@r-project.org mailing list

Re: [R] sink() within a loop

2008-11-05 Thread jgarcia
Well, I'll put a foo example of my problem: I'got a list: a - list() a$sublist.1 - list() a$sublist.1$subsublist.1 - list() this code works: zz - file(foo.txt,w) sink(zz) a sink() close(zz) and generates a correct foo.txt file containing the structure of the list but this code doesn't:

Re: [R] sink() within a loop. Solved

2008-11-05 Thread jgarcia
Uwe; sorry for my last mail. In effect, as you say ,I just needed to explicitly print() the object to be sinked within the loops. Thanks you, Javier [EMAIL PROTECTED] wrote: Hello; It seems to me that this could even by a FAQ, but I cannot find an answer: Why a

[R] torque/psb snow library

2008-10-22 Thread jgarcia
Hello all; I'm trying to execute parallel jobs trough library snow on a cluster built through torque/PSB. I'm succesfully obtaining the cluster with: system(cat $PBS_NODEFILE cluster.txt) mycluster - scan(file=cluster.txt,what=character) cl - makeSOCKcluster(mycluster) The only problem, at the

Re: [R] torque/psb snow library

2008-10-22 Thread jgarcia
Thanks you! I'll look at this new list! Well, I'm not the system administrator, and my installation of Rmpi and/or pvm libraries for R crashes. As this is the first time I parallelize some jobs, snow appealed as a first approach because 1) it compiled correctly and 2) the use of the library is

Re: [R] runs of heads when flipping a coin

2008-10-09 Thread jgarcia
It seems to me that you are asking for: hhh - 0.1 sum(dbinom(x=0:50,size=500,prob=hhh)) [1] 0.5375688 You can use 'sample' and 'rle': x - sample(c(H,T), 500, replace=TRUE, prob=c(.95, .05)) as.data.frame(unclass(rle(x))) lengths values 1 12 H 21 T 3

[R] extracting a subset of sublists form a list; vectorized form

2008-10-08 Thread jgarcia
Hello; I'll put my real problem through a simple example: I've got a main list: main.lst - lst() With a number of sublists: for(i in 1:1000){ main.lst[[i]] - list() main.lst[[i]]$first - runif(1,0,1) main.lst[[i]]$second - runif(2,3,4) } If later on I need to split this list, how

[R] Query about computational demand

2008-10-06 Thread jgarcia
Hi all; I've programmed a couple of C libraries which are loaded dynamically into R (Linux). With one of these, I'm conducting Monte Carlo analysis, but every individual execution of my model is about 15'. So, I'm running 1000 executions in about 11 days. This is not enough for my needings, as I

Re: [R] effective matrix subset

2008-08-10 Thread jgarcia
Patrick, you have misundertood me, I mean that Dan's solution (which is also your solution) are both: a) more clear and elegant b) more time efficient. I've checked it with my working 1*3000 element matrixes. The improvement in speed with your solution is evident. I do not advise at all to

[R] effective matrix subset

2008-08-09 Thread jgarcia
Hi; If we have a matrix A, and a vector X, where length(X)=nrow(A), and X contains a wanted column for each row in A, in row ascending order. How would be the most effective way to extract the desired vector V (with length(V)=nrow(A))? Wishes, Javier

Re: [R] effective matrix subset

2008-08-09 Thread jgarcia
It seems that this solution provided by Dan (and also available in SPoetry; I'm sorry I didn't notice it) is the fastest and simplest. I was using a more standard approach: V - t(A)[(0:(nrow(A)-1))*ncol(A)+X], That wasn't bad, but I was confident that you, R gurus, could outperform this. This is

[R] a little help for compiling R!

2008-08-06 Thread jgarcia
Hi; I'm trying to install R in a computer in which I have only non-root access, and I've got readline in a local own directory. I cannot find my way to compile with readline. I've tried: [sun2]/global/jgarcia/SRC/R/R-2.7.1: ./configure --prefix=/global/jgarcia/BIN/R --with-readline-includes

[R] a little help for compiling R! - DISREGARD!

2008-08-06 Thread jgarcia
non-root access, and I've got readline in a local own directory. I cannot find my way to compile with readline. I've tried: [sun2]/global/jgarcia/SRC/R/R-2.7.1: ./configure --prefix=/global/jgarcia/BIN/R --with-readline-includes=/global/jgarcia/BIN/readline/include --with-readline-libs

Re: [R] Turn any vector

2008-07-10 Thread jgarcia
rev(1:10) [1] 10 9 8 7 6 5 4 3 2 1 Javier Dear R-users, I'd like to turn a vector so it starts with it's end. For better understanding, this set of commands will do what I need: i - seq(1:10) i_turned - i for (j in 1:length(i)) i_turned[j] - i[length(i)-j+1] now,

[R] extracting elements from a list in vectorized form

2008-07-01 Thread jgarcia
Hi; It seems to me that has probably been asked in the past. But I cannot find the track. I usually need to extract elements from a list and contruct vector from them; e.g., to create a table. Perhaps there is a way to directly extract them without looping? Simple example: S.lst $sublist.1

Re: [R] extracting elements from a list in vectorized form

2008-07-01 Thread jgarcia
Perfect!! Thanks a lot! Javier --- [EMAIL PROTECTED] wrote: Hi; It seems to me that has probably been asked in the past. But I cannot find the track. I usually need to extract elements from a list and contruct vector from them; e.g., to create a table. Perhaps there is a way to

Re: [R] Recoding

2008-06-28 Thread jgarcia
Agustín; also you can do: v - c(1,1,1,2,3,4,1,10,3) dict - cbind(c(1,2,3),c(1001,1002,1003)) v - ifelse(!is.na(match(v,dict)),dict[match(v,dict),2],v) v [1] 1001 1001 1001 1002 10034 1001 10 1003 Javier - Dear Agustin, Perhaps v1 - c(1,1,1,2,3,4,1,10,3)

[R] subset with multiple criteria

2008-06-23 Thread jgarcia
This should be theoretically very simple, but I dont get the elegant answer (without looping). I've got a long (thousands of rows) data frame: E.coor[1:10,] east north dat 1 582650 4248850 0.8316848 2 582750 4248850 0.7230272 3 582850 4248850 0.3250818 4 582950 4248850

Re: [R] subset with multiple criteria

2008-06-23 Thread jgarcia
Thanks for your answers. I'm sorry. I'm afraid I didn't pose correctly the question , and the use os subset was misleading. What I need is to obtain the index of the corresponding rows in E.coor, to subtitute the corresponding values by new updated values. The closest answer to what I really need

[R] uncertainty bounds for a weighted moving average

2008-06-13 Thread jgarcia
Hi, well; this is not a R-specific question. But perhaps you can help. If I've got an irregularly sampled time series, and conduct a moving average filter (e.g., with a triangular kernel), how could the uncertainty bounds be calculated? Thanks and best regards J. ---

[R] library(Matrix) and image() colors?

2008-05-28 Thread jgarcia
Hi, I'm trying to produce a plot of an image of a Matrix, but I don't get other colors than the default grey scale: image(Matrix(topo.matrix.2),col.regions=topo.colors(100),colorkey=FALSE) this still is plotted in grey. Is there any mistake in my syntax? Thanks and regards, Javier --

[R] spatial cross-correlation

2008-04-01 Thread jgarcia
Hi; I cannot find in the R html documentation a way to evaluate cross-correlation in 2D data sets. I would like to evaluate cross-correlation in a series of moving windows between two maps. i,e, specify several windows inside the complete 2D spatial matrixes and for each one ofthese windows

Re: [R] how to plot a map on a non-rectilinear grid

2008-03-18 Thread jgarcia
There is another solution, which depending on the resolution and amount of your data may be useful. You can find through interpolation the corners of four coordinates around any data point that define a four sides polygon. This grid so created does not need to be regular. Then, you can simple call

[R] Help with 'memory not mapped'

2008-03-07 Thread jgarcia
Hi, I'm no expert programmer at all; I'm running an R script (mariam1_2.R). This scripts calls another script, which contains an R function, which .Call some C code. It runs several times without any problem, but sometimes I get the error: --- *** caught segfault *** address 0x1c404ec8, cause

Re: [R] Help with 'memory not mapped'

2008-03-07 Thread jgarcia
Dear Ramon, I'm afraid I'm the author of the C function. Although I'm not a 'real' programmer I need to do some programming in my research work. As you say, I've used MAKEFLAGS=CFLAGS=-O1, and valgrind, with the expression you've said. The content of the log file contains three blocks of the

[R] Error with stop()

2008-02-15 Thread jgarcia
Hello; I've used stop() previously without any problem. Now, I'm using a condition and getting an error when stop() is called. Mi condition is: if(dim(r.temp)[1] != (length(jul.names)+6)) stop(buffered data not available) An the R' response is: source(my_program.R) Error in

[R] basic spatial query

2008-01-28 Thread jgarcia
Hello; Please coud you advise me of a simple way to select points (x,y coordinates) that fall within a polygon. I've got a set of polygons, each one defined by an arbitrary number of points, and several points inside each polygon. I know this is simple with a GIS, but I'd rather do it inside R.

[R] geometric transformation

2008-01-22 Thread jgarcia
Hi everyone, I've got a set of thousands points (2D) located on a pixel image, and I know that four points in this pixels image correspond to four points in a real space on which I need to locate the mapping of all the thousand source points from the pixel set. For this I've got four reference

[R] manual parallel processing

2007-11-22 Thread jgarcia
Hi; I have a R script that includes a call to genoud(); genoud process lasts about 4 seconds, what would be OK if I hadn't have to call it about 2000 times. This yields about 2 hours of processing. And I would like to use this script operationally; so that it should be run twice a day. It seems to