Re: [R] parsing Google search results

2009-11-17 Thread Barry Rowlingson
On Mon, Nov 16, 2009 at 7:29 PM, Philip Leifeld wrote: > Hi, > > how can I parse Google search results? The following code returns > "integer(0)" instead of "1" although the results of the query clearly > contain the regex "cran". > > > address <- url("http://www.google.com/search?q=cran";) >

Re: [R] test for causality

2009-11-17 Thread Pfaff, Bernhard Dr.
> > >Hi useRs.. > >I cant figure out how to test for causality using causality() in vars >package > >I have two datasets (A, B) and i want to test if A (Granger)cause B. >How do I write the script? I dont understand ?causality. How Dear Tobias, have a look at example(causality). A Granger-causal

[R] One basic question - combining two conditions

2009-11-17 Thread Julia Cains
Dear R helpers Suppose I want to use two conditions if (x >= 42) and (x<48) z = 45 else if (x>= 48) and (x<60) z = 14 how do use this "and" operator to combine two conditions. I am sorry as I know for many of you, this is very basic question but I am new to R and trying to learn it as ear

Re: [R] One basic question - combining two conditions

2009-11-17 Thread Karl Ove Hufthammer
On Tue, 17 Nov 2009 00:26:13 -0800 (PST) Julia Cains wrote: > how do use this "and" operator to combine two conditions. > > I am sorry as I know for many of you, this is very basic question > but I am new to R and trying to learn it as early as possible. The 'and' operator is called '&' in R.

[R] Marginal Homogeneity tests for sparse matrixes ?

2009-11-17 Thread Tal Galili
Hello people, I am in need for testing Marginal Homogeneity for sparse (more then 2X2) matrixes. After searching, what I found by now is that for more then 2 by 2 matrixes, one turns to "stuart maxwell tests" that are available in two packages: irr - see: stuart.maxwell.mh coin - see: mh_test B

[R] tseries to csv or xls

2009-11-17 Thread Bunny, lautloscrew.com
Hi all, is there a common way to write time series objects generated by ts() to some .csv or .xls. write.table does not work by default since it expects a data.frame which a ts object is not. Therefore write.table creates a data.frame which basically ignores the rows and columns of ts objec

Re: [R] One basic question - combining two conditions

2009-11-17 Thread Peter Dalgaard
Julia Cains wrote: > Dear R helpers > > Suppose I want to use two conditions > > if (x >= 42) and (x<48) > > z = 45 > > else > > if (x>= 48) and (x<60) > > z = 14 > > how do use this "and" operator to combine two conditions. > > I am sorry as I know for many of you, this is very basic ques

Re: [R] One basic question - combining two conditions

2009-11-17 Thread Ted Harding
On 17-Nov-09 08:26:13, Julia Cains wrote: > Dear R helpers > Suppose I want to use two conditions > > if (x >= 42) and (x<48) > > z = 45 > > else > > if (x>= 48) and (x<60) > > z = 14 > > how do use this "and" operator to combine two conditions. > > I am sorry as I know for many of you, thi

[R] Define lm/glm object without evaluating them

2009-11-17 Thread Søren Højsgaard
For e.g. lm/glm type models I would like to separate model specification and model fitting and then only fit the models later 'when data arrives'. To be specific, I would like make a specification like m1 <- lm(rate~conc) m2 <- lm(rate~I(conc^2)) and then later I want to 'put data into' the obje

Re: [R] Paper on data exploration

2009-11-17 Thread Tal Galili
Thank you Alain, This looks very nice. p.s: here is a direct link for downloading the article http://www3.interscience.wiley.com/cgi-bin/fulltext/122683826/PDFSTART -- My contact information: Tal Galili E-mail: tal.gal...@gmail.com Phone number: 972-

Re: [R] tseries to csv or xls

2009-11-17 Thread Gabor Grothendieck
Using the built in AirPassengers data that comes with R this works: > AP12 <- ts(matrix(AirPassengers[], nc = 12, byrow = TRUE), > start(AirPassengers)[1]) > colnames(AP12) <- month.abb > library(zoo) > write.zoo(as.zoo(AP12), sep = ",") "Index","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Se

Re: [R] How to do Hodrick-Prescott Filter in R?

2009-11-17 Thread Gabor Grothendieck
Try: RSiteSearch("hodrick") On Mon, Nov 16, 2009 at 11:55 PM, sdlywjl666 wrote: > Dear All, > How to do Hodrick-Prescott Filter in R? > Thanks! >        [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz

Re: [R] Where are usages like "== 2L" documented?

2009-11-17 Thread Duncan Murdoch
I think your suggestions below indicate a difference in documentation philosophy between us. I believe that things should be documented well in one place, and it should be easy to find that one place; you seem to be suggesting spreading out bits and pieces of documentation to many places. The

Re: [R] Plotting graphs using FOR loop

2009-11-17 Thread Tal Galili
How about: for(i in c(16,24,32,40)) { par(mfrow=c(2,4)) for(j in c(i:(i+7)) { hist(data[,i],main=paste(colnames(data)[i],sep=""),ylab="Frequency",xlim=c(1,5),xlab="Score",ylim=c(0,100)) } png("histogram.png") dev.off() } -- My contact information:

[R] how to get the p-value in ctree?

2009-11-17 Thread Maxl18
Hallo, can anybody tell me how the ctree-algorithm derives the p-value. I read the papers from hothorn, hornik and zeileis, but it is not clear for me how to get the p-value. I derived the teststatistic and want to get the appropriate p-value. As I understand it, the p-value is some kind of norm

[R] Arguments for Plot()

2009-11-17 Thread Yoseph Zuback
Hello, I found a really awesome argument for the plot() function yesterday, I didn't write it down and really regretting it as I can't find the post that has it. I have a plot(e,y) One value really deviates and throws my y-axis off. I know I can do something like this: "x = seq(-0.4, 0.4, lengt

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread ychu066
tried but still doesnt work ... very weird ... ychu066 wrote: > > here is the codes that i tried. > >> png(paste("hist",i,".png",sep="") > + library(lattice) > Error: unexpected symbol in: > "png(paste("hist",i,".png",sep="") > library" >> for(i in 8:153){ > + histogram(~ data[,i] | dat

[R] lattice barchart

2009-11-17 Thread Wilberforce
I have a data frame with two factors and want to create panel barcharts with one factor defining the panels and the other the vertical categories by which I can count the rows of data in each combination of factors. How do I do this? I have been trying to use barchart(~factor1|factor2) but it doe

[R] question on gps.prof in ismev

2009-11-17 Thread Kleinn, Jan
Dear all, I'm trying to produce a log-likelihood profile for a GPD estimate with the ismev package. When following the examples, everything is working fine, i.e. I get a nice parabolic log-likelihood curve. When using my own data (intensity of hurricanes at landfall), the log-likelihood curve look

Re: [R] tseries to csv or xls

2009-11-17 Thread Bunny, lautloscrew.com
thx for the help. write.zoo may help me a lot with some other beginner issues i have, but I need to convert it into a data.frame though. I`d like to write stata files or .xls files and both functions need data.frames as a basis. best matt Am 17.11.2009 um 11:49 schrieb Gabor Grothendieck:

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread Tal Galili
I know how you feel, I came a cross the same problem once, which took sometime to find a solution for. What you need to do is put the hist into a variable and then plot it, for example: library(lattice) for(i in 8:153){ hist.to.plot <- histogram(~ data[,i] | data[,2], data=data,,ylab="Frequenc

Re: [R] Arguments for Plot()

2009-11-17 Thread Tal Galili
Do you mean maybe: plot(x, ylim= range(x) ) ? -- My contact information: Tal Galili E-mail: tal.gal...@gmail.com Phone number: 972-52-7275845 FaceBook: Tal Galili My Blogs: http://www.talgalili.com (Web and general, Hebrew) http://www.biostatistics

Re: [R] in excel i can sort my dataset, what do i use in R

2009-11-17 Thread Paul Hiemstra
Hi, Take a look at sort_df from the reshape package. cheers, Paul frenchcr schreef: In excel a handy tool is the sort data by column ...i.e. i can highlight the whole dataset and sort it according to a particular column...like sort the data in a column in acending or decending order where all

Re: [R] Plotting Histogram using histogram() and for loop and Iwant to save the histogram individually ... HELP

2009-11-17 Thread Colin Millar
Or alternatively store as a list and export later if you want ... after some tidying ... library(lattice) columns <- 8:153 plots <- vector("list", length(columns)) j <- 0 for (i in columns) { plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2], ylab = "Frequency", xlab = "S

Re: [R] tseries to csv or xls

2009-11-17 Thread Gabor Grothendieck
Try this: > as.data.frame(AP12, row.names = as.character(time(AP12))) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1949 112 118 132 129 121 135 148 148 136 119 104 118 1950 115 126 141 135 125 149 170 170 158 133 114 140 1951 145 150 178 163 172 178 199 199 184 162 146 166 1952 171 180 193

Re: [R] [Rd] How to generate dependency file that can be used by gnu make?

2009-11-17 Thread Peng Yu
This may not easy to do, when the filename are not hard coded strings. For example, the variable 'filename' is a vector of strings. for (i in 1:length(filename)){ do something... save(,file=filename[i]) } On Mon, Nov 16, 2009 at 11:33 PM, Linlin Yan wrote: > I don't think this function is sa

Re: [R] extracting the last row of each group in a data frame

2009-11-17 Thread Nutter, Benjamin
I usually use the following function: last.record <- function(data, id, ..., na.last=TRUE, decreasing=FALSE){ #*** Make vector of variables to sort by v <- c(id, unlist(list(...))) #*** Sort Data Frame data <- data[do.call(order, c(data[,v, drop=FALSE], na.last=na.last, decre

[R] Re place NA values in matrix with the value of Nearest Neighbour

2009-11-17 Thread RJLewis
I am extracting climate data for coastal areas from 5km grid data for specific xy coordinates that relates to individual study sites (SQ). Code so far: setwd("/Users/roblewis/Documents/PhD/Climate Data") fnamestemp=read.table("Path_Directory_Maxt") fnames=paste(fnamestemp[,1],fnamestemp[,2])

[R] How to plot an image in R

2009-11-17 Thread Izidine Pinto
Dear all Im new in R I have a necdf data set that I want to plot : this is my data set [1] "file Tmax.DJF.daily.1981_1999.echama2.nc has 4 dimensions:" [1] "longitude Size: 127" [1] "latitude Size: 110" [1] "ht Size: 1" [1] "t Size: 1680" [1] "" [1] "file Tmax.DJF.

Re: [R] Arguments for Plot()

2009-11-17 Thread Karl Ove Hufthammer
On Tue, 17 Nov 2009 14:18:34 +0200 Tal Galili wrote: > Do you mean maybe: > > plot(x, ylim= range(x) ) Also, the various plot arguments are listed in ?plot.default It may be a bit confusing that they're not listed in ?plot but the help page *does* have a link to the help page for 'plot.default

Re: [R] How to plot an image in R

2009-11-17 Thread Steve_Friedman
You are going to have to subset the necdf dataset by dates or some other logical aggregation scheme, and then plot. Since the data is spatial, I would think that plotting could be achieved with the image( ) function. Good Luck Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry

Re: [R] Where are usages like "== 2L" documented?

2009-11-17 Thread Bryan Hanson
Patrick reminded me that it's also in The R Inferno, another document that I need to read again. So now, a more particular semi-question: x <- 1L y <- 1 z <- 1.0 class(x) # integer class(y) # numeric class(z) # numeric x == 1 x == 1L y == 1 z == 1 # all test TRUE Just to clarify, I think the s

[R] Normal distribution test

2009-11-17 Thread Markus Mehrwald
Hi all, I am completely new to R and my knowledge of statistics is quite small so I hope you can help my. I have three dimensional point data which represents (and this is what I do not know for sure) a normal distribution. Now I want to test if this is true or not and as I can remember from s

Re: [R] Normal distribution test

2009-11-17 Thread Johannes Graumann
Markus Mehrwald wrote: > Hi all, > > I am completely new to R and my knowledge of statistics is quite small > so I hope you can help my. > I have three dimensional point data which represents (and this is what I > do not know for sure) a normal distribution. Now I want to test if this > is true o

Re: [R] Normal distribution test

2009-11-17 Thread Kjetil Halvorsen
On Tue, Nov 17, 2009 at 11:17 AM, Markus Mehrwald wrote: > Hi all, > > I am completely new to R and my knowledge of statistics is quite small so I > hope you can help my. > I have three dimensional point data which represents (and this is what I do > not know for sure) a normal distribution. Now I

Re: [R] Where are usages like "== 2L" documented?

2009-11-17 Thread Prof Brian Ripley
On Tue, 17 Nov 2009, Bryan Hanson wrote: Patrick reminded me that it's also in The R Inferno, another document that I need to read again. So now, a more particular semi-question: x <- 1L y <- 1 z <- 1.0 class(x) # integer class(y) # numeric class(z) # numeric NB: identical(x, y) is TRUE, so

Re: [R] Normal distribution test

2009-11-17 Thread rkevinburton
This is probably an even more basic question but shapiro.test return both the statistic (w) and the significance (pw) of the statistic. For this test the null-hypothesis is that the distirbution is not normal so very small values of pw would mean that there is very little chance that the distiri

Re: [R] Define lm/glm object without evaluating them

2009-11-17 Thread Gabor Grothendieck
If your models only consists of a formula just use the formula as your specification where evaluation consists of passing the formula to lm with a data argument. # specification fo <- rate ~ conc # evaluation lm(fo, Puromycin) On Tue, Nov 17, 2009 at 4:11 AM, Søren Højsgaard wrote: > For e.g.

Re: [R] Normal distribution test

2009-11-17 Thread Duncan Murdoch
On 11/17/2009 10:07 AM, rkevinbur...@charter.net wrote: This is probably an even more basic question but shapiro.test return both the statistic (w) and the significance (pw) of the statistic. For this test the null-hypothesis is that the distirbution is not normal so very small values of pw wo

Re: [R] Cluster analysis: hclust manipulation possible?

2009-11-17 Thread Jopi Harri
On 16.11.2009 19:13, Charles C. Berry wrote: >> The question: Can this be accomplished in the *dendrogram plot* >> by manipulating the resulting hclust data structure or by some >> other means, and if yes, how? > > Yes, you need to study > > ?hclust > > particularly the part about 'Value'

Re: [R] Cluster analysis: hclust manipulation possible?

2009-11-17 Thread Jopi Harri
Original Message Subject: Re: [R] Cluster analysis: hclust manipulation possible? Date: Mon, 16 Nov 2009 19:22:54 -0800 From: Charles C. Berry To: Jopi Harri References: <4b016237.7050...@utu.fi> <4b01bc5d.3020...@utu.fi> On Mon, 16 Nov 2009, Jopi Harri wrote: > On 16.11.20

[R] Add "bin" variable to dataframe

2009-11-17 Thread Gunadi
Hi All - I am trying to add a new variable to my dataframe which is a series of bins based on another variable which is distance. So, I'd like to end with each of my distances classified into bin 1, bin 2, bin 3 etc. Below is a start. x<-rnorm(100, mean=100, sd=30) #Generates sample distances b

[R] tsls function help

2009-11-17 Thread Ladislav Polívka
Hi, I need help. I need to use tsls function on my simultaneous model. This is my model: Ct=a0+a1Yt+a2Ct-1+ut1 Yt=b0+b1It+b2Mt+ut2 It=c0+c1rt+c2It-1+ut3 Gt=Yt-Ct-It How to use tsls on this model, please? Thank you for your help. Lado __ R-help@r-

[R] CM Fonts in PDF output

2009-11-17 Thread Markus Jochmann
Hi! On Linux I try to produce pdf graphs with computer modern fonts so that they look nice in LaTeX documents. I run for example: -- CM <- Type1Font( "CM", c("/usr/share/texmf-texlive/fonts/afm/public/cm-lgc/fcmr8a.afm", "/usr/share/texmf-texlive/fonts/afm/public/cm-lgc/fcmb8a.afm", "/usr/sh

[R] strange read.table results

2009-11-17 Thread Daniel Alcock
Hi I hope someone can shed some light on this: For some reason when I read.table("bfx.txt") R decides to only give back the first character from each column in each row as one single column. Like this: V1 1 ÿþr 2\n 3 r 4 1 5 0 6 A 7 G 8

Re: [R] Error running lda example: Session Info

2009-11-17 Thread Greg Riddick
> > library(MASS) > Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), +Sp = rep(c("s","c","v"), rep(50,3))) > train <- sample(1:150, 75) > table(Iris$Sp[train]) c s v 22 23 30 > z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) Error in if (targetlist[i]

[R] Calculating the power of a negative number

2009-11-17 Thread Zhiyuan Jason ZHENG
Hello, I use R a lot, one thing bugs me is that when I try the following > x<- -8 > x^(1/3) [1] NaN However, it is fine with -8^(1/3). Priority goes to the power. Can you help me out for this? Thanks. Best, Zhiyuan J. ZHENG Ph.D. Candidate Economic Department Virginia Polyte

Re: [R] Cluster analysis: hclust manipulation possible?

2009-11-17 Thread Jopi Harri
On 17.11.2009 5:22, Charles C. Berry wrote: > > Once you get the hang of it, you'll be in a position to modify an existing > hclust object. I believe that I managed to solve the problem. (The code may not be too refined, and my R is perhaps a bit dialectal. The function may fail especially if th

Re: [R] Add "bin" variable to dataframe

2009-11-17 Thread Henrique Dallazuanna
Try this: cut(x, breaks = breaks, labels = sprintf("bin%d", 1:10)) On Tue, Nov 17, 2009 at 1:43 PM, Gunadi wrote: > > Hi All - I am trying to add a new variable to my dataframe which is a series > of bins based on another variable which is distance. So, I'd like to end > with each of my distance

Re: [R] Calculating the power of a negative number

2009-11-17 Thread Colin Millar
Hi, Look at ?NumericConstants At the bottom of the details section you will find: "Note that a leading plus or minus is not regarded by the parser as part of a numeric constant but as a unary operator applied to the constant." See ?Syntax for precedence information. Hope this helps, Co

Re: [R] Calculating the power of a negative number

2009-11-17 Thread Colin Millar
If you are trying to solve x^3 + 2 = 0 I think R will always give the positive root if available ie (-8 + 0i) ^ (1/3) #[1] 1+1.732051i So if you wanted all roots you would have to code it yourself... not sure though -Original Message- From: r-help-boun...@r-project.org [mailto:r-h

Re: [R] Calculating the power of a negative number

2009-11-17 Thread Peter Dalgaard
Zhiyuan Jason ZHENG wrote: > Hello, > > > > I use R a lot, one thing bugs me is that when I try the following > >> x<- -8 > >> x^(1/3) > > [1] NaN > > > > However, it is fine with -8^(1/3). Priority goes to the power. Can you help > me out for this? Thanks. Well, mycuberoot <- functio

Re: [R] AMRAtoMA

2009-11-17 Thread marlene marchena
Hi Matt, The ARMA model write the MA part with positive coefficients, therefore the formula that you write for the variance is wrong. Here an example where the answer is the same for both methods. phi=0.75 theta=-0.4 coefvar=(1+theta^2+2*phi*theta)/(1-phi^2) coefvar result <- ARMAtoMA(ar=c(0.75

Re: [R] CM Fonts in PDF output

2009-11-17 Thread baptiste auguie
Hi, Not answering your question, but the tikzDevice package is another option if you want to match LaTeX fonts seamlessly. HTH, baptiste 2009/11/17 Markus Jochmann : > > Hi! > > On Linux I try to produce pdf graphs with computer modern fonts so that they > look nice in LaTeX documents. I run fo

Re: [R] non homogeneous poisson process

2009-11-17 Thread Charles C. Berry
On Mon, 16 Nov 2009, frenchcr wrote: I want to do a non homogeneous poisson process model in R. What is the meaning of 'do', please? Details are likely to be important. It is not clear to me if you are looking for advice on how to analyze a particular set of data or if you are trying ot s

Re: [R] strange read.table results

2009-11-17 Thread Sarah Goslee
My guess is that there's something wrong with your file. You really don't give us enough information to diagnose the problem, though. An encoding issue? If you open the file in a plain text editor, what happens? What OS are you using? Version of R? When I copy your sample data from the email into

Re: [R] Add "bin" variable to dataframe

2009-11-17 Thread Gunadi
That works perfectly. Thank you. Henrique Dallazuanna wrote: > > Try this: > > cut(x, breaks = breaks, labels = sprintf("bin%d", 1:10)) > > On Tue, Nov 17, 2009 at 1:43 PM, Gunadi wrote: >> >> Hi All - I am trying to add a new variable to my dataframe which is a >> series >> of bins based

[R] Problem loading fAssets.

2009-11-17 Thread Guillaume Yziquel
Hello. I'm using the fAssets package from the Debian distribution. I've been experiencing the following behaviour: yziq...@seldon:~$ R R version 2.9.2 (2009-08-24) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R est un logiciel libre livré sans AUCUNE GARA

Re: [R] parsing Google search results

2009-11-17 Thread Tony B
Hi Philip, If i understood correctly, you just wish to get the urls from a given google search? I have some old code you could adapt which extracts the main links from a google search. It makes use of XPath expressions using the lovely XML and RCurl packages: > library(XML) > library(RCurl) > > g

Re: [R] strange read.table results

2009-11-17 Thread Daniel Alcock
Sorry about that, it seems it was a windows encoding problem: read.table("bfx.txt",fileEncoding="UTF-16"); and it works fine thanks anyway Dan Daniel Alcock Malaria Genetics (T112) Wellcome Trust Sanger Institute Cambridge CB10 1SA UK +44 (0)1223 834244 ext. 4994 "The most exciting phrase to h

Re: [R] Error running lda example: Session Info

2009-11-17 Thread David Winsemius
On Nov 17, 2009, at 10:55 AM, Greg Riddick wrote: > > > > library(MASS) > > Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), > +Sp = rep(c("s","c","v"), rep(50,3))) > > train <- sample(1:150, 75) > > table(Iris$Sp[train]) > > c s v > 22 23 30 > > z <- lda(Sp ~

[R] Help constructing a stochastic kernel

2009-11-17 Thread Jorge Vinseiro
I would like to construct and graph a stochastic kernel to compare transitions inside the distribution of per capita income among the states of a country betwen 1988 - 2008. Just like Quah did. I just have one big problem, i havent found any reference or tutorial on how to do this. I would be reakl

Re: [R] ARMAX model fitting with arima

2009-11-17 Thread Rafael Laboissiere
This is a follow-up to my request of yesterday. Someone sent a private reply indicating a chapter in the Shumway & Stoffer's book "Time Series Analysis and Its Applications" [1], where some pitfalls of the arima function are discussed. In the meanwhile, I realized that the estVARXar function of t

[R] lm.ridge {MASS} ridge regression calculation question

2009-11-17 Thread Jimmy Purnell
Why do I get different coefficients for each of these methods? Y <- matrix(c(136,144,145,169,176),byrow=F,5,1) X1 <- matrix(c(91,105,109,130,146),byrow=F,5,1) X2 <- matrix(c(11,13,17,19,23),byrow=F,5,1) cY <- scale(Y, scale=FALSE) sX1 <- scale(X1) sX2 <- scale(X2) library(MASS) lm.ridge(cY ~ sX1 +

[R] how to merge two data.frames – only comp lete observations

2009-11-17 Thread Martin Batholdy
Hi, I have two data-frames like: A: USA 3.2 Canada 4.7 Austria 1.5 Iran0.3 China 3.8 Japan 3.0 B: Austria 17 Iran22 Angola 29 Japan 32 England 11 Now I want to merge this two data.frames to one - but I only want entries for the countries I have complete ob

[R] Listing what a package exports.

2009-11-17 Thread Guillaume Yziquel
Hello. I'm trying to bind R libraries / packages to Objective Caml. The R interpreter is now (unperfectly) embedded, and I'm now tackling embedding libraries. However, I'd like to automated the process as much as possible, and I'd therefore need to know how to list *everything* that a given

[R] (exact) confidence bounds for lognormal parameters \mu and \sigma

2009-11-17 Thread Krusty the Klown
Dear all, a statistical question: how can I compute exact confidence intervals for the lognormal distribution parameters? I found something only on www.weibull.com www.weibull.com . Does exist a package in R which can compute them? Thanks in advance, KTK -- View this message in context: http://

Re: [R] lmomco package and confidence limits?

2009-11-17 Thread J. R. M. Hosking
Douglas M. Hultstrand wrote: Hello, I am using the lmomco package (lmom.ub and pargev) to compute the GEV parameters (location, scale, and shape), which are used to estimate return values. I was wondering how/if I can calculate upper and lower confidence (CI_u, CI_l) intervals for each retur

[R] hclust too slow?

2009-11-17 Thread akonla
Hi, I am new to clustering in R and I have a dataset with approximately 17,000 rows and 8 columns with each data point a numerical character with three decimal places. I would like to cluster the 8 columns so that I get a dendrogram as an output. So, I am simply creating a distance matrix of my

Re: [R] (exact) confidence bounds for lognormal parameters \mu and \sigma

2009-11-17 Thread David Scott
Krusty the Klown wrote: Dear all, a statistical question: how can I compute exact confidence intervals for the lognormal distribution parameters? I found something only on www.weibull.com www.weibull.com . Does exist a package in R which can compute them? Thanks in advance, KTK I think fitdis

Re: [R] how to merge two data.frames – only comp lete observations

2009-11-17 Thread Marc Schwartz
On Nov 17, 2009, at 12:20 PM, Martin Batholdy wrote: Hi, I have two data-frames like: A: USA 3.2 Canada 4.7 Austria 1.5 Iran0.3 China 3.8 Japan 3.0 B: Austria 17 Iran22 Angola 29 Japan 32 England 11 Now I want to merge this two data.frames to one - but I

Re: [R] lm.ridge {MASS} ridge regression calculation question

2009-11-17 Thread Ravi Varadhan
The difference is due to the use of "n" versus "n-1" when calculating the standard deviation for scaling. Try this: Y <- matrix(c(136,144,145,169,176),byrow=F,5,1) X1 <- matrix(c(91,105,109,130,146),byrow=F,5,1) X2 <- matrix(c(11,13,17,19,23),byrow=F,5,1) cY <- scale(Y, scale=FALSE) sX1 <- sca

Re: [R] hclust too slow?

2009-11-17 Thread Charles C. Berry
On Tue, 17 Nov 2009, akonla wrote: Hi, I am new to clustering in R and I have a dataset with approximately 17,000 rows and 8 columns with each data point a numerical character with three decimal places. I would like to cluster the 8 columns so that I get a dendrogram as an output. So, I am s

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread David Winsemius
It's a FAQ. http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f -- David. On Nov 17, 2009, at 7:14 AM, Tal Galili wrote: I know how you feel, I came a cross the same problem once, which took sometime to find a solution for. What you need to do

Re: [R] Plotting Histogram using histogram() and for loop and Iwant to save the histogram individually ... HELP

2009-11-17 Thread ychu066
THANKS EVERYONE, IT WORKS NOW !!! BY THE WAY, i want to improve my R coding skills, any suggestion for me ? Colin Millar wrote: > > Or alternatively store as a list and export later if you want > > ... after some tidying ... > > > library(lattice) > > columns <- 8:153 > plots <- vector("l

Re: [R] Help with unstack() function

2009-11-17 Thread Kevin Wright
The unstack function is a bit clumsy for this problem: library(MASS) cbind(Treatment = unstack(Rabbit, Treatment ~ Animal)[,1], Dose = unstack(Rabbit, Dose ~ Animal)[,1], unstack(Rabbit, BPchange ~ Animal)) A much better choice would be to use the reshape package: require(reshape) rec

Re: [R] How to do band-pass filters, low-pass filters, high-pass filters in R?

2009-11-17 Thread David Winsemius
On Nov 16, 2009, at 11:54 PM, sdlywjl666 wrote: Dear All, How to do band-pass filters,low-pass filters,high-pass filters in R? Thanks! ?RSiteSearch (Learn to do your own searching.) > RSiteSearch("bandpass filter") 23 hits... for example... http://finzi.psych.upenn.edu/R/library/mFilter

Re: [R] hclust too slow?

2009-11-17 Thread Anna Konstorum
Yikes, you are correct! Thank you so much. I reran the analysis with the rows and columns switched and it took no time at all. Thank you again for your help. On Tue, Nov 17, 2009 at 12:04 PM, Charles C. Berry wrote: > On Tue, 17 Nov 2009, akonla wrote: > > >> Hi, >> >> I am new to clustering i

Re: [R] CM Fonts in PDF output

2009-11-17 Thread Prof Brian Ripley
Since 0x2d = 45, it looks like those fonts are missing 'minus'. See ?postscript for more details on encodings (and 'minus' vs 'hyphen'). 'Linux' is too imprecise here. but I looked at my TeXLive 2009 installation (in a different place) and fcmr8a.afm did not contain 'minus'. On Tue, 17 Nov

[R] Competing risks regression

2009-11-17 Thread Peter Jepsen
Dear listers, With the current version of the 'cmprsk' package it is not possible to include (non-continuously) time-dependent covariates in a Fine + Gray competing risks regression model. Is anyone aware of a workaround, or could an updated cmprsk package be underway? My current workaround is

Re: [R] how can one break or stop or return from a script?

2009-11-17 Thread Stu
Thanks ... It's good to know I'm not missing the obvious. - Stu On Nov 16, 8:31 pm, Don MacQueen wrote: > I don't know how to do this in the way you describe. > > Easy alternatives include: > >   - putting the part of the script that is to be executed > conditionally into a separate file, and the

[R] Plotting a dataframe with date format

2009-11-17 Thread separent
I tried to plot the attached dataframe with the following command. plot(inclino.06.1.r00.time.select.transpose[,1],inclino.06.1.r00.time.select.transpose[,2]) The first column is in date format, second is numeric. The plot does not correspond to my values. Why? Regards, Serge-Étienne Parent Go

[R] question about function heatmap

2009-11-17 Thread Waverley @ Palo Alto
Hi, I am using the function heatmap(stats) to draw a microarray heatmap, columns are samples and rows are gene features. I did a 2D clustering during the heatmap drawing. The features and samples indeed cluster into several blocks both vertically and horizontally. I can get the index of re-orde

Re: [R] CM Fonts in PDF output

2009-11-17 Thread Markus Jochmann
Thanks Baptiste for your hint, I will try this at some point. I solved the issue thanks to Brian Ripley. I followed the instructions by Paul Murrell (http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html) but not exactly enough. Instead of downloading the font files from http://www.ctan.org/tex-arch

[R] Lattice plot

2009-11-17 Thread Tim Smith
Hi, I was trying to get a graph in lattice with the following data frame (7 rows, 5 cols): chr start1 end1 meth positive 1 1 10 20 1.5y 2 2 12 18 -0.7n 3 3 22 34 2.0y 4 1 35 70 3.0y 5 1120 140 -1.3n 6 1180 19

Re: [R] Discontinuous graph

2009-11-17 Thread Tim Smith
Thanks Baptiste. That is exactly what I needed. However, now I also need to know how I can achieve this using the lattice package, since I think I will have to make several panels. I've just rephrased the problem and put up another post. Hopefully, this will avoid some confusion. best regards,

[R] Basic question on nominal data

2009-11-17 Thread Marc Giombetti
Hello everybody, I am new to R and I have a very basic question, but I couldn't get this to work. Let's say I have a vector s = c("a","a","a","b","b","c","c","c","c") s1 <- factor(s) s2 <- summary(s1) leads to the following a b c 3 2 4 How can I access the different aggregated values for a b a

Re: [R] Basic question on nominal data

2009-11-17 Thread Colin Millar
Hi, try ?table # for example (s3 <- table(s)) # and if you want a single value s3["a"] # or s3[1] HTH, Colin. From: r-help-boun...@r-project.org on behalf of Marc Giombetti Sent: Tue 17/11/2009 22:55 To: r-help@r-project.org Subject: [R] Basic ques

[R] Perform operations on dataframes called with paste in loops

2009-11-17 Thread separent
In a loop, I compose the name of a csv file using paste, then read it (e.g., dataset1.csv, dataset2.csv, etc). The name of the dataframe assigned to the imported csv is also composed with paste (e.g., dataset1, dataset2, etc.). Now I want to perform operations on the dataframes dataset1, dataset2,

[R] :Problem with Looping

2009-11-17 Thread Bruno Giovannetti
Hello, Sometimes the looping (using "for") seems to skip some iterations. An example: arg <- matrix(NA,length(seq(.30,.5,.01)),1) for (i in seq(.30,.5,.01)) { arg[i*100-29] <- i } arg What is the problem with this coding, please? Thank you so much, -- Bruno Cara Giovannetti, PhD Candidate Eco

Re: [R] Basic question on nominal data

2009-11-17 Thread Ted Harding
On 17-Nov-09 22:55:32, Marc Giombetti wrote: > Hello everybody, > I am new to R and I have a very basic question, but I couldn't get > this to work. > Let's say I have a vector > > s = c("a","a","a","b","b","c","c","c","c") > s1 <- factor(s) > > s2 <- summary(s1) leads to the following > a b c >

Re: [R] :Problem with Looping

2009-11-17 Thread Benilton Carvalho
it doesn't skip... think about why: seq(.30,.5,.01) * 100 - 29 == 1:21 isn't always TRUE. b On Nov 17, 2009, at 9:17 PM, Bruno Giovannetti wrote: Hello, Sometimes the looping (using "for") seems to skip some iterations. An example: arg <- matrix(NA,length(seq(.30,.5,.01)),1) for (i in se

Re: [R] :Problem with Looping

2009-11-17 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Bruno Giovannetti > Sent: Tuesday, November 17, 2009 3:18 PM > To: r-help@r-project.org > Subject: [R] :Problem with Looping > > Hello, > > Sometimes the looping (using "for") se

Re: [R] Perform operations on dataframes called with paste in loops

2009-11-17 Thread David Winsemius
On Nov 17, 2009, at 6:14 PM, separent wrote: In a loop, I compose the name of a csv file using paste, then read it (e.g., dataset1.csv, dataset2.csv, etc). The name of the dataframe assigned to the imported csv is also composed with paste (e.g., dataset1, dataset2, etc.). Now I want to p

[R] SVM Param Tuning with using SNOW package

2009-11-17 Thread raluca
Hello, Is the first time I am using SNOW package and I am trying to tune the cost parameter for a linear SVM, where the cost (variable cost1) takes 10 values between 0.5 and 30. I have a large dataset and a pc which is not very powerful, so I need to tune the parameters using both CPUs of the pc

[R] re placing the dates format in R for exporting the data set...

2009-11-17 Thread ychu066
hi everyone, i am having difficulties with replacing the dates format in R for exporting the data set... eg: the code that i used was toms_dat<- replace(toms_dat, toms_dat ==2009-08-06, 2) toms_dat<- replace(toms_dat, toms_dat ==2009-08-04, 1) but when i export the data as into txt file or exce

Re: [R] Where are usages like "== 2L" documented?

2009-11-17 Thread Duncan Murdoch
On 16/11/2009 7:52 PM, Gabor Grothendieck wrote: On Mon, Nov 16, 2009 at 7:25 PM, Duncan Murdoch wrote: On 16/11/2009 6:47 PM, Steven McKinney wrote: ?NumericConstants will bring up a help page that mentions "All other numeric constants start with a digit or period and are either a decimal or

Re: [R] re placing the dates format in R for exporting the data set...

2009-11-17 Thread jim holtman
First of all '2009-08-06' is 1995; this is probably not what you were expecting. What do you what your expression to do? Is 'toms_dat' a dataframe? if so, your expression 'toms_dat ==2009-08-06' seem strange. So tell us what you want to do, not how you want to do it. On Tue, Nov 17, 2009 at 4:

Re: [R] Plotting a dataframe with date format

2009-11-17 Thread jim holtman
It plots fine for me. I see 2007 and 2008 on the x-axis. On Tue, Nov 17, 2009 at 4:56 PM, separent wrote: > > I tried to plot the attached dataframe with the following command. > > plot(inclino.06.1.r00.time.select.transpose[,1],inclino.06.1.r00.time.select.transpose[,2]) > > The first column is

Re: [R] re placing the dates format in R for exporting the data set...

2009-11-17 Thread ychu066
moreover, how come when I export a dataframe out from R say, it become a excel file. The first column includes the inex number eg: 1,2,3 ..n instead of including the values that the first column should be have anyone know how to solve this problem ? ychu066 wrote: > > hi everyone, i

  1   2   >