Displaying 20 results from an estimated 23 matches for "davidhughjon".
Did you mean:
davidhughjones
2009 Jun 24
1
"by" question
...ig list, argh... how do I put it neatly back into the
mydata data frame?
for (i in unique(mydata$some_factor) {
mydata$newvar[mydata$somefactor ==i] <- result[[i]]
}
What should I be doing instead of this?
David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com
[[alternative HTML version deleted]]
2005 Apr 04
4
acf segfault (PR#7771)
Test case:
z <- ts(matrix(rnorm(200),10,20), start=c(1961,1))
acf(z,lag.max=1)
This segfaults for me. Maybe it shouldn't?
cheers
dave
--please do not edit the information below--
Version:
platform = i386-pc-linux-gnu
arch = i386
os = linux-gnu
system = i386, linux-gnu
status =
major = 2
minor = 0.1
year = 2004
month = 11
day = 15
language = R
Search Path:
.GlobalEnv,
2018 Aug 04
2
Puzzle or bug with matrix indexing
I'm not sure why this is happening:
tmp <- data.frame(
a = letters[1:2],
b=c(TRUE, FALSE),
stringsAsFactors = FALSE
)
idx <- matrix(c(1, 2, 2, 2), 2, byrow = TRUE)
tmp[idx]
[1] " TRUE" "FALSE"
Notice there is a space before the TRUE: " TRUE".
This space isn't happening purely because of coercion:
c("blah", TRUE, FALSE)
[1]
2018 Jul 30
5
apply with zero-row matrix
Forgive me if this has been asked many times before, but I couldn't find
anything on the mailing lists.
I'd expect apply(m, 1, foo) not to call `foo` if m is a matrix with zero
rows.
In fact:
m <- matrix(NA, 0, 5)
apply(m, 1, function (x) {cat("Called...\n"); print(x)})
## Called...
## [1] FALSE FALSE FALSE FALSE FALSE
Similarly for apply(m, 2,...) if m has no columns.
Is
2018 Mar 03
3
install.packages doesn't produce warnings unless qualified with utils::
Hi all,
Assuming this is an R core issue:
tryCatch(install.packages("clipr", repos = "bullshit"), warning = function
(w) cat("got a warning"))
Warning in install.packages :
unable to access index for repository bullshit/src/contrib:
cannot open URL 'bullshit/src/contrib/PACKAGES'
Warning in install.packages :
package ?clipr? is not available (for R
2018 Mar 03
0
install.packages doesn't produce warnings unless qualified with utils::
On Sat, Mar 3, 2018 at 1:33 PM, David Hugh-Jones
<davidhughjones at gmail.com> wrote:
> Hi all,
>
> Assuming this is an R core issue:
>
> tryCatch(install.packages("clipr", repos = "bullshit"), warning = function
> (w) cat("got a warning"))
> Warning in install.packages :
> unable to access index for r...
2006 Feb 27
2
heckit with a probit
Hi
I have data for voting behaviour on two (related) binary votes. I want
to examine the second vote, running separate regressions for groups
who voted different ways on the first vote. As the votes are not
independent, I guess that there is an issue with selection bias.
So, I think I would like to fit a heckit style model but with a binary
dependent variable - so, in effect, two successive
2006 May 31
1
interpolating a lot of data at once
I have a big dataset containing a lot of values for 1970, 1980 and
1990. I want to interpolate values for the years in between, and also
if possible to extrapolate to 1968 and 1969. The method doesn't have
to be clever but I am looking for a function that will do all the data
at once. (Doing foreach, or apply, is just too slow!) Is there
something that will take
list(df$val.1970, df$val.1980,
2006 Jun 16
2
inplace assignment
I get tired of writing, e.g.
data.frame[some.condition & another.condition, big.list.of.columns] <-
paste(data.frame[some.condition & another.condition,
big.list.of.columns], "foobar")
I would a function like:
inplace(paste(data.frame[some.condition & another.condition,
big.list.of.columns], "foobar"))
which would take the first argument of the inner
2006 Jun 20
0
inplace assignment: solution
...lt;- function (f, arg=1)
eval.parent(call("<-",substitute(f)[[arg+1]], f),2)
# examples in code
inplace(foo[bar,baz] *2)
# or
inplace(paste(foo[bar,baz], 1:10))
# or
inplace(sub("blah", "bleh", foo[bar,baz]), 3)
cheers
Dave
On 16/06/06, David Hugh-Jones <davidhughjones at gmail.com> wrote:
> It's more a general point about having to write things out twice when
> you do assignments. I could also have written:
>
> data.frame[some.condition & another.condition, big.list.of.columns] <-
> data.frame[some.condition & another.condition...
2009 Jul 01
1
simple question
...data frame DF. To do this, I need to know which rows in DF
correspond to rows in MF (since some were dropped by na.omit). How can I do
this? It''s probably simple but the information is hard to find.
David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com
[[alternative HTML version deleted]]
2009 Jul 07
3
how to read point shp file to R?
I am new with R and want do some analysis with a point vector data file. Any
help is appreciate. Sunny
[[alternative HTML version deleted]]
2009 Jul 08
1
clogit comparison between Stata and R
...stand why Stata is dropping the groups with all outcomes the same...
this is inevitable in a conditional logit, right? Is R doing the same? And
what might be the cause of the difference in coefficients?
Cheers
David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com
[[alternative HTML version deleted]]
2009 Dec 19
1
model matrix with a spline
...;t
do that.
Is there a way I can get the value of the already-created spline? And
is there a simple way to do this programmatically so I don't need to
check each term of the formula individually?
Cheers,
David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com
2011 May 26
1
table of Design regressions?
...more
regressions in the columns, a la xtable. But I am using models from the
Design package. Is there anything out there that will play nicely with that?
xtable doesn't seem to do the trick.
Cheers,
David Hugh-Jones
Research Associate
CAGE, Department of Economics
University of Warwick
http://davidhughjones.googlepages.com
[[alternative HTML version deleted]]
2018 Jul 30
0
apply with zero-row matrix
...4972BF87185B/www.dans.knaw.nl>
DANS is an institute of the Dutch Academy KNAW <http://knaw.nl/nl> and funding organisation NWO <http://www.nwo.nl/>.
On 30/07/2018, 11:12, "R-devel on behalf of David Hugh-Jones" <r-devel-bounces at r-project.org on behalf of davidhughjones at gmail.com> wrote:
Hi Martin,
Fair enough for R functions in general. But the behaviour of apply violates
the expectation that apply(m, 1, fun) calls fun n times when m has n rows.
That seems pretty basic.
Also, I understand from...
2005 Feb 10
2
correcting for autocorrelation in models with panel data?
Hi
I have some panel data for the 50 US states over about 25 years, and I
would like to test a simple model via OLS, using this data. I know how
to run OLS in R, and I think I can see how to create Panel Corrected
Standard Errors using
http://jackman.stanford.edu/classes/350C/pcse.r
What I can't figure out is how to correct for autocorrelation over
time. I have found a lot of R stuff on
2006 Jun 07
2
help with combination problem
hello:
I have 3 data.frame objects.
First df object:
Of dim (149,31). Columns 2:31 are marked as T1..T14
and N1..N16.
Name T1 T2 N1 T3 N2 N3 N4 T4
mu1 10 10 9 10 9 9 8 10
mu2 11 11 9 11 9 9 9 11
...
muN 12 12 9 11 9 9 8 12
Second df object:
of Dim (50000,31). Columns 2:31 are maked as T1...T14
and N1..N16.
2018 Jul 30
3
Fwd: help building very old R
Hi guys,
Perhaps someone here can help.
I am trying to build versions of R 1 for the rcheology package (just
arrived on CRAN).
For R prior to 1.5.0, I cannot configure support for tcl-tk.
I am building on Debian Woody (provided by Docker debian/eol) and have the
following packages installed:
r-base-dev tclx8.3-dev tk8.3-dev xvfb xbase-clients x-window-system-core
I download R source from
2011 Jul 12
1
fixed effects Tobit, Honore style?
Hi all,
Is there any code to run fixed effects Tobit models in the style of Honore
(1992) in R?
(The original Honore article is here:
http://www.jstor.org/sici?sici=0012-9682%28199205%2960%3A3%3C533%3ATLALSE%3E2.0.CO%3B2-2)
Cheers
David
[[alternative HTML version deleted]]