Displaying 20 results from an estimated 50000 matches similar to: "Question on substitute."
2012 Nov 06
2
Question on callNextMethod
I don't understand why I get the following results. I define two classes
'Base' and 'Derived', the latter of which 'contains' the first. I then
define a generic method 'test' and overload it for each of these classes. I
call 'callNextMethod()' in the overload for Derived. From the output, it
appears that the overload for Base gets called twice. Why is
2009 Jan 07
1
proto question
Dear R Users,
I have a couple of proto objects like:
wedge <- proto(expr={
start.year <- 2008
end.year <- 2050
})
star.rating <- wedge$proto(
star = c(4, 5, 8, 10),
gain = c(0, .3, .5, .7),
cost = c(0, 2100, 4000, 7500),
star.rating <- function(., year) 6.0,
setup = function(.){
.$cost.for.star <- approxfun(.$star,
2017 Oct 10
1
Unbalanced data in split-plot analysis with aov()
Dear all,
I'm analysing a split-plot experiment, where there are sometimes one or
two values missing. I realized that if the data is slightly unbalanced,
the effect of the subplot-treatment will also appear and be tested
against the mainplot-error term.
I replicated this with the Oats dataset from Yates (1935), contained in
the nlme package, where Variety is on mainplot, and nitro on
2014 Aug 12
1
Define 'in' for new class
Hi List,
Is it possible to define how 'in' works for an object of a specific class
(to achieve a similar result to implementing the iterator protocol in a
class Python)?
Cheers,
Simon Knapp
[[alternative HTML version deleted]]
2009 Feb 07
1
fixed effects regression
Hi everyone,
I am running this fixed effects model in R.
The thing is, my own code and the canned routine keep returning different estimates for the fixed effects factors and intercept.
(The other variables' estimates and R^2 are the same!!! weird!!)
I attach my own code, just in case.
I am pretty sure this would not have any fundamental error. Well, hopefully. I have been using this code
2011 Jul 04
2
RWinEdt problem
Hi R Helpers,
I am a long time RWinEdt user and have just acquired a new laptop. I have
installed RWinEdt and things are going smoothly except for one small glitch
- file names are not appearing on the document tabs. When I use WinEdt (as
opposed to RWinEdt), they are appearing. Can anyone offer any advice on
this?
Thanks in advance,
Simon Knapp
OS: windows7
Arch: 64 bit
R version: 2.13.0
2018 Feb 13
3
Suppress horizontal mean line in beanplot()
Hi,
I would like to use the beanplot() function from the beanplot package.
Unfortunately, I can't find out how to suppress the dashed horizontal
line, that shows the overall mean.
In the help I've found the argument "overallline", but it only allows
for "mean" or "median" .
I have tried overallline = F, overallline="n", and
2011 Mar 28
2
xlsx problem
Dear list,
I'm running windows xp with R 2.12.0. I'm trying to load a excel
spreadsheet into R using the xlsx package. I posted my code below with
the error I get.
> res <- read.xlsx("Copy of test_excel_input_data.xlsx", 6)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.IllegalStateException: Cannot get
2013 Jul 19
1
Problem with distributing data in package.
Hi List,
I am building a package for a client to help them create and perform
analyses against netcdf files which contain 'a temporal stack' of
grids.
For my examples and test cases, I create an example dataset in code
(as this is a lot more space efficient than providing raw data). The
code creates a netcdf file in tempdir() and an object of class 'ncdf'
in the global namespace.
2014 Oct 17
1
Holding a large number of SEXPs in C++
Background:
I have an algorithm which produces a large number of small polygons (of the
spatial kind) which I would like to use within R using objects from sp. I
can't predict the exact number of polygons a-priori, the polygons will be
grouped into regions, and each region will be filled sequentially, so an
appropriate C++ 'framework' (for the point of illustration) might be:
typedef
2011 May 12
2
DCC-GARCH model and AR(1)-GARCH(1,1) regression model
Hello,
I have a rather complex problem... I will have to explain everything in
detail because I cannot solve it by myself...i just ran out of ideas. So
here is what I want to do:
I take quotes of two indices - S&P500 and DJ. And my first aim is to
estimate coefficients of the DCC-GARCH model for them. This is how I do it:
library(tseries)
p1 = get.hist.quote(instrument =
2008 May 30
3
loess plot
I was trying to plot some data in R. I used the following code to draw a loess fit and got the output as
>?lines(lowess(log(abs(t(res))), log(abs(t(synthesised)))), col="red")
Error in lowess(log(abs(t(res))), log(abs(t(synthesised)))) :?? NA/NaN/Inf in foreign function call (arg 1)
Then I thought to use your Limma package for background correction. Do you think it's a right
2010 Jan 12
2
Calculate the percentages of the "numbers" in every column.
Dear friends,
I have a table like this, I have A B C D ... levels, the first column
you see is just the index, and there are different numbers in the
table.
A B C D ...
1 0 2 1 0
2 1 0 2 1
3 2 3 0 0
4 0 0 1 0
5 0 2 3 1
...
I want to calculate the frequencies or the percentages of the numbers
in every column.
How do I get a table like this,
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list:
funweek <- function(df)
if (length(df$elapsed_time) > 5) {
res = fitdist(df$elapsed_time,"exp")
year = df$sale_year[1]
sample = df$sale_week[1]
mid = df$m_id[1]
estimate = res$estimate
sd = res$sd
samplesize = res$n
loglik = res$loglik
aic = res$aic
bic = res$bic
chisq =
2006 Aug 02
4
College course on Ruby on Rails
Hello all,
I am very happy to announce that registration for my new course entitled
"Ruby on Rails Development" at my college is now open. We are offering this
course as part of our LAMP certificate which is designed for working
professionals who want to upgrade their skills.
I think that it is a sign of Rails'' growing maturity that I was able to
propose this and work it
2011 Nov 17
1
Exclude NA while summing
Dear R users,
I am new to R and have some query.
I am having a dataset with binary output 0's and ones. But along with it it
has NA's too. I want to sum all the rows and get the sum total for each
column.
But whenever there is a NA in an row the sum of the row is returned as NA
so I am not able to sum up the values.
*row.sums.m <- apply(dummy.curr.res.m,1,sum)*
It would be helpful
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where
#one firm in the first have a corresponding
2018 Nov 23
1
[tryExcept] New try Function
Hi Emil,
First, thanks for the response. As you mentioned, a lot of times tryCatch
does the work, as you can return a value. However, sometimes it is useful
to assign several variables when an error occurs. You could do it with <<-,
but I prefer to reduce it's usage unless completely necessary.
I guess that the attachment was missed in the moderation. Here it is the
function:
2009 Nov 06
1
issues with SSOAP when wsdl has ComplexTypes
I recently started trying R and SSOAP and was able to successfully try a "hello
world" service. I am now trying to get a more complicated interface to work with
SSOAP and so far failed miserably at that and so need any help I can
get from here.
The service I am attaching is a prototype for a full service that would
take information to identify a data source and a query to run and
return
2009 Oct 02
1
ggplot2: proper use of facet_grid inside a function
Hello Again R Folk:
I have found items about this in the archives, but I?m still not getting
it right. I want to use ggplot2 with facet_grid inside a function with
user specified variables, for instance:
p <- ggplot(data, aes_string(x = fac1, y = res)) + facet_grid(. ~
fac2)
Where data, fac1, fac2 and res are arguments to the function. I have
tried
p <- ggplot(data,