Displaying 20 results from an estimated 200 matches similar to: "Iterate over a list of input files?"
2009 Aug 28
2
new data.frame summed by date
Hi,
I wonder if someone can suggest how to create a new data.frame Y
from X where X$PL_Pos is summed by each unique X$MyDate. Y should end
up with two (or more) columns Y$MyDate and Y$PL_Sum with its value
being the cumsum of all the values in X for that date. - a 'daily
cumsum'.
Thanks,
Mark
TStoDate = function (TSDate) {
X = strptime(TSDate + 19e6L, "%Y%m%d")
2001 Feb 13
0
handle date variables
Thanks! This is helpful.
Three more questions.
1. How to convert a string into a numeric value. For
example, convert '20010122' to 20010122.
2. How to convert a string into a date value. For
example, convert 20010122
to 2001 Jan 22, and get its day of the week, i.e.
Monday?
3. How to handle date variables in a loop? How to make
the following codes work? And how users should pass
the
2012 Nov 02
2
Date format conversion from "2012-09-20" to "2012:09:20"
Hi R,
How to get the range of values form startDate to lastDate as given below?.
#*****************************************************************
# Load historical data
#******************************************************************
library('quantmod')
endDate =Sys.Date()
startDate = as.Date(endDate-30, order="ymd")
dataspy = getSymbols("SPY", from = startDate,
2012 Mar 01
2
'break' function in loop
Dear R helpers,
I have some difficulties in using ''break'' function with loop, and the followings are my script. What I try to do is (1) permute ''or'' first; (2) doing t-test if this ''or'' pass criteria 1 (k=1); (3) end the loop when I get 10 permutations; (4) redo everything again but this time use criteria 2 (k=2) (I have more criteria 1:n).
2013 Oct 15
1
Problem with lapply
Hi together
I'm pretty new to R, so excuse me if it is a basic question.
I have a big dataset (extract of it found in the attachment) of returns from
firms. I'd like to compute the Pearson correlation of each firm with the
"Market" and the corresponding p-Value. So I thought of making a list of
'cor.test's and then extract the needed values with a for loop. What I did
so
2012 Oct 14
0
Asking help about drawing and saving candle chart automatically....
Hello,
I have trouble with saving and showing candlestick graph.
I want to draw daily 1-minute candle chart per each day and save it
repeatedly.
The data I saved and is used in my code is as the following format:
-----------------------------------------------------
Index,Open,High,Low,Close # header
2011-11-01 9:00:00 ,248.50,248.95,248.20,248.70
...
2011-11-01 15:15:00
2007 Jul 18
5
Strange search result with conditions in find_by_contents
Hi, guys:
Strange search result with conditions in find_by_contents!
first of all, i''ve installed the acts_as_ferret to my project vender
folder by ''ruby script/plugin install
svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret''
in my SearchController
def searchforum
if !params[:doSearch].nil?
if params[:searchTerms].nil? || params[:searchTerms] ==
2018 Mar 25
1
Get Specific Records from Another DataFrame
Hello
I have been struggling with this simple looking problem. I have two
dataframes. The first one contains ID, date, and revenue information for
specific suppliers.
id lastdate depvar
A 5/10/2017 10
B 8/16/2017 20
C 2/14/2017 30
D 9/5/2017 40
E 8/1/2017 50
F 11/4/2017 60
G 6/22/2017 70
The second dataframe contains timeseries data of each supplier in different
columns. For example Column A are
2012 Feb 08
1
How indices calculated in package "boot"
Hi,there,
I am using R package "boot" to bootstrap. I have one question here: does
anybody possibly know how the boot package generates the "indices" which is
used in the statistic function?
I thought "indices = sample(data, replace=TRUE)", but when I replaced
"indices" with this command and used "boot", I got different results.
Specifically,
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.
2007 May 02
4
Wrong total_hits when using conditions in find_by_contents
In my model Topic:
acts_as_ferret({ :fields => {:username => {:store => :yes, :boost =>
30}, :subject => {:store => :yes, :boost => 20}, :body => {:store =>
:yes, :boost => 10}}, :remote => true }, { :analyzer =>
Ferret::Analysis::RegExpAnalyzer.new(/./, false) })
def self.full_text_search(q, options = {}, find_options = {})
return nil if q.nil? or
1997 Oct 23
0
R-beta: why restart()
Martyn, you write
> I don't think restart() is necessary - it just seems like an invitation to
> bad programming to me.
It's needed when comparing, say, the time to convergence (if at all) of various
iterative processes, for each of a few hundred simulated values. For example one
wants basically
function(data){
summary<-rep(NA,1000)
for(i in 1:1000){
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
Dear R-SIG-Debian,
I am using R version 3.1.2 with rstudio-server 0.98.113 on debian build
3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux.
I often use the %dopar% operator in from the foreach package to run code in
parallel. However, the only other use on the box seemingly installed a few
items and suddenly %dopar% will use far more than the number of cores I am
specifying and
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
#I wish to create a "list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")?
#Please advise.
a <- data.frame(x=c(1,2,3),y=c(5,7,9))
b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4))
c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4))
results1 <- list(a,b,c) #what I want
#but this is how I need to get there
2012 Apr 06
2
read multiaple files within one folder
Suppose we have files in one folder file1.bin, file2.bin, ... , and
1460slice(file) with dim of 720 * 360 in directory C:\\PHD\\Climate
Data\\Wind\\ and we want to read them and make a loop to go from 1 to 4
and take the average, then from 4 to 8 and so on till 1460. in the end we
will get 365 files . I need those 365 files to be in one new folder for
later use in my model
I tried using this
2007 Jan 09
9
Date Approximation in Specs
The floating-point expectations allow for an error tolerance. Is
there any similar facility for dates? For example, say I have a
custom class that handles date/time spans and I want to spec it:
context "A DateRange span" do
specify "should know when a week ago is :)" do
d = DateRange.new
d.last_week.should_be_close_to(1.week.ago, 24*60*60)
end
end
The idea
2009 Jul 28
3
Help with significance. T-test?
Hi,
this is more a general statistics question I think.
I am working on a system which automatically answers user questions (such
systems are commonly called "Question Answering systems").
I evaluated different versions of the same system on a publicly available
test set.
This set contains 500 question. Naturally, for each question the answer can
be wrong or right, which is coded as
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'.
I do this using aggregate, data.table, and plyr. My aggregate results
do not match the other two, and I am trying to figure out what is
incorrect with my syntax. Any suggestions? Thanks.
Here is the data.
myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61,
30.59, 30.84, 30.98, 30.79, 30.79,
2011 Aug 09
0
How to merge multiple 'having' clause relation in rails 3
If i remove any one of scopes having clause then the above action
works perfectly . Is there any way to like- @model =
Model.vacant_list(daterange) and then remove the active record
relation and then apply @model.amenity_type(term). I tried lots of
things but didnt find any solution for this.....
Full question listed here
2010 Feb 10
0
boxplot label cleanup
The boxplot below is close to what I would like, but needs some clean up.
I've been unable to address the following:
1) How can I use the full extent of the plot space (there is white space on
either side of the data)?
2) How can I reduce the # of month labels (e.g. every 3rd month Jan Mar
Jun...) but still keep them staggered?
3) The year labels at the top of the plot have been positioned