[R] lmer() computational performance

2011-06-29 Thread zubin
Hello, running a mixed model in the package LME4, lmer()

Panel data, have about 322 time periods and 50 states, total data set is
approx 15K records and about 20  explanatory variables.  Not a very
large data set. 

We run random intercepts as well as random coefficients for about 10 of
the variables, the rest come in as fixed effects.   We are running into
a wall of time to execute these models. 

A sample specification of all random effects:

lmer(Y ~ 1 + (x_078 + x_079 + growth_st_index  +
retail_st_index + Natl + econ_home_st_index +
econ_bankruptcy +  index2_HO  + GPND_ST  | state),
data = newData, doFit = TRUE)

Computation time is near 15 minutes.
SystemELAPSEDUser
21.4888.63701.74


Does anyone have any ideas on way's to speed up lmer(), as well any
parallel implementations, or approaches/options to reduce computation time?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] str() on a data frame with 600 variables

2011-04-15 Thread zubin
perfect! thx

On 4/15/2011 8:43 AM, Duncan Murdoch wrote:
> On 15/04/2011 8:19 AM, zubin wrote:
>> Hello..
>>
>> How do I get str() to show all variables in a data frame? It seems to be
>> "list output truncated" at about 99 variables, the data frame has over
>> 600 but i can't seem to figure out how to show all variables, we see
>> list.len() but again can't seem to figure this out - help will be
>> appreciated.
>>
>> R>  str(raw)
>>
>> 'data.frame': 1201 obs. of  626 variables:
>>
>> .
>>
>> .
>>
>> $ varXYZ: int  0 0 0 0 0 0 0 0 0 0 ...
>>
>>[list output truncated]
>>
> Use str(raw, list.len=1000).
>
> Duncan Murdoch
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] str() on a data frame with 600 variables

2011-04-15 Thread zubin
Hello..

How do I get str() to show all variables in a data frame? It seems to be
"list output truncated" at about 99 variables, the data frame has over
600 but i can't seem to figure out how to show all variables, we see
list.len() but again can't seem to figure this out - help will be
appreciated. 

R> str(raw)

'data.frame': 1201 obs. of  626 variables:

.

.

$ varXYZ: int  0 0 0 0 0 0 0 0 0 0 ...

  [list output truncated]



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R package rating site?

2011-01-24 Thread zubin
We should really have an R package rating site, comments, reviews or
such, like folks do for apps or movie reviews.  Does anyone know of a
site trying to do this.  If i remember correctly a few R user
conferences ago this was talked about but not sure if anything was ever
implemented.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Create Table & Delete Table using JDBC

2010-05-01 Thread zubin
Hello,  using RJDBC within R and successful at fetching and writing
data, one quick question that I can't find an answer to: 

Running a drop table and create table query, they run and they work, but
R returns a error.  I am using dbSendQuery - i thought dbSend just
submits SQL and does not expect a result set - does anyone know how to
avoid the error?  It should be a warning not an error i think - as the
commands are working on the database. 


dbSendQuery(conn,"DROP TABLE loyalty")
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for
",  :
  Unable to retrieve JDBC result set for DROP TABLE loyalty (No results
were returned by the query.)

dbSendQuery(conn,"CREATE TABLE loyalty (ID varchar(30))")
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for
",  :
  Unable to retrieve JDBC result set for CREATE TABLE loyalty (ID
varchar(30)) (No results were returned by the query.)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] creating a variable using concatenation

2010-03-30 Thread zubin
Perfect - this works!!  -zubin

Peter Alspach wrote:
> Tena koe Zubin
>
> Would this work for your application:
>
> toPlot <- paste("X",i,sep="")
> plot(x[, toPlot])
>
> HTH 
>
> Peter Alspach
>
>   
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
>> project.org] On Behalf Of zubin
>> Sent: Wednesday, 31 March 2010 2:25 p.m.
>> To: r-help@r-project.org
>> Subject: [R] creating a variable using concatenation
>>
>> A general problem i run into, i know there must be a simple solution.
>>
>> I like to create a variable by appending a 1 for example, (i need to
>> loop later on from 1 to X, thus the reason for this).   So i assign
>> 
> the
>   
>> variable vplot with this value, however it has quotes and when i use
>> 
> it
>   
>> in a barplot, it throws an error.  but the tcenter$X1 does exist, its
>> an
>> element of a data frame.  So if i type directly it works, but i like
>> 
> to
>   
>> do this programmatically, as i have to generate a bunch of these plots
>> and need to loop.
>>
>> So how do i concatenate to create a variable, then reference that
>> variable in a function call?
>>
>>
>> R> x <- data.frame(1,2,3,4,5,6,7,8)
>> R> x
>>   X1 X2 X3 X4 X5 X6 X7 X8
>> 1  1  2  3  4  5  6  7  8
>> R> x$X1
>> [1] 1
>>
>> R> i=1
>> R> toplot <- paste("x$X",i,sep="")
>> R> toplot
>> [1] "x$X1"
>>
>> okay lets test:
>>
>>  R> plot(x$X1)
>> -it works i see the plot
>>
>> however this DOES not work
>>
>> R> plot(toplot)
>>
>> Error in plot.window(...) : need finite 'ylim' values
>> In addition: Warning messages:
>> 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by
>> 
> coercion
>   
>> 2: In min(x) : no non-missing arguments to min; returning Inf
>> 3: In max(x) : no non-missing arguments to max; returning -Inf
>>
>>
>> Thus, that's my problem, i know it must be simple -  the variable is
>> equal to x$X1 but it does not work in a function call?  i tried many
>> functions - always some type of error.
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
>
>   

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] creating a variable using concatenation

2010-03-30 Thread zubin
A general problem i run into, i know there must be a simple solution. 

I like to create a variable by appending a 1 for example, (i need to
loop later on from 1 to X, thus the reason for this).   So i assign the
variable vplot with this value, however it has quotes and when i use it
in a barplot, it throws an error.  but the tcenter$X1 does exist, its an
element of a data frame.  So if i type directly it works, but i like to
do this programmatically, as i have to generate a bunch of these plots
and need to loop. 

So how do i concatenate to create a variable, then reference that
variable in a function call?


R> x <- data.frame(1,2,3,4,5,6,7,8)
R> x
  X1 X2 X3 X4 X5 X6 X7 X8
1  1  2  3  4  5  6  7  8
R> x$X1
[1] 1

R> i=1
R> toplot <- paste("x$X",i,sep="")
R> toplot
[1] "x$X1"

okay lets test:

 R> plot(x$X1)
-it works i see the plot

however this DOES not work

R> plot(toplot)

Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf


Thus, that's my problem, i know it must be simple -  the variable is equal to 
x$X1 but it does not work in a function call?  i tried many functions - always 
some type of error.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R and Hierarchical Forecasting

2009-12-15 Thread zubin
Hello, does anyone know of any R routines capable of whats called
Hierarchical Forecasting, reconciling the different hierarchies. 

Example: A top down forecast where the corporate forecast is created and
then all the regions within the corporate entity are also forecasted,
with the constraint they sum to the corporate forecast.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] dynlm predict with newdata?

2009-11-22 Thread zubin
Hello, can one use predict, as you can with other model objects like lm,
with dynlm to predict a new data set that is identical in field names,
just a different time period. 

Be nice if you could, I don't really want to create a new data set with
all the lags, hoping it would generate dynamically.  Does not seem to
work, get a # of column error.  Any suggestions?


R> str(dfz)
An 'xts' object from 2009-09-25 09:45:06 to 2009-10-19 15:00:57 containing:
  Data: num [1:28232, 1:8] 0.54771 -0.00825 1.27406 0.69705 1.08107 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:8] "PC1" "PC2" "PC3" "PC4" ...
  Indexed by objects of class: [POSIXt,POSIXct] TZ: GMT
  xts Attributes:  
 NULL

R> str(z)
An 'xts' object from 2009-10-21 09:45:04 to 2009-10-21 15:00:56 containing:
  Data: num [1:2304, 1:8] -0.5044 1.237 -0.7764 0.3931 0.0629 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:8] "PC1" "PC2" "PC3" "PC4" ...
  Indexed by objects of class: [POSIXt,POSIXct] TZ: GMT
  xts Attributes:  
 NULL


dols = dynlm(FAS0 ~ L(FAS0,1:10) + L(PC1,0:10) + L(PC2,0:10) +
L(PC3,0:10) + L(PC4,0:10) + L(PC5,0:10) + L(PC6,0:10) + L(PC7,0:10),
data=dfz)

R> predict(dols,newdata=z)

/*Error in fix.by(by.x, x) : 'by' must match numbers of columns*/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] prcomp - principal components in R

2009-11-09 Thread zubin
All 8 variables are still in the analysis, i am just reducing the number 
of components being estimated i thought..


Example 1 component 8 variables, there is no way 1 component explains 
100% of the variance of the 8 variable data set.


> princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.95)
> summary(princ)
Importance of components:
   PC1
Standard deviation 1.38
Proportion of Variance 1.00
Cumulative Proportion  1.00

> summary(princ)

Rotation:
   PC1
VIX0-0.08217686
UUP0-0.18881983
USO0 0.26647346
GLD0 0.26983923
HYG0 0.60674758
term00.18220237
spread0  0.61614047
TNX0 0.18111684




Daniel Malter wrote:

In the first PCA you ask how much variance of the EIGHT (!) variables is
captured by the first, second,..., eigth principal component.

In the second PCA you ask how much variance of the THREE (!) variables is
captured by the first, second, and third principal component.

Of course you need only as many PCs as there are variables to capture 100 %
of the variance. Your "problem" thus comes from the fact that you have eight
variables in the first PCA, which requires eight PCs to capture 100%, and
that you have only three variables in the second PCA, which naturally only
requires three PCs to capture 100% of the variance.

So it's more, yes, you are missing something in this case, rather than that
something is wrong with the analyses.

HTH,
Daniel

-
cuncta stricte discussurus
-

-Ursprüngliche Nachricht-
Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im
Auftrag von zubin
Gesendet: Monday, November 09, 2009 12:37 PM
An: r-help@r-project.org
Betreff: [R] prcomp - principal components in R

Hello, not understanding the output of prcomp, I reduce the number of
components and the output continues to show cumulative 100% of the variance
explained, which can't be the case dropping from 8 components to 3. 


How do i get the output in terms of the cumulative % of the total variance,
so when i go from total solution of 8 (8 variables in the data set), to a
reduced number of components, i can evaluate % of variance explained, or am
I missing something??

8 variables in the data set

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE)
 > summary(princ)
Importance of components:
 PC1   PC2   PC3   PC4   PC5   PC6PC7PC8
Standard deviation 1.381 1.247 1.211 0.994 0.927 0.764 0.6708 0.4366
Proportion of Variance 0.238 0.194 0.183 0.124 0.107 0.073 0.0562 0.0238
Cumulative Proportion  0.238 0.433 0.616 0.740 0.847 0.920 0.9762 *1.*

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.75)
 > summary(princ)

Importance of components:
 PC1   PC2   PC3
Standard deviation 1.381 1.247 1.211
Proportion of Variance 0.387 0.316 0.297 Cumulative Proportion  0.387 0.703
*1.000*

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] prcomp - principal components in R

2009-11-09 Thread zubin
okay, an extreme case, only 1 component, explains 100%, something weird 
going on..

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.95)
 > summary(princ)
Importance of components:
PC1
Standard deviation 1.38
Proportion of Variance 1.00
Cumulative Proportion  1.00

stephen sefick wrote:
> principal components is  a data reduction technique.  It looks like
> you have three axes that account for 100%.  Make this reporducible.
>
> On Mon, Nov 9, 2009 at 11:37 AM, zubin  wrote:
>   
>> Hello, not understanding the output of prcomp, I reduce the number of
>> components and the output continues to show cumulative 100% of the
>> variance explained, which can't be the case dropping from 8 components
>> to 3.
>>
>> How do i get the output in terms of the cumulative % of the total
>> variance, so when i go from total solution of 8 (8 variables in the data
>> set), to a reduced number of components, i can evaluate % of variance
>> explained, or am I missing something??
>>
>> 8 variables in the data set
>>
>>  > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE)
>>  > summary(princ)
>> Importance of components:
>> PC1   PC2   PC3   PC4   PC5   PC6PC7PC8
>> Standard deviation 1.381 1.247 1.211 0.994 0.927 0.764 0.6708 0.4366
>> Proportion of Variance 0.238 0.194 0.183 0.124 0.107 0.073 0.0562 0.0238
>> Cumulative Proportion  0.238 0.433 0.616 0.740 0.847 0.920 0.9762 *1.*
>>
>>  > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.75)
>>  > summary(princ)
>>
>> Importance of components:
>> PC1   PC2   PC3
>> Standard deviation 1.381 1.247 1.211
>> Proportion of Variance 0.387 0.316 0.297
>> Cumulative Proportion  0.387 0.703 *1.000*
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>> 
>
>
>
>   

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] prcomp - principal components in R

2009-11-09 Thread zubin
Hello, not understanding the output of prcomp, I reduce the number of 
components and the output continues to show cumulative 100% of the 
variance explained, which can't be the case dropping from 8 components 
to 3. 

How do i get the output in terms of the cumulative % of the total 
variance, so when i go from total solution of 8 (8 variables in the data 
set), to a reduced number of components, i can evaluate % of variance 
explained, or am I missing something??

8 variables in the data set

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE)
 > summary(princ)
Importance of components:
 PC1   PC2   PC3   PC4   PC5   PC6PC7PC8
Standard deviation 1.381 1.247 1.211 0.994 0.927 0.764 0.6708 0.4366
Proportion of Variance 0.238 0.194 0.183 0.124 0.107 0.073 0.0562 0.0238
Cumulative Proportion  0.238 0.433 0.616 0.740 0.847 0.920 0.9762 *1.*

 > princ = prcomp(df[,-1],rotate="varimax",scale=TRUE,tol=.75)
 > summary(princ)

Importance of components:
 PC1   PC2   PC3
Standard deviation 1.381 1.247 1.211
Proportion of Variance 0.387 0.316 0.297
Cumulative Proportion  0.387 0.703 *1.000*

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] predict factanal scores

2009-10-17 Thread zubin
Hello, how does one use factanal to produce factor scores for a new data 
set? 

I have a factor solution estimated from historical data.

I have a 'new' data set I just like to create factor scores using the 
prior estimated factor model.  I see a reference to a package tsfa, for 
time series factor analysis that has a predict function, but like to use 
the factanal function. Is there an equivalent to predict for the 
factanal function, i can say newdata="" and extract the scores? 










[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] caret package for time series applications

2009-10-02 Thread zubin
Max, thx for the reply, i am amazed at the caret package.. very nice

okay, for time series, i think i can include a dummy variable for each 
time period and try to remove the time effect, less 1 dummy, like one 
does for seasonality.  maybe that will work, if anyone has any 
suggestions on how to use the present caret package with time series, 
please share..







Max Kuhn wrote:
> Zubin,
>
>   
>> Hello, I have some time series applications, where i have a large set of X
>> variables (hundreds) and thousands of time data points (sampling every
>> minute).
>> I like to use the caret package to support the analysis, variable selection
>> and model selection.  However, reading the documentation, it looks like
>> caret uses resampling methods.  Not sure if these methods work with time
>> series, as you need  a block bootstrap or such.
>> My question:  Does the caret package support the usage of time series data?
>> 
>
> I don't know much about resampling with time series. If regular
> resampling methods are not appropriate, you can use the index argument
> of trainControl to specify the indices of the samples that you want in
> the training set. We can always add resampling options that are
> specific to time series.
>
> It also assumes that the predictors are in the form of a data frame or
> matrix, so I'm not sure that passing an object of some other class
> would work right now. I'd be happy to add new methods for train that
> are specific to certain data types.
>
>   

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] caret package for time series applications

2009-10-01 Thread zubin
Hello, I have some time series applications, where i have a large set of 
X variables (hundreds) and thousands of time data points (sampling every 
minute). 

I like to use the caret package to support the analysis, variable 
selection and model selection.  However, reading the documentation, it 
looks like caret uses resampling methods.  Not sure if these methods 
work with time series, as you need  a block bootstrap or such. 


My question:  Does the caret package support the usage of time series data?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] evaluate a set of symbols within an IF statement

2009-09-25 Thread zubin
Hello, writing some R code to cleanse a data set, if the following set 
of symbols are identified then perform some actions.  trying to write 
the minimum code to do this. 



tname = "VIX"
checkticker = c("VIX", "TYX", "TNX", "IRX")

   if (tname == checkticker) {
   //perform some operations
   }

result i get is

> tname == checkticker
[1]  TRUE FALSE FALSE FALSE

how do i evaluate this whole list to a single boolean True or False?  If 
any of these are true the whole statement is True, else False.   this 
only seems to work for the first ticker, the rest don't perform the 
operations within the loop.



> tname = "IRX"
> tname == checkticker
[1] FALSE FALSE FALSE  TRUE

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread zubin

Duncan, thx - installing GTK fixed the issue :)

-zubin


Duncan Murdoch wrote:

On 5/25/2009 9:43 AM, zubin wrote:
Hello, running windows vista, R2.9.  Installed the following 
libraries: (*latticist*, *playwith* and *Cairo*)


Wanted then to run, to evaluate the visualization features:


data(iris)



library(latticist)



latticist(iris)



However, i tested my desktop and laptop and get the following error 
after typing latticist(iris):


latticist(iris)
Loading required package: playwith
Loading required package: cairoDevice
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared library 
'C:/Users/luna/Documents/R/win-library/2.9/cairoDevice/libs/cairoDevice.dll': 
LoadLibrary failure:  The specified module could not be found.


Error: package 'cairoDevice' could not be loaded



However, i navigate to the location in the path above and i do see 
the cairoDevice.dll file, so i can't figure out what's going on.  
Again, i tested 2 machines, with R2.9 and Vista, same error on both.



Don't you get a popup error dialog?  I do, and it says that 
libgdk-win32-2.0-0.dll was not found.  Only when I click on okay does 
it return to the console to tell me about the cairoDevice failure.  So 
I think the real problem is with the libgdk not being present, and 
that causes the cairoDevice dll to fail to load.  Windows doesn't tell 
R about the reason, it just says it failed.


The reason that library was not installed is that I didn't have RGtk2 
installed properly.  Try library(RGtk2), and make sure it works (and 
let it install GTK if it wants), and things should be fine.


Duncan Murdoch



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread zubin
Hello, running windows vista, R2.9.  Installed the following libraries: 
(*latticist*, *playwith* and *Cairo*)

Wanted then to run, to evaluate the visualization features:

>data(iris)

>library(latticist)

>latticist(iris)


However, i tested my desktop and laptop and get the following error 
after typing latticist(iris):

latticist(iris)
Loading required package: playwith
Loading required package: cairoDevice
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared library 
'C:/Users/luna/Documents/R/win-library/2.9/cairoDevice/libs/cairoDevice.dll': 
LoadLibrary failure:  The specified module could not be found.

Error: package 'cairoDevice' could not be loaded



However, i navigate to the location in the path above and i do see the 
cairoDevice.dll file, so i can't figure out what's going on.  Again, i 
tested 2 machines, with R2.9 and Vista, same error on both.

-zubin



  



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Mature SOAP Interface for R

2009-03-28 Thread zubin
Hello, we are writing rich internet user interfaces and like to call R 
for some of the computational needs on the data, as well as some 
creation of image files.  Our objects communicate via the SOAP 
interface.  We have been researching the various packages to expose R as 
a SOAP service.


No current CRAN SOAP packages however.

Found 3 to date:

RSOAP (http://sourceforge.net/projects/rsoap/)
SSOAP http://www.omegahat.org/SSOAP/

looks like a commercial version?
http://random-technologies-llc.com/products/rsoap

Does anyone have experience with these 3 and can recommend the most 
'mature' R - SOAP interface package?


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] time date stamp since, january 1st 1970

2009-01-22 Thread zubin
Hello, we are receiving some data, sample below - with a weird time/date 
stamp format, we need some help with R on converting this time date 
stamp to a useable field in R, date and time in a data-frame.  The 
developer says its the number of milliseconds since midnight, January 1, 
1970. 

sample:  *1232558018624*
-


How do I interpret the time stamp? Is there a date, i need a date and time.
site_id,survey_id,version_id,survey_start_ts,survey_question_id,start_ts,end_ts,answer
2,registration,1,1232558018625,z1,*1232558018624*,*1232558266179*,4


Answer: The timestamp is a number representing the exact date and time. 
it is the number of milliseconds since midnight, January 1, 1970. Are 
you using it in the DB or R? I am not sure about R's conversion of 
numbers and dates. is there a way to add a number of seconds or 
milliseconds to a date in R?

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] PDF slided (beamer or prosper) to an editable PPT

2009-01-15 Thread zubin
Hello, I am getting requests to place our PDF slides (output from 
beamer) into Microsoft Powerpoint formats (.ppt).  What's the best 
practice or any recommended software packages (any success with open or 
commercial) that we can use to convert PDF slides into an EDITABLE 
powerpoint deck? 


Thanks in advance.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] The Innagural Atlanta useR Group Meeting!

2008-10-06 Thread zubin
Announcing a new Meetup for Atlanta useR Group (R Programming Language)!
>
> What: The Innagural Atlanta useR Group Meeting!
>
> When: November 5, 2008 7:00 AM
>
> Where: Click the link below to find out!
>
> Meetup Description: Hello All!
>
> I am putting this on the books for the first Atlanta useR meeting. I 
> apologize fro the delays, but I think everyone will be happy that we 
> waited. The plan is to have a catered breakfast meeting at Maggiano's 
> thanks to the generous folks as 5x5 and IHG. The agenda is still up 
> for grabs, but for now, the thoughts are.
>
> 1. Intro to R
> 2. Comparisons with SAS
> 3. Where to find more
>
> There is also an idea of some sort of contest (i.e. how to solve a 
> problem in R) with a potential prize. Any other ideas about content 
> will be appreciated, like are there more advanced users who want more 
> than an intro. Finally, there will be a raffle for a book generously 
> donated by CRC press (Statistical Computing with R by Maria L. Rizzo).
>
> Since this is a catered event, I need everyone that is interested to 
> RSVP as soon as possible. To this end, I will need to know who/how 
> many are coming by the end of this week.
>
> As always, if you have questions or concerns please feel free to 
> contact me.
>
> Cheers,
> Derek
>
> Learn more here:
> http://businessintell.meetup.com/4/calendar/8908133/
>
>
>
>
> --
> Please Note: If you hit "*REPLY*", your message will be sent to 
> *everyone* on this mailing list ([EMAIL PROTECTED] 
> )
> This message was sent by Derek M Norton ([EMAIL PROTECTED]) from 
> Atlanta useR Group (R Programming Language) 
> .
> To learn more about Derek M Norton, visit his/her member profile 
> 
> To unsubscribe or to update your mailing list settings, click here 
> 
>
> Meetup Support: [EMAIL PROTECTED]
> 632 Broadway, New York, NY 10012 USA 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] example - export a data frame to an XML file

2008-09-30 Thread zubin
Yes!  This is perfect, Paul - thank you very much.  -zubin

Paul Murrell wrote:
> Hi
>
> Is this what you are after ... ?
>
>
> data <-
> read.csv(textConnection('"date","UYG.Open","UYG.High","UYG.Low","UYG.Close","UYG.Volume","UYG.Adjusted"
> "2007-02-01",71.32,71.34,71.32,71.34,200,69.23
> "2007-02-02",72.2,72.2,72.2,72.2,200,70.06
> "2007-02-05",71.76,71.76,71.76,71.76,5100,69.63
> "2007-02-06",72.85,72.85,72.85,72.85,3800,70.69
> "2007-02-07",72.85,72.85,72.85,72.85,0,70.69'),
>   as.is=TRUE)
>
> library(XML)
>
> xml <- xmlTree()
> xml$addTag("document", close=FALSE)
> for (i in 1:nrow(data)) {
> xml$addTag("row", close=FALSE)
> for (j in names(data)) {
> xml$addTag(j, data[i, j])
> }
> xml$closeTag()
> }
> xml$closeTag()
>
> # view the result
> cat(saveXML(xml))
>
>
> Paul
>
>
> zubin wrote:
>   
>> Duncan, thanks for the note - the schema looks like this - is this what 
>> your asking for?
>>
>> 
>>  
>>   2007-02-01
>>   71.32
>>   71.34
>>   71.32
>>   71.34
>>   200
>>   69.23
>>  
>>  
>>   2007-02-02
>>   72.2
>>   72.2
>>   72.2
>>   72.2
>>   200
>>   70.06
>>  
>> 
>>
>> Duncan Temple Lang wrote:
>> 
>>> Hi Zubin.
>>>
>>>
>>>   The first thing is to send us a link to the schema that the
>>> other application expects. That would give us a "one-to-one"
>>> mapping; otherwise, data.frame to arbitrary XML is to vague.
>>>
>>>   Currently, there is nothing in the XML package that would
>>> be able to take an XML schema and write an R object to such a
>>> structure. However, I am in the process of creating an XMLSchema
>>> package which can read XML schema and make the description available to
>>> R so that we can read data from an XML file corresponding to that schema
>>> and this could be adapted in some ways to automate the creation of
>>> XML from an R object (under certain assumptions).
>>>
>>>  So please send us all a link to the XML schema.
>>>
>>>   D.
>>>
>>>
>>> zubin wrote:
>>>   
>>>> In need of exporting an XML file from R, I scrub some data in R and 
>>>> push the data into another application requiring XML.  The data set 
>>>> is a very straightforward data frame of stock prices- see below.  I 
>>>> know the package XML is the one to use, but need an example or some 
>>>> direction on where to start.  I know we need to define the schema - 
>>>> can this be done in the R XML package?
>>>> 
>>>>> "date","UYG.Open","UYG.High","UYG.Low","UYG.Close","UYG.Volume","UYG.Adjusted"
>>>>>  
>>>>>
>>>>> "2007-02-01",71.32,71.34,71.32,71.34,200,69.23
>>>>> "2007-02-02",72.2,72.2,72.2,72.2,200,70.06
>>>>> "2007-02-05",71.76,71.76,71.76,71.76,5100,69.63
>>>>> "2007-02-06",72.85,72.85,72.85,72.85,3800,70.69
>>>>> "2007-02-07",72.85,72.85,72.85,72.85,0,70.69
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   
>>>> __
>>>> R-help@r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide 
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>> 
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
>
>   

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] example - export a data frame to an XML file

2008-09-29 Thread zubin
Duncan, thanks for the note - the schema looks like this - is this what 
your asking for?




 2007-02-01
 71.32
 71.34
 71.32
 71.34
 200
 69.23


 2007-02-02
 72.2
 72.2
 72.2
 72.2
 200
 70.06



Duncan Temple Lang wrote:

Hi Zubin.


  The first thing is to send us a link to the schema that the
other application expects. That would give us a "one-to-one"
mapping; otherwise, data.frame to arbitrary XML is to vague.

  Currently, there is nothing in the XML package that would
be able to take an XML schema and write an R object to such a
structure. However, I am in the process of creating an XMLSchema
package which can read XML schema and make the description available to
R so that we can read data from an XML file corresponding to that schema
and this could be adapted in some ways to automate the creation of
XML from an R object (under certain assumptions).

 So please send us all a link to the XML schema.

  D.


zubin wrote:
In need of exporting an XML file from R, I scrub some data in R and 
push the data into another application requiring XML.  The data set 
is a very straightforward data frame of stock prices- see below.  I 
know the package XML is the one to use, but need an example or some 
direction on where to start.  I know we need to define the schema - 
can this be done in the R XML package?


"date","UYG.Open","UYG.High","UYG.Low","UYG.Close","UYG.Volume","UYG.Adjusted" 


"2007-02-01",71.32,71.34,71.32,71.34,200,69.23
"2007-02-02",72.2,72.2,72.2,72.2,200,70.06
"2007-02-05",71.76,71.76,71.76,71.76,5100,69.63
"2007-02-06",72.85,72.85,72.85,72.85,3800,70.69
"2007-02-07",72.85,72.85,72.85,72.85,0,70.69






__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] example - export a data frame to an XML file

2008-09-28 Thread zubin
In need of exporting an XML file from R, I scrub some data in R and push 
the data into another application requiring XML.  The data set is a very 
straightforward data frame of stock prices- see below.  I know the 
package XML is the one to use, but need an example or some direction on 
where to start.  I know we need to define the schema - can this be done 
in the R XML package?


"date","UYG.Open","UYG.High","UYG.Low","UYG.Close","UYG.Volume","UYG.Adjusted" 


"2007-02-01",71.32,71.34,71.32,71.34,200,69.23
"2007-02-02",72.2,72.2,72.2,72.2,200,70.06
"2007-02-05",71.76,71.76,71.76,71.76,5100,69.63
"2007-02-06",72.85,72.85,72.85,72.85,3800,70.69
"2007-02-07",72.85,72.85,72.85,72.85,0,70.69






__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] example - export a data.frame to an XML file

2008-09-28 Thread zubin
In need of exporting an XML file from R, I scrub some data in R and push 
the data into another application requiring XML.  The data set is a very 
straightforward data frame of stock prices- see below.  I know the 
package XML is the one to use, but need an example or some direction on 
where to start.  I know we need to define the schema - can this be done 
in the R XML package?


"date","UYG.Open","UYG.High","UYG.Low","UYG.Close","UYG.Volume","UYG.Adjusted"
"2007-02-01",71.32,71.34,71.32,71.34,200,69.23
"2007-02-02",72.2,72.2,72.2,72.2,200,70.06
"2007-02-05",71.76,71.76,71.76,71.76,5100,69.63
"2007-02-06",72.85,72.85,72.85,72.85,3800,70.69
"2007-02-07",72.85,72.85,72.85,72.85,0,70.69

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] rcurl and cookies

2008-09-18 Thread zubin
Hello, need some help on using Rcurl to navigate a site and the use of 
session cookies.  I suspect the issue i am having presently is I am not 
handling session cookies properly. 

At a high level, in need to create a dataset for some analysis, my 
background is in using R for statistical work, I am very inexperienced 
in HTTP and XML type of coding.  Basically, like to use R for a mashup 
project I have.  Navigate to a web site, login, query some data, clean 
the data and create a date frame, navigate to another site, run some 
queries and append to the data frame.


I have determined that RCurl has all the necessary power to do the 
navigation and form submission, but I am struggling to get this to work. 
I have read the help articles around RCurl, but after days of trying, 
hitting a wall. 


Code so far:

library(RCurl)
library(XML)


txt2 <- postForm("http://www.dailyreportonline.com/siteLogin.asp";,
  origin = "",
  queryDB = "",
  form_username = "zubin",
  form_password = "",
  form_save_login = "on",
  login = "Submit")

htmlTreeParse(txt2, asText = TRUE)


This successfully navigates to the site, but its not submitting the form 
information and logging in, something is not completely correct. I 
contacted an expert and they indicated that most likely I am not 
handling session cookies properly.


Does someone have example RCurl code that submits a form to a site using 
session cookies, keeps a session open and then performs a sequence of 
operations?  I think that may help me learn what i need to do.  Rcurl 
seems very powerful.  I will need to keep a session open as i login, 
navigate, submit another form within the site and retrieve data.


I most likely may need some formal help, so any students familiar with 
HTTP, XML, and R wanting to earn some money, please contact me.


-zubin

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] using R for accessing web site data -

2008-09-14 Thread zubin
Hello, what's the most efficient way of using R to automate a data 
collection task i have:


-Login into a web site using my ID and PWD
-submit a query within the site using the search form after login
-extract the result of the search data into R so i can cleanse and use 
for analysis


kind of like a web scraping task, but like to do this in R.   I checked 
out RCurl, this seems very low level?


This leads to using R to perform mashups of various sites for data 
analysis. 


-zubin

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] string functions

2008-09-14 Thread zubin
Hello, trying to locate all the string commands in the base version of 
R, can't seem to find an area that describes them. I am in need to do 
some serious parsing of text data to create my dataset.  Is there a 
summary link to all the character operators?  string manipulations that 
would help in parsing text.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] optFederov/AlgDesign - help avail?

2008-04-21 Thread zubin
Hello, we are needing to generate optimal (Fractional) designs for 
discrete choice applications, where we will be using logistic regression 
or multinomial logit as the modeling technique.

It looks like optFederov, in the AlgDesign package may work, but not 
sure if this algorithm works when the variable of interest is binary or 
nominal? 

Anyone who are experts in this area, anyone interested in consulting 
with us in this topic (if so, email me we can arrange)? 

Or can confirm/deny optFederov can work in the discrete case?

thx!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.