Displaying 20 results from an estimated 1000 matches similar to: "question about using _apply and/or aggregate functions"
2012 Aug 01
4
apply function over same column of all objects in a list
Hello. Please forgive me if this problem has already been posted (and solved)
by someone else ... I can't find it anywhere though it seems so very basic.
Here it is:
I have a list comprised of several matrices, each of which has two columns.
> list
[[1]]
[,1] [,2]
[1,] 1 3
[2,] 2 4
[[2]]
[,1] [,2]
[1,] 5 7
[2,] 6 8
[[3]]
[,1] [,2]
2012 Dec 14
2
Manipulation of longitudinal data by row
I have a dataset of the form below, consisting of one unique ID per
row, followed by a series of visit dates. At each visit there are
values for 3 dichotomous variables. Of the 8 different possible
combinations of the three variables, 4 are "abnormal" and the
remaining 4 are "normal". Everyone starts out abnormal, and then
either continues to be abnormal at subsequent visits,
2005 Jul 21
1
again, a question between R and C++
Dear R Users,
I want to make a call from R into C++. My inputs are List1, List2, List3,
IntegerID. The amount of elements of the lists and their type depend on
IntegerID. Typical elements of a given list can be vectors, doubles, and
even other lists. I want to return also a list (whose nature will depend
also, possibly, on IntegerID).
What I want to do is to call these 4 inputs from C++ and then
2012 Jul 02
4
Assigning a vector to every element of a list.
I have a vector d of unknown length, and a list b of unknown length. I
would like to replace every element of b with d. Simply writing b<-d does
not work as R tries to fit every element of d to a different element of d,
and b<-rep(d,length(b)) does not work either as it makes a list of
length length(d)*length(b) not a list of length(b). I know how to do this
with a for loop, but I feel that
2009 Oct 12
1
Creating object referant from argument name
Hi all. I'd like to define an object within a function based on an argument
to that function.
Specifically, I've got:
do.something<-function(input){
id<-substring(input,3,3)
j<-list1
if(id==2)j<-list2
if(id==3)j<-list3
if(id==4)j<-list4
...}
Instead of all these if() arguments, I was hoping to use something like:
2004 Jun 23
5
assigning from multiple return values
I know that if I have a function that returns multiple values, I should
do return(list(foo, bar)). But what do I do on the recieving end?
fn <- function(x) {
return(list(foo, bar))
}
I know that at this point I could say
values.list <- fn(x)
and then access
values.list[1]
values.list[2]
But that's hideous. I'd rather be able to say something like
list(local_foo, local_bar)
2013 Feb 19
1
data format
Hi,
Try this:
el<- read.csv("el.csv",header=TRUE,sep="\t",stringsAsFactors=FALSE)
?elsplit<- split(el,el$st)
?
datetrial<-data.frame(date1=seq.Date(as.Date("1930.1.1",format="%Y.%m.%d"),as.Date("2010.12.31",format="%Y.%m.%d"),by="day"))
elsplit1<- lapply(elsplit,function(x)
2007 May 16
2
substitute "x" for "pattern" in a list, while preservign list "structure". lapply, gsub, list...?
I am experimenting with some of the common r functions.
I had a question re:using "gsub" (or some similar functions) on the contents of a list.
I want to design a function that looks at "everything" contained din a list, and anytime it finds the text string "pattern" replace it with "x". I also wish to preserve the "structure" of the original
2005 Jul 06
6
DoubleRenderError exception
The DoubleRenderError exception recently introduced is forcing me to go back and rewrite my apps authentication handler. Before I could do a redirect right in the middle of a request. Whatever was happening after that went unnoticed, I assumed it was simply ending the request after the redirect was called, but apparently it was going on and rendering the page.
Why can''t a redirect
2009 May 09
1
sqlSave()
Hi all: I have created a MS Access table named 'PredictedValues' through the statement below:
myDB <- odbcConnectAccess("C:/Documents and Settings/Owner/Desktop/Rpond Farming.mdb",uid="admin",pwd="")
sqlSave(myDB,PredictedValues,rownames=FALSE)
close(myDB)
But if I run the code again with new values I get the message below:
Error in sqlSave(myDB,
2011 Jan 03
4
using "plot" with time series object - "axes = FALSE" option does not appear to work
Dear R-help,
I am attempting to plot data using standard R plot utilities. The
data was retrieved from FRED (St. Louis Federal Reserve) using the
package quantmod. My question is NOT about quantmod. While I
retrieve data using quantmod, I am not using its charting utility. I
have been having success using the standard R "plot" utilities to this
point with this type of data.
2006 Jan 02
2
charting (freechart)
Hi all,
We are a Java development team, but we are considering rails for our next
project.
However in this webapplication I need to do a fair amount of charting.
In Java we used JFreechart (http://www.jfree.org/jfreechart/index.php) for
this purpose.
What are my options for charting in Ruby?
Regards,
Harm de Laat
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jan 18
5
Ruby and charting
Hi-
I need to create simple charts on the fly - I had used JFreeChart in the
past with inJ2EE apps. Is there any equivalent here for Ruby. My
charting needs are simple: just line charts.
Also if anyone has done this, pls let me know how I should go about in
doing it.
Thanks
--
Posted via http://www.ruby-forum.com/.
2007 Nov 27
1
help in ar function
Dears Sirs
During my computational work I encountered unexpected behaviour when calling "ar" function.
I want to select the order p of the autoregressive approximation by AIC criterion and sometimes an error occurs.
Example:
# time series
2001 Feb 12
2
OziExplorer works on LINUX using WINE
I've succeeded in running the wonderful charting program
OziExplorer (3.85.3c), http://www.oziexplorer.com/ , on
LINUX (RedHat 6.2) using WINE 20010112. The times to load
the program and to load a map did take 5 to 8 times longer
using WINE than they did using WIN95. I was able to enable
the serial port and have the position computed by my GPS
displayed on the chart.
OziExplorer is a
2006 Mar 28
1
graphing solutions
Hi all,
This might be OT.
Wondering what are available charting solutions that work well with Ruby
on Rails. I''ve seen reference to a few but they all seem to rely on
integration with a program written in another language (requiring a
seperate process per chart), Perl''s GD module for instance. Is there a
100% Ruby charting library that is freely available?
Thanks,
Dave
2004 Jan 05
1
non-generic functions
Hi,
I'm writing some code that will eventually see its way to a package (I
hope). I've noticed that some functions are not set up using generic
methods (while similar functions are). For example, mean is a generic
method but var is not. Other operations that I've come across that could
benefit from being generic are: qqplot, cor, cov, optimize/optimise.
For example, if one were
2011 Jul 04
1
forecast: bias in sampling from seasonal Arima model?
Dear all,
I stumbled upon what appears to be a troublesome issue when sampling from an
ARIMA model (from Rob Hyndman's excellent 'forecast' package) that contains
a seasonal AR component.
Here's how to reproduce the issue. (I'm using R 2.9.2 with forecast 2.19;
see sessionInfo() below).
First some data:
> x <- c(
0.132475, 0.143119, 0.108104, 0.247291, 0.029510,
2008 May 07
2
Problem installing tseries under FC7 x86_64
I have just installed the 64 bit version of R, using yum. The version
is: 2.6.2-1.fc7.1.x86_64.
I installed zoo without any major problem and the same with quadprog (a
few warnings). However, when I came to install tseries I get the
following:
install.packages()
Warning in install.packages() :
argument 'lib' is missing: using
2009 Jun 01
3
Another app that crashes InstallShield
This site gives away a free stock/currency charting app for
Windows:
http://www.marketbrowser.com/get_it.asp
I got around the InstallShield problem by installing the app
in Windows and then I copied the app's folder from Program Files
directly to Program Files in my ~/.wine directory--and it worked
perfectly on the first try. Amazing. And wine even made a
working shortcut on my gnome