Displaying 20 results from an estimated 600 matches similar to: "Help needed in fine tuning the sapply output"
2010 Jan 02
3
Help needed on applying a function across different data sets and aggregating the results into a single data set
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain function on
the same set of columns in each of the data set. Let's take, for ex, the
typical data set is:
df1 <- as.data.frame(cbind(rnorm(10),rnorm(10)))
names(df1)[1] <- "A"
names(df1)[2] <- "B"
There are many
2010 Feb 04
1
plm issues: error for "within" or "random", but not for "pooling"
Dear all
I am working on unbalanced panel data and I can readily fit a
"pooling" model using plm(), but not a "within" or "random" model.
Reproducing the examples in vignette("plm") and in the AER package I
encountered no such issues.
##unfortunately I cannot disclose the data, and it is too big anyway
> dim(ibes.kld.exp.p[x.subs , ])
[1] 13189 34
2010 Feb 25
2
error using pvcm() on unbalanced panel data
Dear all
I am trying to fit Variable Coefficients Models on Unbalanced Panel
Data. I managed to fit such models on balanced panel data (the example
from the "plm" vignette), but I failed to do so on my real, unbalanced
panel data.
I can reproduce the error on a modified example from the vignette:
> require(plm)
> data("Hedonic")
> Hed <- pvcm(mv ~ crim + zn + indus
2016 May 05
1
Too many spaces in deparsed complex numbers with digits17 control option
If you set the "digits17" control option in deparse, you get a lot of
unnecessary space in the representation of complex numbers.
> deparse(0 + 0i)
[1] "0+0i"
> deparse(0 + 0i, control = "digits17")
[1] "0 + 0i"
As far as I can tell, the logic for this comes from this piece of
/src/main/deparse.c:
if (TYPEOF(vector) == CPLXSXP
2009 Dec 20
1
basic proto question
Dear list,
I made the following example of a proto object that contains some data
and a spline interpolation. I don't understand why test$predict()
fails with this error message:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Best regards,
baptiste
test <- proto(source = data.frame(x=1:10, y=rnorm(10)),
raw = function(.){
2009 Dec 29
1
ggplot2, building a simple formula interface
I?m trying to build a simple formula interface to work with a function using
ggplot2. The following scheme ?works? up until the plot(p) request, at which
point there are complaints about xlim?s and a blank graphics window.
Looking at str(p) I do see the limits are NULL, plus layer 1 claims to have
an empty data frame (but df is reproduced correctly). I'm sure I'm missing
something really
2009 Oct 14
1
ltm package error for grm (IRT)
Using the grm function (graded response IRT model) in the ltm package I
receive the following error:
Error: subscript out of bounds
for several scales I'd like to examine. Here's a small example that if run a
few times will likley produce the error at least once
ch<-array(round(runif(50,1,5)),c(10,5))
grm(ch,start.val="random")
## or
2011 Oct 01
1
error using ddply to generate means
Dear list,
I encounter an error when I try to use ddply to generate means as follows:
fun3<-structure(list(sector = structure(list(gics_sector_name = c("Financials",
"Financials", "Materials", "Materials")), .Names = "gics_sector_name",
row.names = structure(c("UBSN VX Equity",
"LLOY LN Equity", "AI FP Equity",
2009 Feb 20
6
write.table
Hello,
I tried to turn lists into vectors and then bind them together in order to create a dataframe but if, after this, I
try to use the function write.table I get the following error message:
Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), :
'list' type not implemented in 'EncodeElement'
Here is what I've done:
2010 Jul 13
0
Modify the plotting parameters for Vennerable obj.
Dear List,
I would like to modify the settings for plotting a Vennerable object,
but I don't know how...so if anyone has an idea I would be really
graetfull.
best, Fabian
some R code to illustrate my problem:
####
library(Vennerable)
ven <- compute.Venn(Venn(SetNames=c("A", "B"), Weight=c(0,111,106, 26)))
# now my problem is that whenever I plot the object, the
2009 Nov 27
1
my failing understanding ...
The following I do not understand, but then I did'nt really use
S4 methods ...
> showMethods(plot)
Function: plot (package graphics)
x="ANY"
x="lmList.confint"
x="merMCMC"
(inherited from: x="ANY")
> plot(x=moda0MCMC)
Error in as.double(y) :
cannot coerce type 'S4' to vector of type 'double'
> class(moda0MCMC)
[1]
2009 Nov 10
0
qplot error
When I invoke qplot, I get the following error:
Error in rename.default(x, .base_to_ggplot) : object '.data' not found
I would appreciate any advice.
sessionInfo:
R version 2.10.0 (2009-10-26)
i386-pc-mingw32
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
2011 Jun 18
0
Unexpected result with lag() et diff() in plm package.
I have an unexpected result with the functions lag() and diff() in the plm
(panel data) package when used with transform(). These plm-specific
functions are supposed to generate lags and first differences within each
panel.
lag() does not work properly the first time (it reproduces the same
series--this is a common time series pitfall), BUT then it does work
properly when it is run a second
2009 Jun 24
1
how to undo automatic loading of packages?
I wanted to try out package distrMod, so I did
> install.packages('distrMod')
> library(distrMod)
and played around, saved and quit.
Now whenever I start up in this directory, I get distr and lots of other
stuff loaded and lots of messages.
How do I keep it from automatically loading, other than starting over in
another directory?
I read ?Startup, but I couldn't suss out
2012 Jan 06
1
ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)
Dear all,
ggplot gives me an error when trying to plot time series data using a
date variable as the x axis.
g<-structure(list(Date = c("2011-12-23", "2011-12-30", "2012-01-06",
"2011-12-23", "2011-12-30", "2012-01-06", "2011-12-23", "2011-12-30",
"2012-01-06"), variable = structure(c(1L, 1L, 1L, 2L, 2L,
2012 Aug 08
3
Can not find lme
Dear all,
Can anyone help me, my R software can not run a nested linear regression by using the lme funcion. The message that appears isĀ
Error: could not find function "lme"
I already downloaded and loaded the package, please see below. Thank you in advance for any help! Nadia.
> data<-read.csv("/Users/nadiasan1/Desktop/MOE and MOR.csv")> attach(data)>
2009 Jul 04
4
help with dealing with integer(0) returns from grep used within a conditional loop
I am using grep to locate colnames to automate a report build and have
run into a problem when a colname is not found. The use of integer(0)
in a conditional statement seems to be a no no as it has length 0.
Below is a self-contained trivial example. I would like to get
something like "NA" or -1 for the position when it is not found OR
learn a way to use integer(0) or some
2009 Dec 31
3
XML and RCurl: problem with encoding (htmlTreeParse)
Hi,
I'm trying to get data from web page and modify it in R. I have a
problem with encoding. I'm not able to get
encoding right in htmlTreeParse command. See below
> library(RCurl)
> library(XML)
>
> site <- getURL("http://www.aarresaari.net/jobboard/jobs.html")
> txt <- readLines(tc <- textConnection(site)); close(tc)
> txt <- htmlTreeParse(txt,
2009 Nov 28
1
Plot-region not complete
Hello there,
after I solved many problems in the last days with R I wanted to
complete my plot. I used
ylab=expression(paste("log(",mu,"/",cm^2,"/VS)"))
to have greek symbols and to change cm^2 to cm?. Also cm^-3 I have in
another plot, but it cuts my ^2 to _ in the y-axis.
here is the code and I attach the plot:
jpeg(file="Tabh2.jpg",quality=100)
2010 Jul 16
1
Troubles with DBI's dbWriteTable in RMySQL
I am feeling rather dumb right now.
I created what I thought was a data.frame as follows:
aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id)
m_id_default_res <- do.call(rbind, aaa)
print("==========================================")
m_id_default_res
print("==========================================")
ndf <- m_id_default_res[, c('mid',