Displaying 20 results from an estimated 20000 matches similar to: "Why a list of NULL's are reduced to NULL?"
2009 Dec 18
4
How to print to file?
I don't find a function to print a string to file. Would somebody let
me know what function I should use?
2018 Jun 01
2
Time-series moving average question
You are right that there are no NAs in the practice data. But there are NAs in the moving average data.
To see this, break your work into two separate steps, like this:
tnr.ma <- ma(dat3[1:28], order=3)
TNR_moving_average <- forecast(tnr.ma, h=8)
I think you will find that the warning comes from the second step.
Print tnr.ma and you will see some NAs.
-Don
--
Don MacQueen
Lawrence
2018 Apr 30
3
How to visualise what code is processed within a for loop
Luca,
If speed is important, you might improve performance by making d0 into a true matrix, rather than a data frame (assuming d0 is indeed a data frame at this point). Although data frames may look like matrices, they aren?t, and they have some overhead that matrices don?t. I don?t think you would be able to use the [[nm]] syntax with a matrix, but [ , nm] should work, provided the matrix has
2013 Sep 09
1
windowing
Is there a package or a command that does window aggregation like
select
sum(col1) over
(partition by col2, col3 order by col4
rows between unbounded preceding and current row) as sum1
from table1 ;
the above is Netezza syntax, but Postgre has same capability.
Stephen B
[[alternative HTML version deleted]]
2009 Jul 29
1
Package with function for plots with embedded hyperlinks?
Some years ago, if I recall correctly, I learned of a package that
included a function that would write a plot to a file so that one
could associate hyperlinks with elements of the plot, such as points.
Then, when the plot was displayed in a browser, one could click on
(for example) a point, and jump to wherever the hypelink pointed.
I don't remember then name of the package or function,
2013 Oct 22
2
Where is element 30?
Hi I have a vector like that
readCsvFile$V1
[1] 30 31 32 33 34 35 36 37 38 39 310 311 312 313 314 315 316 317 318
[20] 319 320 321 20 21 22 23 24 25 26 27 28 29 210 211 212 213 214 215
[39] 216 217 218 219 220 221 222 223 40 41 42 43 44 45 46 47 48 49 410
[58] 411 412 413 414 415 416 417 418 419 420 421
and I am looking to find where the number 31 is located. So I
2018 Jun 01
0
Time-series moving average question
Hi Don, wow, you are so right. I picked that piece up from the bloggers tutorial and since I am R naive yet, I thought it was all one step
moving_average = forecast(ma(tdat[1:31], order=2), h=5)
Truly, I usually print and check at every step I can, as painful as it is sometimes.
Great lesson for this novice usR.
So the first and last values are NA in each case? Do you know why? Should I replace
2018 Jun 01
2
Time-series moving average question
My guess would be that if you inspect the output from
ma(dat3[1:28], order=3)
you will find some NAs in it. And then forecast() doesn't like NAs.
But I can't check, because I can't find the ma() and forecast() functions. I assume they come from some package you installed; it would be helpful to say which package.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000
2018 Jun 01
0
Time-series moving average question
Hello Don, thank you for your response. I appreciate your help.
I am using the forecast package, originally I found it following a forecasting example on bloggers.com
https://www.r-bloggers.com/time-series-analysis-using-r-forecast-package/
And subsequently located the complete pdf https://cran.r-project.org/web/packages/forecast/forecast.pdf
Since I created this practice data using the
2003 May 29
5
Comparison Operator
Does R have a comparison operator similar to the Like function, for example:
a<-"Is a Fish"
b<-"Fish"
if(b in a){c<-TRUE}
Michael R Howard
Micron Technology Inc. Boise ID.
Fab C Engineering Software (FCES)
Software Engineer
2014 Sep 08
2
Problem with order() and I()
I have found that order() fails in a rather arcane circumstance, as in
this example:
> foo <- I( c('x','\265g') )
> order(foo)
Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed
> foo <-c('x','\265g')
> order(foo)
[1] 1 2
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
2017 Jun 14
3
about fitting a regression line
Hi R users,
I have some data points (Xi, Yi), and they may follow such a pattern Yi =
cCOS(Xi) + d, how to find the c and d in R? which function to use? Also,
how to get the R2 and p value for this correlation? Thanks for any kind of
help.
[[alternative HTML version deleted]]
2018 Apr 30
0
How to visualise what code is processed within a for loop
Thank you for both replies Don & Rui,
The very issue here is that there is a search that needs to be done within
a text field and I agree with Rui later comment that regexpr might indeed
be the time consuming piece of code.
I might try to optimise this piece of code later on, but for the time being
I am working on the following part of building a neural network to try
indeed classifying some
2002 May 09
2
Help on creating custom financial time series graphs
I have written a series of C modules that produce various custom (technical
analysis) graphs when presented with a financial time series. The code was
developed on the Win2K and so makes many now level function calls to the GDI
etc, and is very tightly wedded to the Win2k windowing system. I notice
however, that most of the graphing functionality in R (at least on the
Windows OS) is handled
2010 Jan 13
3
Ask for histogram
Hi,
I use a vector of data to draw the histogram, but it is different from the
graph by SAS. Can you check it for me please?
b is a column vector of 4332
hist(b,probability=T,breaks=30,col='lightblue',ylim=c(0,1))
rug(b)
When I used rug, I find the records are smaller than 4332. I don't know
where I did wrong.
Thanks.
--
Yi Du
[[alternative HTML version deleted]]
2001 Oct 23
2
Possible bug, Rprof() and scan(pipe()) (PR#1140)
This looks like a bug?
Unable to use scan(pipe()) while profiling.
I have no idea whether this version of R violates the
"do not use `Rprof' in an executable built for profiling"
warning in ?Rprof.
Thanks
-Don
> version
_
platform powerpc-apple-darwin1.4
arch powerpc
os darwin1.4
system powerpc, darwin1.4
status Patched
major 1
minor 3.1
year
2006 May 31
2
timeSeq and TimeDate analog in R ?
Hi All : I am attempting tomove a large amount of code from Splus to R and I was hoping that there was an equivalent in R of the Splus functions timeSeq and timeDate ?
I did an RSiteSearch but nothing came up ?
If the equivalent functions are part of some package, that's fine.
Thanks a lot.
Mark
2017 Jul 06
1
Convert date to continuous variable in R
Thanks it worked for me. I wanted to plot days since planting on
x-axis 1 and years on x-axis 3.
LAI_simulation$Date <- as.Date( LAI_simulation$Date, '%Y/%m/%d')
LAI_simulation$Date <- as.integer(LAI_simulation$Date - as.Date("2009-10-07"))
plot(LAI~Date,data=LAI_simulation,xlab="Days since Oct, 7,
2010 Jan 22
2
Question on Merge/Lookup
I need to merge three datasets and don't know how. If I were using SQL, I
would use df3, look up the characteristics of each date in df1 and the value
for each observation in df2.
df1 - unique list of Dates and characteristics of those dates
Date, YYYYMM, YYYYWW, DOW
df2 - the raw data
Date, Place, Value
df3 - all posibile combinations of Date + Place (via
2018 Apr 28
2
How to visualise what code is processed within a for loop
I forgot to explain why my suggestion.
The logical condition returns FALSE/TRUE that in R are coded as 0/1.
So all you have to do is coerce to integer.
This works because the ifelse will return a 1 or a 0 depending on the
condition. Meaning exactly the same values. And is more efficient since
ifelse creates both vectors, the true part and the false part, and then
indexes those vectors in