Re: [R] R Cairo Installation - Cannot find cairo.h!

2014-04-30 Thread Jose-Marcio Martins
${HOME}/usr/local/lib export CAIRO_CFLAGS=-I${HOME}/usr/local/include Regards, José-Marcio __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] Package name

2013-01-31 Thread Marcio Pupin Mello
I'm not sure, but would recommend not to. -- Marcio www.dsr.inpe.br/~mello On 31/01/2013 04:26, Ortiz, John wrote: Dear list, Can I use a character to set the name of a R package? like this (-) for example (sdp-R) Thanks, John __ R-h

Re: [R] Fine Tuning Country Map

2012-11-26 Thread Marcio Pupin Mello
ngle value is given, it is used for both margins; if two values are given, the first is used for x- distance, the second for y-distance." Good luck! Marcio www.dsr.inpe.br/~mello On 8/13/12 11:33 PM, Lorenzo Isella wrote: Dear All, Please see the short script at the en

Re: [R] Mixed Models providing a correlation structure.

2012-07-11 Thread Marcio
Dear Simon, Thanks for the quick reply. Unfortunately I don't have access to Pinheiro and Bates. I tried googling the pdSymm and lme but I still cannot get the syntax right. In my model, I only have 1 random factor with repetitions (groups) (e.g. 2 records per each level) I am pasting bellow a ver

[R] Mixed Models providing a correlation structure.

2012-07-05 Thread Marcio
Hi folks, I was wondering how to run a mixed models approach to analyze a linear regression with a user-defined covariance structure. I have my model y = xa +zb +e and b ~ N (0, C*sigma_square). (and a is a fixed effects) I would like to provide R the C (variance-covariance) matrix I can easi

Re: [R] Interface or Select menu

2012-03-13 Thread Marcio Pupin Mello
For Windows you can use winMenuAdd function. Type ?winAddMenu to see how... Good luck, Marcio www.dsr.inpe.br/~mello On 3/6/08 10:35 AM, Alberto Monteiro wrote: er MIMI& piki PIKINHA wrote: Hello, I´m spanish student, and I´m making the finish project of computer science. I´m working

Re: [R] Frequencies from x/y data into a 2d table (for 3d histogram or heatmap)

2012-02-29 Thread Marcio Pupin Mello
Hi David, thanks a lot! Actually, I was looking for the graph since I still have obtained the table... but It can help... Best, Marcio www.dsr.inpe.br/~mello On 2/29/12 5:34 PM, David L Carlson wrote: Something like this? x<- round(runif(100, 0, 40), 0) y<- round(runif(100, 0,

Re: [R] Frequencies from x/y data into a 2d table (for 3d histogram or heatmap)

2012-02-29 Thread Marcio Pupin Mello
Hi Ralf, have you solved your problem?! If so, could you share? I have the same problem... Best, Marcio On 3/25/10 6:03 PM, Ralf B wrote: Hi all, I have simple x/y data from screen recording in a sequence: number,x,y 1,10,30 1,20, 1,43,110 1,74,18 1,88,112 and would like

Re: [R] how to solve a simple discrete Bayesian Belief Network?

2011-09-28 Thread Marcio Pupin Mello
"L","R","H","D"),states=c("F","F","T","T","T")) querygrain(setFinding(BN,nodes=scenaria.q2$nodes,states=scenaria.q2$states),nodes="S") #answering the 3rd question: # what is the probability of what is

Re: [R] compute probabilities on a Bayesian Network (SOLVED)

2011-09-28 Thread Marcio Pupin Mello
,nodes=scenaria.q1$nodes,states=scenaria.q1$states),nodes="S") #answering the 2nd question: # what is the probability of S=T given C=F, L=F, R=T, H=T, and D=T? scenaria.q2<-list(nodes=c("C","L","R","H","D"),states=c("F","F

[R] how to solve a simple discrete Bayesian Belief Network?

2011-09-28 Thread Marcio Pupin Mello
lProb(cnet,node=1)[1] #0.2 #what is the probability of b="2"? cnNodeMarginalProb(cnet,node=2)[2] #0.56 #what is the probability of c="1"? cnNodeMarginalProb(cnet,node=3)[1] #0.428 #but how can I answer questions like: #what is the probability of a="1" given that c

[R] compute probabilities on a Bayesian Network

2011-09-26 Thread Marcio Pupin Mello
orks to compute the results but I don't know how to do it with R. Looking forward to receiving replies! Thanks in advance, Marcio Pupin Mello __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Marcio
Hi djmuseR, I tried installing and running the script that you suggested. But with every value I tried for a, b, c and d I get one of those 2 error messages Error in nls(y ~ a - b * exp(-c * x^d), start = list(a = 10, b = 30, c = 0.4, : singular gradient Error in numericDeriv(form[[3L]], name

Re: [R] Fitting my data to a Weibull model

2011-08-31 Thread Marcio
Thanks for the answers. Indeed, I wrote wrong in my examples the variables x and y I meant to say > y <- c(1,7,14,25,29,30) > x <- c(1,2,3,4,10,20) Thanks -- View this message in context: http://r.789695.n4.nabble.com/Fitting-my-data-to-a-Weibull-model-tp3780169p3781746.html Sent from the R h

[R] Fitting my data to a Weibull model

2011-08-30 Thread Marcio
Hi guys, I have a data-set that fits well into a Weibull model y = a-b*exp(-c*x^d). I want to estimate the parameters of the coefficients a, b, c and d, given x and y. Can you guys help me? Just as an example, I fit the data y <- c(1,2,3,4,10,20) and x <- c(1,7,14,25,29,30) According to this mod

Re: [R] "useR! 2011" T-shirt competition

2011-05-27 Thread Jose-Marcio Martins da Cruz
David Firth wrote: Dear R users: It is planned that participants in the R User Conference, useR! 2011 (August 16-18, http://R-project.org/useR-2011) will each receive a Better : http://www.R-project.org/useR-2011 __ R-help@r-project.org mailin

Re: [R] How to extract information from the following dataset?

2011-05-12 Thread Jose-Marcio Martins da Cruz
Xin Zhang wrote: Hi all, I have never worked with this kind of data before, so Please help me out with it. I have the following data set, in a csv file, looks like the following: Jan 27, 2010 16:01:24,000 125 - - - Jan 27, 2010 16:06:24,000 125 - - - Jan 27, 2010 16:11:24,000 176 - - - Jan 2

Re: [R] How can I include a new book on the

2011-04-11 Thread Marcio Pupin Mello
It's there. Thank you Ben and also Kurt! Best, Marcio Em 4/7/2011 10:19 AM, Marcio Pupin Mello escreveu: Thanks Ben! I will! Em 4/7/2011 8:32 AM, Ben Bolker escreveu: Marcio Pupin Mello ieee.org> writes: I've just published a new book for R beginners in Portuguese: "C

Re: [R] package

2011-04-07 Thread Marcio Pupin Mello
See http://cran.opensourceresources.org/web/packages/index.html -- Marcio Pupin Mello Survey Engineer Ph.D student in Remote Sensing National Institute for Space Research (INPE) - Brazil Laboratory of Remote Sensing in Agriculture and Forestry (LAF) www.dsr.inpe.br/~mello Em 4/7/2011 10:59 AM

Re: [R] Time series of spatial data

2011-04-07 Thread Marcio Pupin Mello
luck! -- Marcio Pupin Mello Survey Engineer Ph.D student in Remote Sensing National Institute for Space Research (INPE) - Brazil Laboratory of Remote Sensing in Agriculture and Forestry (LAF) www.dsr.inpe.br/~mello Em 4/7/2011 7:38 AM, idham escreveu: Hi guys, I'm really new in R. Tryi

Re: [R] How can I include a new book on the

2011-04-07 Thread Marcio Pupin Mello
Thanks Ben! I will! Em 4/7/2011 8:32 AM, Ben Bolker escreveu: Marcio Pupin Mello ieee.org> writes: I've just published a new book for R beginners in Portuguese: "Conhecendo o R: uma visão estatística" (something like "Knowing R: an statistical approach"). I'

Re: [R] force output dimension of table function

2011-04-07 Thread Marcio Pupin Mello
You can do it using factor: s0<-factor(0:5) s1<-sample(s0,5,re=T) s1 [1] 0 2 2 4 0 Levels: 0 1 2 3 4 5 table(s1) s1 0 1 2 3 4 5 2 0 2 0 1 0 Good luck! -- Marcio Pupin Mello Survey Engineer Ph.D student in Remote Sensing National Institute for Space Research (INPE) -

[R] How can I include a new book on the "Books" link at R-project.org ?

2011-04-07 Thread Marcio Pupin Mello
More informations about the book at http://www.editoraufv.com.br/produtos/conhecendo-o-r -- Marcio Pupin Mello Survey Engineer Ph.D student in Remote Sensing National Institute for Space Research (INPE) - Brazil Laboratory of Remote Sensing in Agriculture and Forestry (LAF) www.dsr.inpe.br/~mello ___

Re: [R] use of ROCR package (ROC curve / AUC value) in a specific case versus integral calculation

2011-03-13 Thread Jose-Marcio Martins da Cruz
them, you can sort them by their scores and enumerate the number of couples out of order you can get. Hope this help. José-Marcio -- ------- Jose Marcio MARTINS DA CRUZ http://j-chkmail.ensmp.fr Ecole des Mines de Paris

Re: [R] calculate phase/amplitude of fourier transform function in R

2011-02-13 Thread Jose-Marcio Martins da Cruz
sammyny wrote: I did a fourier transform on a function in time domain to get the following functions in frequency domain (in latex): $Y_1[\omega] = \frac{1}{1-\phi_1 e^{-jw}}$ $Y_2[\omega] = \frac{1}{1-(\phi_1 + \phi_2)e^{-jw} +\phi_1\phi_2e^{-2jw}}$ How do I find the spectrum of this functio

Re: [R] Time unit in ts() and arima() functions

2011-02-12 Thread Jose-Marcio Martins da Cruz
Thanks for the hint. Helped a lot Gabor Grothendieck wrote: On Sat, Feb 12, 2011 at 7:48 AM, Jose-Marcio Martins da Cruz Functions which work with ts typically assume that a full cycle is represented by 1 unit so if a full cycle is a week then a week must be one unit and a day must be 1

[R] Time unit in ts() and arima() functions

2011-02-12 Thread Jose-Marcio Martins da Cruz
This question is surely trivial, sorry. I'm afraid I'm misunterpreting the information I got with the documentation, and I'm a little bit confused. I'm just an engineer with some little skills in statistics. Well, I have a time series - 600 days long - with some weekly periodicity inside. So

Re: [R] predict and arima

2011-02-09 Thread Jose-Marcio Martins da Cruz
D=1 and select d using ndiffs and the KPSS test # for stationarity. # ... if no model can be found - return NULL -- ------- Jose Marcio MARTINS DA CRUZ http://j-chkmail.ensmp.fr Ecole des Mines de Paris 60, bd Saint Mi

Re: [R] predict and arima

2011-02-08 Thread Jose-Marcio Martins da Cruz
I think ther's a bug here : bdp wrote: Some code I have been playing with to do this follows ... get.best.arima<- function(x.ts, minord=c(0,0,0,0,0,0), maxord=c(2,1,1,2,1,1)) { # function based on 'Introductory Time Series with R' best.aic<- 1e8 # a big number n<- leng

[R] How to sum only a few elements in a line

2009-11-25 Thread Marcio Resende
Hello, I have a matrix with the numbers 0,1 and 9 I would like to write a function that could sum each line skiping everytime a number 9 appears for example [0 1 0 1 1 9 1] the sum would be 4. However I cannot replace 9 by 0 otherwise after the sum is done I wouldn´t be able to distiguish which o

[R] Is there a faster way to do it?

2009-10-28 Thread Marcio Resende
#Mdarts is a matrix 2343x788 #frequencia is a vector 2343x1 # 9 in Mdarts[fri,frj] stands for my missing values which i want to replace by the value in the vector frequencia Mdarts<-t(matrix(scan("C:/GWS/CNB/dartg.txt"),ncol=nindT,nrow=nm, byrow=T)) frequencia <- matrix(scan("C:/GWS/CNB/freq.txt

[R] Sampling procedure

2009-10-15 Thread Marcio Resende
I would like to divide a vector in 9 groups in a way that each number is present in only one group. In a vector of 783 I would like to divide in 9 different groups of 87 Example <- matrix(c(1:783),ncol = 1) s1 <- as.matrix(sample(Example,87, re = FALSE)) Example <- Example[-s1] s2 <- as.matrix(sa

[R] help with loops

2009-10-14 Thread Marcio Resende
Hi guys, my doubt is quite simple, I´ll try to explain: test = matrix(0, nrow = 783, ncol = 12) for (x in 1:9){ for (y in 1:12){ ### In the original script for each y its generated a vector (87x1) ### 87 times 9(x) = 783 (equals the number of rows I want to fill in the "test" matrix } } W

[R] Count number of zeros in a collumn

2009-09-27 Thread Marcio Resende
I have a matrix 700x2000 which is sampled in each cycle from another matrix 788x2000 with the numbers 0,1 and 9 There is one specific collumn of this matrix, dart[,1977], that usually, after the samplimg procedure has only 1 and 9 (because the zero frequency in this collumn is low). However, when

Re: [R] Check value interval in a if loop

2009-09-27 Thread Marcio Resende
Hi Lucas, try: if(pvalue>0.05 & pvalue<0.1) HTH Marcio Lucas Sevilla García wrote: > > > Hi R community > > I have a little problem, and I tried to solve it by myself but I couldn't. > I building an if loop, and I want to check a value inside an i

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
g it to do with the script you > provided. > > On Sun, Sep 27, 2009 at 10:09 AM, Marcio Resende > wrote: >> >> Hi Tobias, thanks for the help, >> the code I am using is quite long, but basically what I tried to do was >> >> test <- matrix(0,6,1) &g

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
Hi Tobias, thanks for the help, the code I am using is quite long, but basically what I tried to do was test <- matrix(0,6,1) x <- matrix( c(50,100,200,300,900,2343) ,ncol = 1) for (i in x){ test [i] <- (i) } but this code returns NA for all the elements which are not x Tobias Verbeke-2 w

Re: [R] Teach me how to transpose in R

2009-09-27 Thread Marcio Resende
Hi Hyo, I am kinda of new in R but I think if you use x <- as.matrix(data2) #with the numer of collumns you wish y <- t(x) it should work Hope I´ve helped Márcio Hyo Lee wrote: > > Hi guys, > I need your help!! > > My goal is to make a csv file from ncdf file. > This is the code i've used

[R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
Hi nice people, I would like to do a for cycle but i wish it to assume only the numers 50, 100, 200, 300, 900 and 2343 I tried to do something like x <- c(50,100,200,300,900,2343) for (i in x){ #. } But it didn´t work Could anybody help me? Thanks in advance Marcio -- View this message

[R] Sum of Product in a Matrix

2009-09-22 Thread Marcio Resende
Hi, I am new in R and I don´t know how to sum the product of two elements at the time in a matrix X=[ 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16] I would like to do (1*5+2*6+3*7+4*8) I need to do it step by step because I will further put a conditional in the formula

Re: [R] BLUP with missing data

2009-09-22 Thread Marcio Resende
Sorry, I sent it quickly and forgot to thank in advance Marcio Marcio Resende wrote: > > hello guys, I need to do a BLUP in the simplest model > y = Xm + Zg + e > however I have missing data in the analysis which I can´t consider as > 0(zero). So I need to generate the matrix X

[R] BLUP with missing data

2009-09-22 Thread Marcio Resende
hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can´t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step by step; I can´t use crossprod(x) #neither X'X <- t(x)%*%x because I should skip the element

[R] chage the output file name

2009-09-22 Thread Marcio Resende
After I run my script I save all my output e.g. write.table(d, file = "C:/PINEheight.txt) write.table(v, file = "C:/PINEvolume.txt) write.table(v, file = "C:/PINEdiameter.txt) write.table(v, file = "C:/PINEdensity.txt) and then I would like to run again with another tree and save again e.g write

[R] Incorrect Dimension

2009-09-17 Thread Marcio Resende
I am new in R and i am having trouble here. I´ve already searched in the list but hasn´t helped When i run this script above i get the message "Error in gen[j, i] : incorrect number of dimensions". However gen is 1000x200 (ind x loc) and so is g could anybody help me for (i in 1 : loc) { #l

[R] How to separate a function by 2 probabilities

2009-09-17 Thread Marcio Resende
Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]<-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix) with probability P-1 That´s it,