Displaying 14 results from an estimated 14 matches for "chuckwhite8".
2010 Jan 29
1
SemiPar/spm question
Hello -- I posted this question yesterday and for some reason the post seems to be attached to the wrong thread. Also, I extended my test a little and it seems to indicate the problem is with spm. I would appreciate any help. Thanks.
==========================================================
library(plyr)
library(SemiPar)
data <-
2010 Feb 11
1
aggregate function / custom column names?
This question is about column names returned by the aggregate function. Consider the following example
df <- data.frame(
id = c(rep('11',30),rep('22',30),rep('33',30)),
value = c(rnorm(30,2,0.5), rnorm(30,3,0.5), rnorm(30,6,0.5))
)
aggregate(df[,c("value"),drop=FALSE], by=list(id=df$id), max)
output:
id value
1 11 2.693528
2 22 3.868400
3 33
2010 Jan 25
2
(no subject)
Hello -- I would like to know of a more efficient way of writing the following piece of code. Thanks.
options(stringsAsFactors=FALSE)
orig <- c(rep('11111111',100000),rep('22222222',200000),rep('33333333',300000),rep('44444444',400000))
orig.unique <- unique(orig)
system.time(df <- as.data.frame(sapply(orig.unique, function(x) ifelse(orig==x, 1, 0))))
2010 Feb 02
1
ggplot/time series with indicators question
Hello, I am trying to plot time-series data with certain weeks highlighted using symbols.
require(ggplot2)
#plotting time series data
timescale <- seq(as.Date("01/01/09","%m/%d/%y"), length.out=12, by=7)
data.all <- data.frame(
id = c(rep('111',12),rep('222',12),rep('333',12)),
week=c(timescale,timescale,timescale),
2009 Nov 10
1
merge data
df1 -- dataframe with column date and several other columns. #rows >40k Several of the dates are repeated.
df2 -- dataframe with two columns date and index. #rows ~130 This is really a map from date to index.
I would like to create a column called index in df1 which has the corresponding index from df2.
The following works:
index <- NULL
for(wk in df1$week){
index <-
2010 Feb 04
2
ggplot2 / time series with different scales
I am trying to plot this dataset using ggplot2:
df <- data.frame(
sid = c(rep('11',30),rep('22',30)),
time = rep(ISOdate(year = 2010, month = 1, day = 1:30),2),
sales = c(rnorm(30, 1000, 20),rnorm(30, 900, 10)),
price = c(rnorm(30, 2, 0.5),rnorm(30, 3,0.5))
)
Plotting just the sales can be done easily:
ggplot(data=df, aes(x=time, y=sales, group=sid, color=sid)) +
2010 May 12
1
R 2.11.0 on RHEL5 / RODBC
I am compiling R 2.11.0 on a RHEL5.3 box using the following settings
./configure --with-readline=yes --enable-R-shlib=yes --with-x=yes --with-blas="-llibptf77blas -lpthread -llibatlas" --prefix=/usr/local/R-2.11.0 JAVA_HOME=$JAVA_HOME CPPFLAGS="-I/usr/local/unixODBC-2.3.0/include"
I have compiled and installed unixODBC-2.3.0 (64-bit) in /usr/local and can connect to and
2009 Nov 11
1
lm and levels
Consider the following example:
x <- c(2,4,3,6)
y <- c(4,9,5,10)
z <- factor(c(1,1,2,2))
summary(lm("y ~ x + z"))
The above works fine.
Suppose I change z so that
x <- c(2,4,3,6)
y <- c(4,9,5,10)
z <- factor(c(1,1,2,NA))
summary(lm("y ~ x + z"))
the last row/observation is not considered in the regression. I would like this to be treated as z with two
2009 Oct 17
1
R292 on AIX53 using gcc
I apologize for cross posting this message in the R-help group as well. Having posted it there a couple of hours ago, I felt this may be a more appropriate forum for a question of this type.
Hello -- I am unable to build R 2.9.2 on IBM PowerPC AIX5.3. I would appreciate
any help in this matter.
===============details==============================
Machine: IBM PowerPC_POWER5 / 4 proc, 1499
2009 Nov 02
2
R292 and tcl/tk
BACKGROUND
R2.9.2 built on power5 aix5.3 using gcc 4.2.4 (also installed: tcl and tk 8.5.7)
Access from a Windows XP machine using Exceed v9.0, aixterm (DISPLAY etc. setup)
export LDFLAGS="-L/usr/lib64 -L/opt/freeware/lib64 -L/opt/freeware/64/lib -L/usr/X11R6/lib -L/opt/freeware/lib"
export CPPFLAGS="-I/opt/freeware/include -I/usr/lpp/X11/include/X11"
2010 Jan 26
0
splitting a factor column into binary columns for each level
Yesterday I posted the following question (my apologies for not putting a subject line):
=================question======================
Hello -- I would like to know of a more efficient way of writing the following piece of code. Thanks.
options(stringsAsFactors=FALSE)
orig <- c(rep('11111111',100000),rep('22222222',200000),rep('33333333'
2009 Oct 31
3
unable to compile RODBC (R 2.9.2, AIX)
Hello -- I am trying to compile (linker error, not compiler error) RODBC for R 2.9.2 on AIX 5.3 using gcc. I get the following error:
gcc -maix64 -pthread -std=gnu99 -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/usr/lib -L/usr/X
11R6/lib -L/usr/local/lib -L/opt/freeware/lib -L/opt/freeware/lib64 -o RODBC.so RODBC.o -lodbc -lm -L/usr/l
ocal/builddir/lib -lR
ld: 0711-738 ERROR: Input
2009 Oct 28
4
unable to compile mgcv
Hello -- I am trying to compile R-2.9.2 on IBM Power5 machine with AIX 5.3. I have posted three previous posts. Over time I have made significant progress towards getting a successful build. I am now getting the following error:
==========================================================
begin installing recommended package mgcv
* Installing *source* package 'mgcv' ...
** libs
gmake[2]:
2010 Jan 26
1
splitting a factor column into binary columns for each factor
Yesterday I posted the following question (my apologies for not putting a subject line):
=================question======================
Hello -- I would like to know of a more efficient way of writing the following piece of code. Thanks.
options(stringsAsFactors=FALSE)
orig <- c(rep('11111111',100000),rep('22222222',200000),rep('33333333'