Re: [R] R help, using R to build choropleth

2012-06-27 Thread Pascal Oettli
Hello, You can find some hints there: http://geography.uoregon.edu/geogr/topics/index.html Regards Le 12/06/28 14:26, iverson a écrit : Hi guys i need some help to build choropleth. Basically i am trying to colour regions on the map by population. I possess the shape file of the country, a

Re: [R] building binary tree

2012-06-27 Thread steven mosher
I believe chambers book has an example using S4 classes. which isnt much help for a beginner. you can do it the old school way. build it by hand with one vector of pointers and another data structure of leaf nodes. there is nothing magical about a tree. you can build one in basic or fortran. painf

Re: [R] Printing a variable in a loop

2012-06-27 Thread Miguel Manese
Hi Kat, On Thu, Jun 28, 2012 at 8:22 AM, kat_the_great wrote: > Dear R Users: > > I'm a STATA user converting to R, and I'd like to be to do the following. > #Assign var_1 and var_2 a value > 10->var1 > 20->var2 > > #Now I'd like to print the values of var_1 and var_2 by looping through > var_1 a

Re: [R] A solution for question about formatting Dates

2012-06-27 Thread Patrick Connolly
On Thu, 28-Jun-2012 at 06:27PM +1200, Patrick Connolly wrote: |> On Tue, 26-Jun-2012 at 11:57PM -0500, Erin Hodgess wrote: |> |> |> Hello again: |> |> |> |> Here is a solution to the dates without leading zeros: |> |> [...] |> |> |> This is not particularly elegant, but it does the trick. |>

[R] R help, using R to build choropleth

2012-06-27 Thread iverson
Hi guys i need some help to build choropleth. Basically i am trying to colour regions on the map by population. I possess the shape file of the country, and also the population data, however, i am having trouble to create the plot, below is my code: population=read.csv("nz2.csv") population n

[R] Storing results in a single file after looping over all files

2012-06-27 Thread Debs Majumdar
Hi All, I have a whole lot of *.raw files in my working folder and I am doing the same analysis on each of those and want to save all the results in a single file. I am making some mistake here and can't figure out how to solve it. Say, the *.raw files are ABCD.raw, EFGH.raw, IJKL.raw ... Th

Re: [R] A solution for question about formatting Dates

2012-06-27 Thread Patrick Connolly
On Tue, 26-Jun-2012 at 11:57PM -0500, Erin Hodgess wrote: |> Hello again: |> |> Here is a solution to the dates without leading zeros: |> |> pou1 <- function(x) { |> #Note: x is a data frame |> #Assume that Column 1 has the date |> #Column 2 has station |> #Column 3 has min

Re: [R] qplot and colors (Please Help)

2012-06-27 Thread R. Michael Weylandt
Hi David, I believe you left out saying what color scheme you would prefer, so it's hard to help, but you might be a start by looking at the appropriate parts of Hadley's website here: http://had.co.nz/ggplot2/, particularly the "scales" section. Best, Michael On Wed, Jun 27, 2012 at 11:07 AM, D

Re: [R] chisq.test

2012-06-27 Thread Omphalodes Verna
Dear all! Thanks for clarification. OV To: Rolf Turner Sent: Wednesday, June 27, 2012 1:33 PM Subject: Re: [R] chisq.test Hi Rolf, Thanks for spotting the mistake.  A.K. - Original Message - From: Rolf Turner .org> Sent: Wednesday, June 2

Re: [R] Loop for multiple plots in figure

2012-06-27 Thread baptiste auguie
You can use main = unique(d$Subject) to solve this problem. HTH, b. On 27 June 2012 08:49, Marcel Curlin wrote: > Well at this point I have what I need (rough plot for data exploration) but > the simplicity of the first approach is quite elegant and it has become a > learning project. I have su

[R] lattice histogram log and non log values

2012-06-27 Thread LCOG1
Hello all, Please consider the following library(lattice) Colors. <-rep(brewer.pal(7, "Dark2"),2) color <- 1 Data.X.. <- data.frame(UnitArea = c(rnorm(1000), rnorm(1000)), Type = c(rep("Base",1000),rep("Log",1000))) histogram( ~ UnitArea | Type, data =

[R] Running R on a cluster

2012-06-27 Thread Xuefeng Gao
Hello, I have R script my_script.R . It loads a large input file "data.txt" and then outputs a large matrix "out". (the command of running it on cluster using my.cmd is put at the end) Now I have 30 different input files "data1.txt", "data2.txt" ... and "data30.txt" and want to generate and save

[R] Replacing sets of rows in matrix within a loop

2012-06-27 Thread nqf
Dear R-help, I am writing some simulation code to create multiple sets of time-to-event clinical trial data (for use in meta-analysis). Within each trial, I want to apply censoring via simulation of uniform variables (with minimum zero and maximum the median outcome time for that particular trial)

Re: [R] graph with two different arithmetic scales

2012-06-27 Thread R. Michael Weylandt
take a look at library(zoo) example(plot.zoo) which shows one way to do this, Best, Michael On Wed, Jun 27, 2012 at 6:50 PM, denissearchundia wrote: > hi > > i try to do a graph who shows 2 time series at the same time > > thanks! > > -- > View this message in context: > http://r.789695.n4.n

[R] Error: figure margins too large

2012-06-27 Thread Karly Harrod
Hello, I am running cluster analysis, and am attempting to create a graph of my clusters. I keep on getting an error that says that my figure margins are too large. d <- file.choose() d <- read.csv(d,header=TRUE) mydataS <- scale(d, center = TRUE, scale=TRUE) #Converts mydataS from a

Re: [R] Extract upper case letters

2012-06-27 Thread R. Michael Weylandt
How do you want your output? If you want a character vector of lowercase letters, just use gsub("[^::A-Z::]","", t) to substitute "" for all non-uppercase characters. strsplit() can lead you to a vector of the single-letter upper case letters. Best, Michael On Wed, Jun 27, 2012 at 2:15 PM, mdvaan

[R] Printing a variable in a loop

2012-06-27 Thread kat_the_great
Dear R Users: I'm a STATA user converting to R, and I'd like to be to do the following. #Assign var_1 and var_2 a value 10->var1 20->var2 #Now I'd like to print the values of var_1 and var_2 by looping through var_1 and var_2 in such a manner: while(y<3){ print(var_y) y+1->y } In STATA, the

[R] If statement - copying a factor variable to a new variable

2012-06-27 Thread James Holland
I need to look through a dataset with two factor variables, and depending on certain criteria, create a new variable containing the data from one of those other variables. The problem is, R keeps making my new variable an integer and saving the data as a 1 or 2 (I believe the levels of the factor)

[R] qplot and colors (Please Help)

2012-06-27 Thread David Lyon
Please help: I am using qplot as below and want to specify a different color scheme for race but dont know how, can someone show me. Thanks in advance Code and input file below: library(ggplot2) library(gridExtra) d<-read.table("results", header=TRUE, fill=TRUE) plot2<-qplot(X,Y,data=d

[R] graph with two different arithmetic scales

2012-06-27 Thread denissearchundia
hi i try to do a graph who shows 2 time series at the same time thanks! -- View this message in context: http://r.789695.n4.nabble.com/graph-with-two-different-arithmetic-scales-tp4634672.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Prediciting sports team scores

2012-06-27 Thread JerryCleve
A very important thing is home game or guest game. Why did I mention Almeria - Sevilla earlier? Almeria are heroes at home. At least, they were in 2009/2010. They scored almost in every home game, no matter who is there at the other end of it - Barcelona or Real Madrid. http://www.oneclicksports.

[R] Extract upper case letters

2012-06-27 Thread mdvaan
t <- "TheWeatherIsVeryNice" How do I extract the upper case letters? - TWIVN Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Extract-upper-case-letters-tp4634664.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] selecting rows by maximum value of one variables in dataframe nested by another Variable

2012-06-27 Thread arun
HI, Try this: dat1 <- read.table(text=" subject    time.ms V3 1  1  stringA 1  12  stringB 1  22    stringC 2  1    stringB 2  14  stringC 2  25  stringA ", sep="",header=TRUE) dat2<-aggregate(dat1$time.ms,list(dat1$subject),max) colnames(dat2)<-c("subject","time.ms")  m

Re: [R] colour highlighting inputs and outputs in the R terminal?

2012-06-27 Thread nikola
that's an old thread but checkout the colorout package - it is awesome and it does exactly what you're asking for ! http://cran.r-project.org/web/packages/colorout/ -- View this message in context: http://r.789695.n4.nabble.com/colour-highlighting-inputs-and-outputs-in-the-R-terminal-tp1565865p4

[R] Filling In Grid based on 0 and 1

2012-06-27 Thread vp726
Hi, I'm wondering if I can do this in R. I have a data set with questions (x-value) and respondents (y-value). If the respondent answered the question they get a 1 and if the respondent didn't answer the question they have a 0. Is there anyway where I can graph something similar to a grid where

[R] Make a reference?

2012-06-27 Thread quantum
How can I make a reference i this case? I want to make a reference to 'Artikel XXX' For example In The Artikel '' there is two tables. .. Litterature Artikel XXX -- View this message in context: http://r.789695.n4.nabble.com/Make-a-reference-tp4634611.html Sent from the R help mailing li

Re: [R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread sina rueeger
Hi Gerrit I did the following: access the function via graphics:::sunflowerplot.formula, and then commented some lines to see, where the problem lies. I guess that it is the chunk with "mf <- eval(m, parent.frame())", but to be honest, I do not know why. My workaround is as follows: sunflowerplot

Re: [R] question about formatting Dates

2012-06-27 Thread arun
Hi, I can see the mistake in the code as "$" before Y.   dat1<-as.factor(c("1/2/2011","1/4/2011","1/4/2011")) dat1 [1] 1/2/2011 1/4/2011 1/4/2011 Levels: 1/2/2011 1/4/2011  as.Date(as.character(dat1), "%m/%d/%Y") [1] "2011-01-02" "2011-01-04" "2011-01-04" > as.Date(as.character(dat1),"%m/%d/$Y

[R] how to create skewness curve

2012-06-27 Thread quantum
I can make kurtosis but now skewness curve. How can I do that? I have used the following code. x<-(1:601-301)/50 x dt3<-dt(x,3) pt3<-pt(x,3) # t distribution has mean 0; variance f/(f-2); skewness 0; excess kurtosis 6/(f-4) dn01<-dnorm(x,0,1) pn01<-pnorm(x,0,1) dlogis<-dlogis(x,0,1) plogis<-pl

Re: [R] MuMIn Problem getting adjusted Confidence intervals

2012-06-27 Thread KKulma
Hello, I seem to be having a similar problem, but with glmer models. Here, model.avg() doesn't return anything but coefficient values: fl19<-glmer( corrFLEDGE ~ INFECTION * rsLD * bin.age + (1 | year) + (1 | RINGNO),data=corrmalaria,family=poisson) fledglings<-dredge(fl19) top.fledglings <- ge

Re: [R] crosstable and regression for survey data (weighted)

2012-06-27 Thread haps
Thanks Pablo for your answer, it was very insightful, but I guess I got something wrong. I formed a survey design as: > library(survey) > mydesign <- svydesign(ids=~vill_neigh_code+clust, strata=~strat, > weights=~sweight, data=mydata) where strat: stratum (urban or (sub-county) rural). clust:

[R] binary tree

2012-06-27 Thread Peppino
Hi I am new with R I Have to build a binary tree with R. I'm very confused was wondering if anyone had any R sample code they would share. Any bady can help me? Bye Giuseppe -- View this message in context: http://r.789695.n4.nabble.com/binary-tree-tp4634593.html Sent from the R help mailin

[R] Help with spdep package issue with errorsarlm

2012-06-27 Thread Samantha Sifleet
Hi List, I am hoping some of you have experience with the spdep package. I have had success with lm.morantest and lm.LMtests. I am trying to run a spatial error model and I keep getting the following error Error in res[i, listw$neighbours[[i]]] <- listw$weights[[i]] : NAs ar

[R] building binary tree

2012-06-27 Thread Peppino
Hi I am new with R I Have to build a binary tree with R. I'm very confused was wondering if anyone had any R sample code they would share. I've come across a lot of C++ code(nothing in R) and this is not helping. Any bady can help me? Bye Giuseppe -- View this message in context: http://r.7

[R] survfit function

2012-06-27 Thread niloo javan
Hello In (survfit(Surv(Time,Status)~1)) I want to have status=0 as Failure and status=1 as Censore. Changing above formula to (survfit(Surv(Time,Status)~0)) doesnot help!! What should i do? Thank You. _ Best Regards Niloofar.Javanrouh MSc Of BioStatistics  [[alternat

Re: [R] Binary Quadratic Opt?

2012-06-27 Thread khris
Hi Petr, Appreciate your feedback and sorry for the delay in responding. The following is the description of problem from start:- We have a set of sensors in XY plane arranged in more or less a rectangular grid and we know their (x,y) co-ordinate. Now these sensors send data and from that data

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not show the R² of the regression line. When I run

[R] trend in incidence rate

2012-06-27 Thread ericlsh
I would like to compare the incidence rates of three groups. They are supposed to have different risks so I would like to test whether there is a increasing trend in the incidence rates. Does R or any packages provide a trend test for incidence rates? I checked epiR and epitools. It seems they do n

Re: [R] Simulating web requests

2012-06-27 Thread Mohan Radhakrishnan
Not being the expert I have looked at papers like 'simpleR { Using R for Introductory Statistics' by John Verzani. Some sample Code is in these papers. Looks like I have to search for ideas to code a programming language like Java by taking input from R(r-java). Can R be used directly to hit web u

Re: [R] how to skip from some null file and go on reading?

2012-06-27 Thread Jim Holtman
why cann't you use 'try'? you can get the size of the file with 'file.info' and then make a decision to read or not. Sent from my iPad On Jun 27, 2012, at 23:02, Jie Tang wrote: > hi , > I am reading a series of files by the command shown as below. > cop_x_data<-read.table(flnm(i) > ,skip=2,a

[R] how to skip from some null file and go on reading?

2012-06-27 Thread Jie Tang
hi , I am reading a series of files by the command shown as below. cop_x_data<-read.table(flnm(i) ,skip=2,allowEscapes=TRUE,blank.lines.skip=TRUE) the first two line of the files are headfile and I skip them by skip=2. and sometimes the data file is null and there is no any data in the file except

Re: [R] Problem installing RBloomberg

2012-06-27 Thread Pascal Oettli
Hello, Probably you should try this (thanks Google): > install.packages("Rbbg", repos = "http://r.findata.org";) Regards Le 27/06/2012 22:54, yoda55 a écrit : I have the following error message when I try to install RBloomberg. Les packages binaires téléchargés sont dans C:\Users\b

Re: [R] Strucchange: Breakpoint slow

2012-06-27 Thread Achim Zeileis
On Wed, 27 Jun 2012, Cand2d wrote: Hi to all, I am trying to run breakpoints() on a fairly large sample (>10.000 observations). The process is very slow, any idea on how to speed this up? I have tried the hpc="foreach" parameter, but this didn't work at all when I tried to run it on a smalle

Re: [R] Loop for multiple plots in figure

2012-06-27 Thread Marcel Curlin
Well at this point I have what I need (rough plot for data exploration) but the simplicity of the first approach is quite elegant and it has become a learning project. I have succeeded in formatting the overall plot OK but have not been able to solve the problem of titles or any kind of label/legen

[R] Problem installing RBloomberg

2012-06-27 Thread yoda55
I have the following error message when I try to install RBloomberg. Les packages binaires téléchargés sont dans C:\Users\bloom\AppData\Local\Temp\RtmpktX4UK\downloaded_packages Message d'avis : packages ‘quantstrat’, ‘RBloomberg’, ‘rsproxy’, ‘VaR’ are not available (for R version 2.15.1)

[R] Strucchange: Breakpoint slow

2012-06-27 Thread Cand2d
Hi to all, I am trying to run breakpoints() on a fairly large sample (>10.000 observations). The process is very slow, any idea on how to speed this up? I have tried the hpc="foreach" parameter, but this didn't work at all when I tried to run it on a smaller sample. breakpoints(x ~ x.l1 + x.l2

[R] Multivariate P-GARCH Model

2012-06-27 Thread andy
Hi, I am trying to estimate a multivariate P-GARCH model for two factors x&y. I have selected p-garch to study the leverage effects. Is there any toolkit in R that can help me do this? Thanks, Andy -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-P-GARCH-Model-tp4634

[R] Creating rastor files from kernelbb functions

2012-06-27 Thread Amy Adams
Hello R users, I have used the package adehabitat to create a brownian bridge for my radio-tracked data from one animal (using the kernelbb function). I have worked through page 17 of the manual using the code: data <- kernelbb(x, sig1 = 6.23, sig2 = 58, grid = 100) image(data) This produces a

Re: [R] density function

2012-06-27 Thread Greg Snow
Here are 2 approaches: Use logspline density estimates (logspline package) rather than kernel density estimates, this can give you a function to pass to integrate or other tools, the estimates may be a little different from the kernel density estimates. If you need to use kernel density estimates

Re: [R] a problem of approach

2012-06-27 Thread Adrian Duşa
On Wed, Jun 27, 2012 at 8:11 PM, jim holtman wrote: > If you look, half of the time is spent in the 'findSubsets" function > and the other half in determining where the differences are in the > sets.  Is there a faster way of doing what findSubsets does since it > is the biggest time consumer.  Th

Re: [R] a problem of approach

2012-06-27 Thread Petr Savicky
On Wed, Jun 27, 2012 at 05:36:08PM +0300, Adrian Duşa wrote: > Dear R-help list, > > Part of a program I wrote seem to take a significant amount of time, > therefore I am looking for an alternative approach. > In order to explain what is does: > > - the input is a sorted vector of integer numbers

Re: [R] increase the usage of CPU and Memory

2012-06-27 Thread Richard R. Liu
Hello Xi, Have you tried replacing the for loop by an apply construct, e.g., lapply or sapply? In my experience these functions are more efficient than for. At any rate, if you succeed with, say, lapply, there are some R packages that support parallel processing versions. I believe the packa

[R] Matrix multiplication using Matrix package

2012-06-27 Thread Doran, Harold
I have the following matrix operation A %*% B %*% A Where these matrices have the following dimensions and class attributes. > dim(A) [1] 5764 5764 > class(A) [1] "dgCMatrix" attr(,"package") [1] "Matrix" > dim(B) [1] 5764 5764 > class(B) [1] "dgCMatrix" attr(,"package") [1] "Matrix" Now, wh

Re: [R] a problem of approach

2012-06-27 Thread jim holtman
If you look, half of the time is spent in the 'findSubsets" function and the other half in determining where the differences are in the sets. Is there a faster way of doing what findSubsets does since it is the biggest time consumer. The setdiff might be speeded up by using 'match'. On Wed, Jun

Re: [R] a problem of approach

2012-06-27 Thread Adrian Duşa
Hi Jim, On Wed, Jun 27, 2012 at 7:27 PM, jim holtman wrote: > One place to start is to use Rprof to see where time is being spent. > I used the sample you sent and this is what I got: > > >  0  16.7 root >  1.   16.2 system.time >  2. .   16.1 testfoo >  3. . .   16.1 setdiff >  4. . . .    8.2 a

Re: [R] Ljung-Box test (Box.test)

2012-06-27 Thread Rui Barradas
Hello, No, the Ljung-Box test wouldn't be inappropriate in that case. First you detrend the series and then test for serial independence. It's even usual to do so. I would use the default values for lag and fitdf. But use type="Ljung", the Box-Pierce test is nowadays seldom used in pratice, i

Re: [R] a problem of approach

2012-06-27 Thread jim holtman
One place to start is to use Rprof to see where time is being spent. I used the sample you sent and this is what I got: 0 16.7 root 1. 16.2 system.time 2. . 16.1 testfoo 3. . . 16.1 setdiff 4. . . .8.2 as.vector 5. . . . .8.2 findSubsets 6. . . . . .6.4 increment

Re: [R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread David L Carlson
Or just avoid the formula version: > with(iris, sunflowerplot(Sepal.Width, Sepal.Length, xlab="A")) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-

Re: [R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread David L Carlson
It seems to be a bug when you specify an x-label. # No xlab= works fine, but uses variable names to label x and # y axes > sunflowerplot(Sepal.Length~Sepal.Width, data=iris) # These all throw the error message > sunflowerplot(Sepal.Length~Sepal.Width, data=iris, xlab="A") > sunflowerplot(Sepal.L

Re: [R] chisq.test

2012-06-27 Thread Peter Ehlers
On 2012-06-26 23:02, John wrote: On Wed, 27 Jun 2012 16:58:29 +1200 Rolf Turner wrote: On 27/06/12 08:54, arun wrote: Hi, The error is due to less than 5 observations in some cells. NO, NO, NO It's not the observations that matter, it is the ***EXPECTED COUNTS***. These

[R] ggplot2 ordering in a faceted dotplot.

2012-06-27 Thread John Kane
am trying to produce two dot plot figures in ggplot2. So far the first one (p) in the program below is working fine. However when I want to move to a faceted plot (p1) I seem to lose my ordering or, more likely, I'm just getting an ordering I am not expecting and I always have trouble under

Re: [R] question about formatting Dates

2012-06-27 Thread David L Carlson
How about > dates <- as.factor(c("1/2/2011", "1/4/2011", "1/4/2011", "1/4/2011", "1/6/2011", "1/7/2011", "1/8/2011", "1/9/2011", "1/10/2011")) > dates [1] 1/2/2011 1/4/2011 1/4/2011 1/4/2011 1/6/2011 1/7/2011 1/8/2011 [8] 1/9/2011 1/10/2011 Levels: 1/10/2011 1/2/2011 1/4/2011 1/6/2011 1/7/

Re: [R] Simulating web requests

2012-06-27 Thread David Winsemius
On Jun 27, 2012, at 6:58 AM, Mohan Radhakrishnan wrote: Homework ? You mean the question is at a high level. I use R. It is just the simulation part that I am investigating. Several papers on Capacity Planning that I am working on are useful for analyzing log traffic using R for GOF tests e

[R] a problem of approach

2012-06-27 Thread Adrian Duşa
Dear R-help list, Part of a program I wrote seem to take a significant amount of time, therefore I am looking for an alternative approach. In order to explain what is does: - the input is a sorted vector of integer numbers - some higher numbers may be derived (using a mathematical formula) from l

Re: [R] Packaging Error

2012-06-27 Thread Prof Brian Ripley
On 27/06/2012 15:17, Mayank Bansal wrote: It would be difficult for me to give the package. Then, following the posting guide, you need to find an example you can give. Can you explain me what does this error "/usr/lib/R/bin/INSTALL: line 34: 9964 Done echo 'tools:::.install_packages()' 9965

Re: [R] Packaging Error

2012-06-27 Thread Mayank Bansal
It would be difficult for me to give the package. Can you explain me what does this error "/usr/lib/R/bin/INSTALL: line 34: 9964 Done echo 'tools:::.install_packages()' 9965 Segmentation fault | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --slave --args ${args}" generally mean. The

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Gabor Grothendieck
On Wed, Jun 27, 2012 at 4:36 AM, Christof Kluß wrote: > > for example the same model with intercept R² = 0.6, without intercept R² > = 0.9 and higher. In my definition of R², R² has to be equal or less > without intercept > > I do not know what R shows, but in the summary of the model without > in

Re: [R] plotting two histograms on one plot with hist function

2012-06-27 Thread John Kane
-Original Message- From: mb...@sun.ac.za Sent: Wed, 27 Jun 2012 08:32:24 +0200 To: jrkrid...@inbox.com, ke...@math.montana.edu Subject: RE: [R] plotting two histograms on one plot with hist function Thank you for all the advice! After mailing the question, I actually

Re: [R] increase the usage of CPU and Memory

2012-06-27 Thread Arnaud Mosnier
Hi Xi, Maybe you should try to "parallelize" your calculations. See package "parallel". http://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf Arnaud On Mon, Jun 25, 2012 at 8:07 PM, Xi wrote: > Dear All, > > I have been searching online for help increasing my R code more effici

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread peter dalgaard
On Jun 27, 2012, at 13:15 , Uwe Ligges wrote: > > 1 - crossprod(residuals(model)) / crossprod(y - mean(y)) And the reason why that is not used in R: > y<- rnorm(100,10,1) > x <- 1:100 > model <- lm(y~x-1) > > 1 - crossprod(residuals(model)) / crossprod(y - mean(y)) [,1] [1,] -27.600

Re: [R] how to apply the same function to multiple data set

2012-06-27 Thread Dimitris Rizopoulos
try this: sapply(estIID50, "[[", 'para') Best, Dimitris On 6/27/2012 2:17 PM, Al Ehan wrote: Sorry, one more simple question. how do I pick, from the generated lapply, the $para for each X. say here I have 2 generated list from previous function. how do I take only the $para for each X? Tha

Re: [R] how to apply the same function to multiple data set

2012-06-27 Thread Al Ehan
Sorry, one more simple question. how do I pick, from the generated lapply, the $para for each X. say here I have 2 generated list from previous function. how do I take only the $para for each X? Thank you so much for your kindness. $X1 $X1$type [1] "gev" $X1$para xi alpha ka

Re: [R] MuMIn - assessing variable importance following model averaging, z-stats/p-values or CI?

2012-06-27 Thread Kamil Bartoń
p-value > 0.05 means that the 95% confidence intervals span zero. Use "confint" to get the CI. It is described in "?model.avg". cheers, kamil Dnia 2012-06-27 12:00, Robertson, Andrew pisze: Dear R users, Recent changes to the MuMIn package now means that the model averaging command (model.av

Re: [R] how to apply the same function to multiple data set

2012-06-27 Thread Al Ehan
It's working I am excited than ever!! Thank you so much On Wed, Jun 27, 2012 at 12:45 PM, Dimitris Rizopoulos < d.rizopou...@erasmusmc.nl> wrote: > you will have to check what function pargev() returns as a result. I would > guess that is probably a list. In any case, you could use someth

Re: [R] how to apply the same function to multiple data set

2012-06-27 Thread Rui Barradas
Hello, Try the following. estIID50 <- apply( IID50, 2, function(x) pargev(lmom.ub(x)) ) And see ?apply Hope this helps, Rui Barradas Em 27-06-2012 12:31, Al Ehan escreveu: Hi R-users, I'm trying to repeat the same procedure to 1000 data set. I know this is very easy, but I got stuck findin

Re: [R] how to apply the same function to multiple data set

2012-06-27 Thread Dimitris Rizopoulos
you will have to check what function pargev() returns as a result. I would guess that is probably a list. In any case, you could use something like the following: estIID50 <- lapply(IID50, function (m) pargev(lmom.ub(m))) I hope it helps. Best, Dimitris On 6/27/2012 1:31 PM, Al Ehan wrote:

[R] how to apply the same function to multiple data set

2012-06-27 Thread Al Ehan
Hi R-users, I'm trying to repeat the same procedure to 1000 data set. I know this is very easy, but I got stuck finding the right and fastest way in running it. IID50=Riidf[1:50,1:1000] #where IID50 is a dataframe consist of 1000 time series(as column) and 50 time scales (row). #what I tried to

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Uwe Ligges
On 27.06.2012 10:36, Christof Kluß wrote: for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not s

[R] formula version of sunflowerplot() fails when axis label specified

2012-06-27 Thread Gerrit Eichner
Hello, R-help, does anybody have already a work-around for the problem that the formula version of sunflowerplot() throws an error when provided with a value for xlab (or ylab) different from NULL: sunflowerplot( Sepal.Length ~ Sepal.Width, data = iris, xlab = "A") Error in model.frame.defa

Re: [R] Simulating web requests

2012-06-27 Thread Mohan Radhakrishnan
Homework ? You mean the question is at a high level. I use R. It is just the simulation part that I am investigating. Several papers on Capacity Planning that I am working on are useful for analyzing log traffic using R for GOF tests etc. But I am not able to find many papers on using R or r-java

Re: [R] selecting rows by maximum value of one variables in dataframe nested by another Variable

2012-06-27 Thread Rui Barradas
Hello, Here's a solution using aggregate and merge. I've kept it in two steps for clarity. d <- read.table(text=" subjecttime.ms V3 1 1 stringA 1 12 stringB 1 22 stringC 2 1stringB 2 14 stringC 2 25 stringA ", header=TRUE) ag <- aggregate(t

Re: [R] density function

2012-06-27 Thread Rui Barradas
Hello, Maybe the link below is of some use. http://stats.stackexchange.com/questions/14061/area-under-the-pdf-in-kernel-density-estimation-in-r Hope this helps, Rui Barradas Em 27-06-2012 01:13, pilaw escreveu: Hello, I need density function so that I can find expected value (using integra

Re: [R] Simulating web requests

2012-06-27 Thread Rui Barradas
Hello, Homework? There's a no homework rule but see inline. Em 27-06-2012 10:20, Mohan Radhakrishnan escreveu: Hi, I am looking for some assistance with these requirements. We are trying to simulate web requests to hit a web applications. Let's assume I have a url to hit that requir

Re: [R] computing time for solve() in Matrix package

2012-06-27 Thread Oliver Ruebenacker
Hello, My guess would be that solve() does not take advantage of the special structure of the matrix and that you may want a sparse matrix representation. Take care Oliver On Tue, Jun 26, 2012 at 1:56 PM, Paul Rathouz wrote: > Hi -- I am wondering why the time to solve (invert)

[R] Simulating web requests

2012-06-27 Thread Mohan Radhakrishnan
Hi, I am looking for some assistance with these requirements. We are trying to simulate web requests to hit a web applications. Let's assume I have a url to hit that requires a username and password. 1. These web requests should have exponential inter arrival times. 2. Gene

Re: [R] question about formatting Dates

2012-06-27 Thread Rui Barradas
Hello, I'm afraid you're wrong, this has nothing to do with leading zeros. Just see: x <- c("1/2/2011", "1/4/2011", "1/4/2011", "1/4/2011", "1/6/2011", "1/7/2011", "1/8/2011", "1/9/2011", "1/10/2011") as.Date(x, "%m/%d/%Y") y <- factor(x) str(y) as.Date(as.character(y), "%m/%d

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not show the R² of the regression line. When I run

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread peter dalgaard
On Jun 27, 2012, at 09:33 , Christof Kluß wrote: > Hi > > is there a command that calculates the correct adjusted R-squared, when > I work without intercept? (The R-squared from lm without intercept is > false.) When people say that, they are usually implying that a "correct" R-squared can be

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Mikko Korpela
On 06/27/2012 10:33 AM, Christof Kluß wrote: > Hi > > is there a command that calculates the correct adjusted R-squared, when > I work without intercept? (The R-squared from lm without intercept is > false.) Hi! This answer in R-FAQ might help you: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Wh

Re: [R] selecting rows by maximum value of one variables in dataframe nested by another Variable

2012-06-27 Thread Petr PIKAL
Hi > > How could I select the rows of a dataset that have the maximum value in > one variable and to do this nested in another variable. It is a dataframe > in long format with repeated measures per subject. > I was not successful using aggregate, because one of the columns has You could do

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Uwe Ligges
On 27.06.2012 09:33, Christof Kluß wrote: Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) Then we need your definition of your version of "correct" - we know the definition of your versi

[R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) Greetings Chrsitof __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel