[R] PLM falling into the dummy variable trap -- how to fix?

2014-03-10 Thread Andrew Crane-Droesch
Dear list, CC Dr Croissant, I'm tryng to use plm with timeXgroup effects (in addition to the twoway effects), and running into problems with dummy variables. Eventually I want to take advantage of pgmm as well, but first I'd like to solve the problem with the non-dynamic version. An example:

[R] ts instead of xts object

2014-03-10 Thread Bill
Hello. I have a dataframe that has a date column. The intervals between dates vary. I want to convert this to a ts object. I was able to convert it to an xts object but the package I want to analyse this data with (called 'changepoint') does not seem to want to deal with xts. In the example they gi

[R] Rare Association Rule Mining

2014-03-10 Thread Alexander Kruse
Hello: I´m searching for some Example R Code on Rare Association Rule Mining/Infrequent Itemset Mining. Thanks in advance for any help. Alex __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] plotting tripgrid on PBSmapping

2014-03-10 Thread Michael Sumner
Hi, this doesn't have much to do with tripGrid, since the object to plot is just a SpatialGridDataFrame. I don't use PBSmapping, so I haven't looked at that - perhaps there is an add = TRUE option to plotMap (?), so perhaps you could do this: image(x2009.final) plotMap(..., add = TRUE) Your main

[R] How to know the what functions have used datasets in loaded packages.

2014-03-10 Thread Xing Zhao
Hi all, Once you start your R program, there are example data sets available within R along with loaded packages. Command data() will list all the datasets in loaded packages. Is there a method to know what R functions have used one of the datasets to present the function's utility, maybe at leas

[R] Why does ar.ols manual caution against intercept=T, demean=F

2014-03-10 Thread Bauer, Michael
The manual for ar.ols {stats} cautions against fitting a model with intercept to a time series that is not demeaned. From the manual: "Some care is needed if intercept is true and demean is false. Only use this is the series are roughly centred on zero. Otherwise the computations may be inaccur

[R] plotting tripgrid on PBSmapping

2014-03-10 Thread Trevor Davies
Hello, Sorry for the lack of a complete example but this is more of a class type question. I have a map of the coast that I generated through PBSmapping: xlims <- c(292,303.5) ylims <- c(41.5,49.5) plotMap(worldLLhigh, xlim=xlims, ylim=ylims, col=grey(0.1),bg=grey(0.9), xlab="", ylab="", las=1,

Re: [R] Data Frame to list?

2014-03-10 Thread Brian Diggs
On 3/7/2014 7:41 PM, Keith S Weintraub wrote: Folks, I have a data frame as follows: foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names = c("name", "num"), row.names = c(NA, -3L), class = "data.frame") str(foo) 'data.frame': 3 obs. of 2 variables: $ name: chr

Re: [R] catering for rescaling

2014-03-10 Thread Jim Lemon
On 03/10/2014 10:34 PM, Geoffrey wrote: My barplot has nicely left justified horizontal labels, the names of people. Written using text() . I use par("user")[1] - OFFSET to get the placed nicely. Now of course if i manually rescale/zoom the plot the labels get redrawn at the 'wrong' location, in

[R] Course: Beginner's Guide to MCMC, mixed models and GLMM with R

2014-03-10 Thread Highland Statistics Ltd
We would like to announce the following stats course: Course: Introduction to MCMC, Linear mixed effects models and GLMM with R Where: CIMA Research Foundation, Savona, Italy URL flyer: http://www.highstat.com/Courses/Flyer2014_05CIMA.pdf Course website: http://www.highstat.com/statscourse.htm

Re: [R] Subsetting between two values (into a range)????

2014-03-10 Thread Duncan Murdoch
On 14-03-10 10:47 AM, arun wrote: Hi, If 'dat' is the dataset: Try subset(dat, Start < MapInfo & End > MapInfo) A bit of advice I think I read in The Elements of Programming Style: try to make complex conjunctions look like their mathematical equivalents, and they'll be easier to read. The

Re: [R] Change of sign with division by zero, i.e. -1/0 = Inf ??

2014-03-10 Thread William Dunlap
The double precision number system (in the IEEE 754 format) includes two zeroes, one of each sign. They are hard to tell apart, but their reciprocals are Inf's of the appropriate sign and, in R 3.0.2, sprintf("%g",...) distinguishes them. > z <- c(0.0, -0.0) > z [1] 0 0 > z[1] == z[2] [1] TRUE

Re: [R] using diff function with by function

2014-03-10 Thread Rui Barradas
Hello, Maybe you want by(tr$srv_dt, tr$Rmbr, diff, lag=1, difference=1) Can't you ?dput a data example? dput(head(tr, 30)) # paste the output of this in a post Hope this helps, Rui Barradas Em 10-03-2014 16:10, Mckinstry, Craig escreveu: I have been trying to process a data.frame (tr) o

Re: [R] R Help

2014-03-10 Thread Rui Barradas
Hello, It's better to keep this on the list, the odds of getting more and better answers are greater. You need to type getwd() with the parenthesis and no arguments. It always returns something (the current wd). Rui Barradas Em 10-03-2014 18:00, Jon Nash escreveu: Hi Rui, Nothing of value i

Re: [R] Change of sign with division by zero, i.e. -1/0 = Inf ??

2014-03-10 Thread Berend Hasselman
On 10-03-2014, at 16:26, Cesar Caballero wrote: > Hi R-users, > > I am facing a strange behaviour that changes the sign of Inf with a division > by zero. > > In my script, I have defined the following 3 variables and the elementwise > division: > >> lambda_k[gamma_lambda] # numeric vector

Re: [R] Change of sign with division by zero, i.e. -1/0 = Inf ??

2014-03-10 Thread Sarah Goslee
Hi, Without a reproducible example (providing data with dput(), please) it's hard to say for certain, but my suspicion is that this is a R FAQ 7.31 issue. Sarah On Mon, Mar 10, 2014 at 11:26 AM, Cesar Caballero wrote: > Hi R-users, > > I am facing a strange behaviour that changes the sign of In

Re: [R] Subsetting between two values (into a range)????

2014-03-10 Thread arun
Hi, If 'dat' is the dataset: Try subset(dat, Start < MapInfo & End > MapInfo) A.K. Dear All, I want to subset a column (MapInfo in the attached photo) in csv file if its values be ranged between values in two other columns (Start and End in the attached photo) using R 3.0.1. Thank you in ad

[R] two maps with different color legends in spplot

2014-03-10 Thread Gianluca Filippa
Hi all, I am using spplot to plot two maps in the same device. In my case, I have a map of a certain variable and the same map of the standard deviation of the same variable. The range of the second is much smaller than the range of the first so my wish is to plot both but to have them on different

Re: [R] Building R for better performance

2014-03-10 Thread Anspach, Jonathan P
CE, Sorry for the delay. I haven't installed any additional packages, so I don't know the answer to your question. Let me look into it and get back to you. Regards, Jonathan Anspach Sr. Software Engineer Intel Corp. jonathan.p.ansp...@intel.com 713-751-9460 -Original Message- From: c

Re: [R] cum sums

2014-03-10 Thread David Winsemius
Df $cumval <- ave(Df$val, Df$val, cumsum) Df[-3] -- David > On Mar 10, 2014, at 1:57 AM, "Philip A. Viton" wrote: > > > Suppose I have a dataframe beginning: > > id yr val > a 1950 1 > b 1950 10 > a 1951 2 > > I'm trying to produce a table of cumulative sums > of val, disaggrega

[R] using diff function with by function

2014-03-10 Thread Mckinstry, Craig
I have been trying to process a data.frame (tr) on a grouping factor (Rmbr) using diff to find differences between srv_dt (a date) by Rmbr and keep getting the following error message > tmp <- by(tr,tr$Rmbr, diff, tr$srv_dt, lag=1, difference=1) Error in r[i1] - r[-length(r):-(length(r) - lag +

[R] Change of sign with division by zero, i.e. -1/0 = Inf ??

2014-03-10 Thread Cesar Caballero
Hi R-users, I am facing a strange behaviour that changes the sign of Inf with a division by zero. In my script, I have defined the following 3 variables and the elementwise division: > lambda_k[gamma_lambda] # numeric vector [1] -1 0 > del_lambda[gamma_lambda] # numeric vector [1] 0 -1 > ga

Re: [R] Raster projection shift Biomod

2014-03-10 Thread MacQueen, Don
Probably better to ask on r-sig-geo. Wouldn't it make more sense to export in a raster format, rather than csv? -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/10/14 10:24 AM, "Jenny Williams" wrote: >Hi all, > >I a

Re: [R] Shortest connected path in a matrix

2014-03-10 Thread MacQueen, Don
This might be done using GIS tools, where finding shortest paths between locations is a common task. But I can't help with details. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/5/14 9:44 AM, "McCloskey, Bryan" wrot

Re: [R] strucchange w dummy variables

2014-03-10 Thread Achim Zeileis
On Mon, 10 Mar 2014, Geoffrey Smith wrote: Hello, I am having trouble with the output from the strucchange package for a dummy variable regression. Why do I still get an intercept term in the output of lm03, below? library(lmtest) library(strucchange) data(GermanM1) #regular dummy regression

[R] strucchange w dummy variables

2014-03-10 Thread Geoffrey Smith
Hello, I am having trouble with the output from the strucchange package for a dummy variable regression. Why do I still get an intercept term in the output of lm03, below? library(lmtest) library(strucchange) data(GermanM1) #regular dummy regression with intercept lm01 <- lm(m ~ as.factor(seaso

Re: [R] R Help

2014-03-10 Thread William Dunlap
You probably want to read the Introduction to R that comes with R (menu: Help>Manuals (in PDF)>Introduction to R). If you have an function, f, and you type just 'f', then R prints the function, just as it does for any other object. > z <- function(x) + { + if (missing(x)) "" else x + 100

[R] Raster projection shift Biomod

2014-03-10 Thread Jenny Williams
Hi all, I am running Biomod with Albers Equal Area Conic Projection for Africa. Within Biomod all seems to work: I can generate a plot with the raster data and the presence and absence points plotted on top. However, when I go to export this to a *.csv file and create a shapefile from the point

[R] 3.1.0 on April 10

2014-03-10 Thread Peter Dalgaard
We intend to release R 3.1.0 on April 10. Prerelease versions will appear starting March 13 (for the source version, binaries may come a little later). See developer.r-project.org for details. -- Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000

Re: [R] R Help

2014-03-10 Thread William Dunlap
> I open up the GUI and type setwd("c:/users/jon") and press return. Nothing > happens Does "nothing happens" mean that R does not even print "> ", prompting you to enter more input? Did you get such a prompt before typing setwd("...")? What does typing 5:2 cause R to do? Bill Dunlap TIBCO

Re: [R] Graph densification in large networks

2014-03-10 Thread Rui Barradas
Hello, Take a look at package igraph. Hope this helps, Rui Barradas Em 10-03-2014 12:30, Lietz, Haiko escreveu: I didn't remember Leskovec et al.'s work correctly. They don't compute the number of new nodes and new edges per unit time but just the number of nodes and edges. This makes it a

Re: [R] F10.1 and i3 format in R

2014-03-10 Thread Rui Barradas
Hello, Take a look at ?sprintf. sprintf("%9.1f", 12.3) sprintf( %3d", 123) Hope this helps, Rui Barradas Em 10-03-2014 13:22, Stefano Sofia escreveu: Dear list members, I have to export (through 'write.table') a dataframe where two columns must be respectively F10.1 (floating with 10 digit

Re: [R] F10.1 and i3 format in R

2014-03-10 Thread Duncan Murdoch
On 10/03/2014 9:22 AM, Stefano Sofia wrote: Dear list members, I have to export (through 'write.table') Why restrict yourself to write.table? a dataframe where two columns must be respectively F10.1 (floating with 10 digits, 1 of which for the That's not the usual meaning for F10.1: normall

[R] F10.1 and i3 format in R

2014-03-10 Thread Stefano Sofia
Dear list members, I have to export (through 'write.table') a dataframe where two columns must be respectively F10.1 (floating with 10 digits, 1 of which for the decimal position) and i3 (integer of length 3). I looked at the 'format' options, but I couldn't see what I need. I also looked for som

Re: [R] Graph densification in large networks

2014-03-10 Thread Lietz, Haiko
I didn't remember Leskovec et al.'s work correctly. They don't compute the number of new nodes and new edges per unit time but just the number of nodes and edges. This makes it a lot easier. But nevertheless, if I wanted to compute the number of new edges - what package would I use for large (a

Re: [R] catering for rescaling

2014-03-10 Thread David Winsemius
If you use axis instead of text the positions should get set in user coordinates. -- David > On Mar 10, 2014, at 6:34 PM, Geoffrey wrote: > > My barplot has nicely left justified horizontal labels, the names of people. > Written using text() . I use par("user")[1] - OFFSET to get the placed

Re: [R] Help resolving issues with generating a chi-squared density plot from scratch

2014-03-10 Thread David Winsemius
If you set range of x in [0, something ] for for a function that goes to infinity for x=0, then what do you expect? > On Mar 10, 2014, at 7:30 AM, Levi Robinson wrote: > > I wrote the code to graph a chi-squared density function, shade the > percentile, and point to the CV, but it has a few is

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-10 Thread Stefano Sofia
Thank you to Arun and Petr for the give hints, veru useful. In order to get the date output in the required format, these are the commands that works: dat1$Date <- as.Date(paste(dat1$Y_init, dat1$M_init, dat1$D_init, sep=" "), format="%Y %m %d") dat1$Date1 <- strptime(as.character(dat1$Date), "

Re: [R] cum sums

2014-03-10 Thread Ista Zahn
Another option is library(plyr) ddply(df, "id", transform, valCS = cumsum(val)) Best, Ista On Mon, Mar 10, 2014 at 12:27 AM, Jim Lemon wrote: > In fact, I erred by summing both the year and the value, so i would > recommend Peter's (much less messy) solution. > > Jim > > > On 03/10/2014 02:57 P

[R] catering for rescaling

2014-03-10 Thread Geoffrey
My barplot has nicely left justified horizontal labels, the names of people. Written using text() . I use par("user")[1] - OFFSET to get the placed nicely. Now of course if i manually rescale/zoom the plot the labels get redrawn at the 'wrong' location, including off the left of the plot. I

Re: [R] package environment versus namespace environment

2014-03-10 Thread Duncan Murdoch
On 14-03-09 1:59 PM, Benjamin Tyner wrote: Duncan, Thanks for the explanation and commentary. Starting to make more sense...so, long story short, it seems the first thing one should check is whether base imports utils: > packageDescription("base") Package: base Version: 3.0.1 Pr

Re: [R] R Help

2014-03-10 Thread Rui Barradas
Hello, The function setwd returns the previous working directory invisibly so "nothing happens" might mean that there is no apparent feedback. You can see if it changed the wd with getwd(). Hope this helps, Rui Barradas Em 10-03-2014 10:58, Pascal Oettli escreveu: Hello, And what are you

Re: [R] R Help

2014-03-10 Thread Pascal Oettli
Hello, And what are you expecting the command "setwd" to do? Regards, Pascal On Mon, Mar 10, 2014 at 5:59 PM, Jon Nash wrote: > I have just installed R 3.0.3 on Windows 7. > > I open up the GUI and type setwd("c:/users/jon") and press return. Nothing > happens, Ive tried manuals, forums etc ...

[R] R Help

2014-03-10 Thread Jon Nash
I have just installed R 3.0.3 on Windows 7. I open up the GUI and type setwd("c:/users/jon") and press return. Nothing happens, Ive tried manuals, forums etc ... An ex-student needs help using this program. I spent 7 years as an IT consultant before becoming a maths teacher so Im better than ave

[R] Graph densification in large networks

2014-03-10 Thread Lietz, Haiko
Hi all, I have dynamic large 2-mode networks (1st mode ~50k nodes, 2nd mode ~500k nodes, timepoints ~100). I want to identify the number of new nodes and new edges per timepoint in folded 1-mode networks. In other words, I want to do measure graph densification as proposed by Leskovec et al.

Re: [R] Help resolving issues with generating a chi-squared density plot from scratch

2014-03-10 Thread Rolf Turner
I am far too lazy to go through all your rather complicated code, but my basic impression is that you are re-inventing quite a few wheels. Just to get a plot of the density function you can simply do, e.g.: plot(function(x){dchisq(x,1)},0,qchisq(0.999,1)) I can't see why you are fool

Re: [R] How to obtain a mean by more than one other variable

2014-03-10 Thread arun
Hi, If `dat` is the dataset: with(dat,ave(ABUNDHA,SITE,REP,FUN=mean)) #[1] 0.46 0.46 0.14 0.03 0.22 0.67 0.01 I am not sure how you got 0.45 when REP's are not the same. A.K. On Sunday, March 9, 2014 11:29 PM, Erynn Call wrote: I'm trying to create a new variable (meanABUNDHA) by obtaining a

[R] Normalized Maximum Likelihood (NML) criterion

2014-03-10 Thread Amer Bakkach
Dear R-help, i am working on some research and want to do some comparison among information criterion (e.g. AIC,BIC,..) and want to include (NML); i found "AICcmodavg" , "infotheo" -for mutual information- and "'SpatialExtremes" however i couldn't find any R-package that provide (NML) calculus; a

Re: [R] cum sums

2014-03-10 Thread Jim Lemon
In fact, I erred by summing both the year and the value, so i would recommend Peter's (much less messy) solution. Jim On 03/10/2014 02:57 PM, Peter Alspach wrote: Tena koe Philip An alternative to Jim's solution which seems to work and you may, or may not, find less messy: df<- read.table(t