Try that source statement here -- it is running R 3.4.1:
https://www.tutorialspoint.com/execute_r_online.php
On Mon, Oct 30, 2017 at 11:14 AM, Suzen, Mehmet wrote:
> Note that, looks like r-fiddle runs R 3.1.2.
>
> __
> R-help@r-project.org mailing li
I believe that the ordinary Windows installer for R can produce a
portable result by choosing the appropriate configuration options from the
offered screens when you run the installer Be sure to enter the desired
path in the Select Destination Location screen, choose Yes on the
Startup options scr
but can't execute the exe due to security
> restrictions.
> Geez, really, treating people who ask questions this way just makes you
> don't want to ask a single one.
>
>
> On Thu, Jan 25, 2018, 11:19 Gabor Grothendieck
> wrote:
>>
>> I believe that the ord
Using Achim's d this also works to generate z where FUN is a function used
to transform the index column and format is also passed to FUN.
z <- read.zoo(d, index = "time", FUN = as.yearqtr, format = "Q%q %Y")
On Sun, Jan 28, 2018 at 4:53 PM, Achim Zeileis wrote:
> On Sun, 28 Jan 2018, p...@phili
split any mixed columns into letter and number columns
and then order can be used on that:
DF <- data.frame(x = c("a10", "a2", "a1"))
o <- do.call("order", transform(DF, let = gsub("\\d", "", x),
no =
as.numeric(gsub("\\D", "", x)),
There is no `value` column in the `dput` output shown in the
question so using `tmin` instead note that the `width=` argument
of `rollapply` can be a list containing a vector of offsets (-1 is prior
value, -2 is value before that, etc.) and that we can use `rollapplyr`
with an `r` on the end to ge
If you specifically want to know which packages were loaded by the script
then using a vanilla version of R (i.e. one where only base packages are
loaded):
vanilla_search <- search()
source("myRprg.R")
setdiff(search(), vanilla_search)
On Wed, Jun 20, 2018 at 4:08 AM, Sigbert Klinke
wrot
Try Reduce:
Reduce(cbind, vec, 1:5)
On Tue, Jul 3, 2018 at 9:28 AM, Viechtbauer, Wolfgang (SP)
wrote:
> Hi All,
>
> I have one vector that I want to combine with another vector and that other
> vector should be the same for every row in the combined matrix. This
> obviously does not work:
>
or this variation if you don't want the first column to be named init:
Reduce(cbind2, vec, 1:5)
On Tue, Jul 3, 2018 at 10:46 AM, Gabor Grothendieck
wrote:
> Try Reduce:
>
> Reduce(cbind, vec, 1:5)
>
> On Tue, Jul 3, 2018 at 9:28 AM, Viechtbauer, Wolfgang (SP)
> wr
Try this code which does not use rollapply:
w <- 3
Mean <- function(L) Reduce("+", L) / length(L)
lapply(w:length(Data), function(i) Mean(Data[seq(to = i, length = w)]))
On Sun, May 14, 2017 at 6:44 PM, Christofer Bogaso
wrote:
> Hi again,
>
> I am looking to find a way on how to calculate Rolli
Maybe you want this.It computes VaRfun(r[c(i-500, i-1)] for each i for
which the argument to r makes sense.
rollapply(r, width = list(c(-500, -1)), FUN = VaRfun),
On Sat, May 27, 2017 at 5:29 PM, Sepp via R-help wrote:
> Hello,
> I am fairly new to R and trying to calculate value at risk with ex
See FAQ #4 on the sqldf github home page.
On Fri, Aug 11, 2017 at 9:21 AM, Mangalani Peter Makananisa
wrote:
> Dear all,
>
> I recently read the book " R data preperation and manipulation using sqldf
> package" by Djoni Darmawikarta
> However, I have a problem with manipulation of dates using t
2018-03-3 in your code should be 2018-03-31.
The line
then'201415'
needs to be fixed.
When posting please provide minimal self-contained examples. There was
no input provided and library statements not relevant to the posted
code were included.
Fixing the invalid date and bad line, getting r
Depending on how you created df maybe your code has the column names
wrong. In any case these 4 alternatives all work. Start a fresh R
session and then copy and paste this into it.
library(zoo)
u <- "https://faculty.washington.edu/ezivot/econ424/sbuxPrices.csv";
fmt <- "%m/%d/%Y"
# 1
sbux1.z <
Here are some more examples:
library(Ryacas)
x <- Sym("x")
yacas("x:=2")
Eval(x*x)
## [1] 4
# vignette has similar example
y <- Sym("y")
Eval(Subst(y*y, y, 3))
## [1] 9
# demo("Ryacas-Function") has similar example to this
f <- function(z) {}
body(f) <- yacas(expression(z*z))[[1]]
f(4)
## [1] 1
Assuming the input data.frame, DF, is of the form shown reproducibly
in the Note below, to convert the series to zoo or ts:
library(zoo)
# convert to zoo
z <- read.zoo(DF)
# convert to ts
as.ts(z) #
Note:
DF <- structure(list(year = c(1980, 1981, 1982, 1983, 1984), cnsm = c(174,
175, 175, 17
Maybe one of these are close enough:
xts(c(2, 4, 5), yearqtr(1991:1993))
as.xts(ts(c(2, 4, 5), 1991))
of if you want only a plain year as the index then then use zoo,
zooreg or ts class:
library(zoo)
zoo(c(2, 4, 5), 1991:1993)
zooreg(c(2, 4, 5), 1991)
ts(c(2, 4, 5), 1991)
On Fri,
Try this:
Reduce(modifyList, list(x, y, z))
On Tue, Jul 19, 2016 at 12:34 PM, Luca Cerone wrote:
> Dear all,
> I would like to know if there is a function to concatenate two lists
> while replacing elements with the same name.
>
> For example:
>
> x <- list(a=1,b=2,c=3)
> y <- list( b=4, d=5
Just replacing lm with a faster version would speed it up. Try lm.fit
or even faster is fastLm in the RcppArmadillo package.
On Thu, Jul 21, 2016 at 2:02 PM, jeremiah rounds
wrote:
> Hi,
>
> A not unusual task is performing a multiple regression in a rolling window
> on a time-series.A stand
I would be careful about making assumptions regarding what is faster.
Performance tends to be nonintuitive.
When I ran rollapply/lm, rollapply/fastLm and roll_lm on the example
you provided rollapply/fastLm was three times faster than roll_lm. Of
course this could change with data of different di
To be precise it's SQLite that does not have date and time data types.
If you use an sqldf backend such as H2 that does have such types then
sqldf will pass them as such. In the case of R's "Date" class such
objects are passed to SQLite as numbers since that is what SQLite can
understand but they
1. Convert the date from R's origin to the origin used by SQLite's
strftime function and then be sure you are using the correct SQLite
strftime syntax:
library(sqldf)
sqldf("select strftime('%m', Date + 2440588.5) month from log")
2. Alternately use the H2 backend which actually supports
On Fri, May 29, 2015 at 10:12 PM, Mark Drummond wrote:
> I've been getting a 403 when I try pulling from the Toronto CRAN mirror
> today.
>
> http://cran.utstat.utoronto.ca/
>
> Is there a contact list for mirror managers?
>
See the cran_mirrors.csv file in
R.home("doc")
of your R distribution.
On Thu, Jun 18, 2015 at 10:32 AM, Courtney Bryant
wrote:
> Good Morning,
> I am currently working with a disabled R user who is a student here at
> CMU. The student has both sight and mobility issues. The student has
> asked for an assistant who is well versed in R to enter data for her, which
Sorry if this appears twice but I am not sure the first attempt got through.
This is not much to go on but here is a short self contained example which
creates a longitudinal data frame L in long form from the built in data
frame BOD and then plots it as points and splines using lattice:
L <- rbi
You can do that with bc if you pass the entire expression to bc(...) in
quotes but in that case you will have to use bc notation, not R notation
so, for example, exp is e and atan is a.
> library(bc)
> bc("e(sqrt(163)*4*a(1))")
[1]
"262537412640768743.2500725971981856888793538563373369
On Sun, Dec 21, 2014 at 12:09 AM, ce wrote:
>
> Dear all,
>
> I want to create a time series object from 00:00:00 to 23:59:00 without dates
> ?
> I can't figure it out with xts ?
>
This uses zoo, rather than xts:
library(zoo)
library(chron)
tt <- seq(times("00:00:00"), times("23:59:00"), by =
On Thu, Dec 25, 2014 at 1:57 PM, Mike Miller wrote:
> I do think I get what is going on with this, but why should I buy into this
> conceptualization? Why is it better to say that a matrix *is* a vector than
> to say that a matrix *contains* a vector? The latter seems to be the more
> common way
On Fri, Jan 16, 2015 at 3:16 AM, philippe massicotte
wrote:
> Hi all.
>
> How we evaluate a formula in R?
>
> Ex.:
>
> params <- list(a = 2, b = 3)
> x <- seq(1,10, length.out = 100)
>
> func1 <- as.formula("y ~ a*x^2 + b*x")
>
> ##How to evaluate func1 using x and the params list
> ???
>
>
> Than
On Sat, Jan 31, 2015 at 2:16 PM, Mikael Olai Milhøj
wrote:
> Hi
>
> Is there an easy way to drop, for instance, the first 4 observation of a
> time series object in R? I have tried to google the answer without any
> luck.
>
> To be more clear:
> Let us say that I have a time seres object x which d
On Sat, Feb 7, 2015 at 4:57 PM, jgui001 wrote:
> I am plotting three sets of data on a single graph, and doing around 100+
> graphs.
> I can use the expression function to superscript the 2 but that seems to
> force me to manually put in the R squared values. Is there away around this?
>
> This co
On Wed, Feb 11, 2015 at 9:45 AM, Doran, Harold wrote:
> I have a function written and tested using R 3.0.1 and sqldf_0.4-7.1 that
> works perfectly. However, using this same code with R 3.1.2 and sqldf_0.4-10
> yields the error below that I am having a difficult time deciphering. Hence,
> same
On Fri, Feb 27, 2015 at 5:19 PM, Alrik Thiem wrote:
> I would like to replace all lower-case letters in a string that are not part
> of certain fixed expressions. For example, I have the string:
>
> "pmin(pmax(pmin(x1, X2), pmin(X3, X4)) == Y, pmax(Z1, z1))"
>
> Where I would like to replace all l
x(pmin(a,B),pmin(a,C,d))==Y,pmax(E,e))"
>
> i.e., with strings where there're no integers following the components in the
> pmin/pmax functions. Could this be generalized to handle both cases?
>
> Best wishes,
> Alrik
>
> -Ursprüngliche Nachricht-
> Von: Ga
On Fri, Mar 13, 2015 at 11:36 AM, Kumsaa wrote:
> How could I extract both month and year from a date? I know how to
> separately extract both using lubridate package:
>
> df$month <- month(df$date)
> df$year<- year(df$date)
>
> I wish to extract year and month as one column
>
>> dput(mydf)
> stru
Try this:
plot(1)
tmp <- x >= 3 ~ "&" ~ y <= 3
mtext(tmp)
On Mon, Aug 20, 2018 at 5:00 PM MacQueen, Don via R-help
wrote:
>
> I would like to use plotmath to annotate a plot with an expression that
> includes a logical operator.
>
> ## works well
> tmp <- expression(x >= 3)
> plot(1)
> mtext(tmp
Some string manipulation can convert the formula to a named vector such as
the one shown at the end of your post.
library(gsubfn)
# input
fo <- y ~ 2 - 1.1 * x1 + x3 - x1:x3 + 0.2 * x2:x2
pat <- "([+-])? *(\\d\\S*)? *\\*? *([[:alpha:]]\\S*)?"
ch <- format(fo[[3]])
m <- matrix(strapplyc(ch, pat)[
11:50 AM Paul Johnson wrote:
>
> Thanks as usual. I owe you more KU decorations soon.
> On Wed, Aug 22, 2018 at 2:34 AM Gabor Grothendieck
> wrote:
> >
> > Some string manipulation can convert the formula to a named vector such as
> > the one shown at the end of your
The isChar function used in Parse is:
isChar <- function(e, ch) identical(e, as.symbol(ch))
On Fri, Aug 24, 2018 at 10:06 PM Gabor Grothendieck
wrote:
>
> Also here is a solution that uses formula processing rather than
> string processing.
> No packages are used.
>
>
Replace the week in the date with week 2, say -- a week in which
nothing will go wrong and then add or subtract the appropriate number
of weeks.
d <- c('2016 00 Sun', '2017 53 Sun', '2017 53 Mon') # test data
as.Date(sub(" .. ", "02", d), "%Y %U %a") +
7 * (as.numeric(sub(" (..) ..."
There is some discussion of approaches to this here:
https://stackoverflow.com/questions/34096162/dplyr-mutate-replace-on-a-subset-of-rows/34096575#34096575
On Mon, Dec 17, 2018 at 10:30 AM Paul Miller via R-help
wrote:
>
> Hello All,
>
> Season's greetings!
>
> Am trying to replicate some SAS
R has many similarities to Octave. Have a look at:
https://cran.r-project.org/doc/contrib/R-and-octave.txt
https://CRAN.R-project.org/package=matconv
On Mon, Jan 28, 2019 at 4:58 PM Alan Feuerbacher wrote:
>
> Hi,
>
> I recently learned of the existence of R through a physicist friend who
> use
This would be a suitable application for NetLogo. The R package
RNetLogo provides an interface. In a few lines of code you get a
simulation with graphics.
On Mon, Jan 28, 2019 at 7:00 PM Alan Feuerbacher wrote:
>
> On 1/28/2019 4:20 PM, Rolf Turner wrote:
> >
> > On 1/29/19 10:05 AM, Alan Feuer
which is motivated to some degree by Octave but is actually
quite different and is particularly suitable in terms of performance
for iterative computations where one iteration depends on the prior
one.
On Mon, Jan 28, 2019 at 6:32 PM Gabor Grothendieck
wrote:
>
> R has many similarities to
On Fri, Aug 1, 2014 at 10:46 AM, Doran, Harold wrote:
> I have done an embarrassingly bad job using a mixture of gsub and strsplit to
> solve a problem. Below is sample code showing what I have to start with (the
> vector xx) and I want to end up with two vectors x and y that contain only
> the
On Wed, Aug 6, 2014 at 2:46 AM, Rguy wrote:
> I recently downloaded Rtools. I see the g++ version is
> gcc version 4.6.3 20111208 (prerelease) (GCC)
>
> I also recently downloaded MinGW. Its version of g++ is
> gcc version 4.8.1 (GCC)
>
> I believe that later versions of g++ provide better support
On Thu, Aug 7, 2014 at 9:32 AM, amarjit chandhial
wrote:
> Hello,
> runSum calculates a running sum looking back a fixed distance n, e.g. 20.
> How do I calculate a dynamic runSum function for an xts object?
> In
> otherwords, I want to calculate a running sum at each point in time
> looking back
On Sat, Aug 9, 2014 at 8:15 AM, Omar André Gonzáles Díaz
wrote:
> Hi all,
>
> I want to know, where i can find a package to simulate the functions
> "Search and Replace and "Find Words that contain - replace them with...",
> that we can use in EXCEL.
>
> I've look in other places and they say: "R
On Thu, Aug 14, 2014 at 3:47 PM, Sneha Bishnoi wrote:
> Hi All!
>
> I am trying to increment date column of data frame so as to merge it with
> another data frame using sqldf:
> my query is :
> merge<-sqldf("select m.* ,e.* from mdata as m left join event as e on
> date(m.Datest,'+1 day')=e.Start"
Try dtw. First convert ref to numeric since dtw does not handle
character input. Then align using dtw and NA out repeated values in
the alignment. Finally zap ugly row names and calculate loading:
library(dtw)
s1 <- as.numeric(stop_sequence$ref)
s2 <- as.numeric(factor(as.character(stop_onoff$r
On Thu, Sep 4, 2014 at 10:41 AM, Torbjørn Lindahl
wrote:
> Not sure if this is the proper list to propose changes like this, if it
> passes constructive criticism, it would like to have a %between% operator
> in the R language.
>
There is a between function in the data.table package.
> library(d
On Tue, Sep 9, 2014 at 4:48 PM, JAWADI Fredj wrote:
> Hi
> I am a New user of R.
> Please, how to import data from Excel to R?
> Thanks,
> Best regards,
> Fredj,
>
There are some ways listed here:
https://web.archive.org/web/20131109195709/http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_win
On Mon, Sep 15, 2014 at 12:09 PM, Doran, Harold wrote:
> I am learning to use sqldf() to read in very large fixed width files that
> otherwise do not work efficiently with read.fwf. I found the following
> example online and have worked with this in various ways to read in the data
>
> cat("1 8.
On Mon, Sep 15, 2014 at 3:23 PM, Doran, Harold wrote:
> Thank you, Gabor. This has seemingly resolved the issue. Perhaps a quick
> follow up. Suppose I know that the 1st variable I am reading in is to be
> numeric and the second is character. Can that be specified in the substr()
> argument?
>
On Fri, Sep 26, 2014 at 3:32 AM, Erick Okuto wrote:
> Dear Paul and Henrik,
> I have a time series with some missing data points that i need smoothed
> using Savitzky-Golay filter. Related question was asked here
> http://thr3ads.net/r-help/2012/11/2121748-Savitzky-Golay-filtering-with-missing-da
On Mon, Sep 29, 2014 at 5:05 AM, jpm miao wrote:
> Hi,
>
>I've not used R for about one year and don't know well about the updates
> on the time series-related package.
>
> My primary job is to do economic/financial time series data analysis -
> annual, monthly, daily, etc. I usually read da
On Fri, Oct 10, 2014 at 7:28 AM, Abhinaba Roy wrote:
> Hi R helpers,
>
> I want to write a function which will
>
> 1. Count the number of fridays in the current month ( to extract month from
> given date) and also the number of fridays in the preceeding month
>
> 2. Calculate the ratio of the numb
On Tue, Oct 14, 2014 at 3:36 AM, jpm miao wrote:
> Hi,
>
> I am plotting time series by ggplot2, but I believe that my question
> applies to other plotting tool as well.
>
> I want to make my x-axis the quarterly scale, e.g:
> 2000Q1 2000Q2.
>
>However, scale_x_date and date_format("%
On Wed, Oct 29, 2014 at 9:09 AM, Thorsten Jolitz wrote:
>
> Hi List,
>
> are there ways to get signatures of all functions of a library in a
> format that is easy to process by a programm (list, xml or so)?
>
> The info about function name, return value and arguments (types) is all
> there in the
This uses a regular expression but is shorter:
> gsub("(.).", "\\1", "ABCDEFG")
[1] "ACEG"
It replaces each successive pair of characters with the first of that
pair. If there is an odd number of characters then the last character is
not matched and therefore kept -- thus it works properly for b
Your read.csv call works for me under Windows on "R version 3.2.2 Patched
(2015-08-25 r69180)" but not on "R version 3.1.3 Patched (2015-03-16
r68169)".
Suggest you upgrade your R installation and try again.
If you are on Windowsw and don't want to upgrade right now an alternative
is to issue th
Express the formula in terms of simple operations like this:
# add 0/1 columns ref.1, ref.2, ..., ref.6
dproot2 <- do.call(data.frame, transform(dproot, ref = outer(dproot$ref,
seq(6), "==") + 0))
# now express the formula in terms of the new columns
library(nlmrt)
fitdp1<-nlxb(den ~ (Rm1 * ref.1
y function. I tried some
> times but am not sure how to improve it because I am quite new to R.
>
> Could anyone please give me some suggestion.
>
> Thanks a lot!
>
>
> Jianling
>
>
> On 22 September 2015 at 00:43, Gabor Grothendieck
> wrote:
> > Express the f
01, Rm2=1.01, Rm3=1.01, Rm4=6.65, Rm5=1.01, Rm6=1,
d50=20, c=-1))
On Tue, Sep 22, 2015 at 7:04 AM, Gabor Grothendieck wrote:
> Just write out the 20 terms.
>
> On Mon, Sep 21, 2015 at 10:26 PM, Jianling Fan
> wrote:
>
>> Hello, Gabor,
>>
>> Thanks again for your
You may have to do without masking and switch back to nls. dproot2 and fo
are from prior post.
# to mask Rm6 omit it from start and set it explicitly
st <- c(Rm1=1.01, Rm2=1.01, Rm3=1.01, Rm4=6.65, Rm5=1.01, d50=20, c=-1)
Rm6 <- 1
fm.nls <- nls(fo, dproot2, start = st)
AIC(fm.nls)
summary(fm.nl
> do.call(c, lapply(temp, function(x) if (is.list(x)) x else list(x)))
[[1]]
[1] 1 2 3
[[2]]
[1] "a" "b" "c"
$duh
[1] 5 6 7 8
$zed
[1] 15 16 17
On Tue, Sep 29, 2015 at 11:00 AM, Therneau, Terry M., Ph.D. <
thern...@mayo.edu> wrote:
> I'd like to flatten a list from 2 levels to 1 level. This
Yes, it's the projection of S onto the subspace orthogonal to B which is:
X <- S - B%*%B / sum(B*B)
and is also implied by Duncan's solution since that is what the residuals
of linear regression are.
On Tue, Oct 20, 2015 at 1:00 PM, Paul Smith wrote:
> On Tue, Oct 20, 2015 at 11:58 AM, Andy Yu
Correction.
Yes, it's the projection of S onto the subspace orthogonal to B which is:
X <- S - (B%o%B) %*% S/ sum(B*B)
and is also implied by Duncan's solution since that is what the residuals
of linear regression are.
On Tue, Oct 20, 2015 at 1:11 PM, Gabor Grothendieck wrote:
This could be modeled directly using Bayesian techniques. Consider the
Bayesian version of the following model where we only observe y and X. y0
is not observed.
y0 <- X b + error
y <- round(y0)
The following code is based on modifying the code in the README of the CRAN
rcppbugs R package.
Tyipcally the parameters being optimized should be the same order of
magnitude or else you can expect numerical problems. That is what the
fnscale control parameter is for.
On Sat, Nov 14, 2015 at 10:15 AM, Lorenzo Isella
wrote:
> Dear All,
> I am using optim() for a relatively simple task: a li
I meant the parscale parameter.
On Sat, Nov 14, 2015 at 10:30 AM, Gabor Grothendieck
wrote:
> Tyipcally the parameters being optimized should be the same order of
> magnitude or else you can expect numerical problems. That is what the
> fnscale control parameter is for.
>
> On Sa
] 0.6305 -0.1247 -0.0032
$ value : num 473 <=
$ counts : Named int [1:2] 182 NA
..- attr(*, "names")= chr [1:2] "function" "gradient"
$ convergence: int 0
$ message: NULL
On Sat, Nov 14, 2015 at 10:32 AM, Gabor Grothendieck
wrote:
> I me
Try the mclust package:
library(mclust)
temp.na <- na.omit(temp)
fm <- Mclust(temp.na)
g <- fm$classification
plot(temp.na, pch = g, col = g)
On Tue, Feb 2, 2016 at 6:35 AM, PIKAL Petr wrote:
> Dear all
>
> I have data like this
>
>> dput(temp)
>
> temp <- structure(list(X1 = c(93, 82, NA, 93,
> problem.
>
> Here is the result with whole data.
>
> fm <- Mclust(temp)
> g <- fm$classification
> plot(1/temp[,1], temp[,2], pch = g, col = g)
>
> I will go through the docs more thoroughly, to be 100% sure I did not miss
> anything.
>
> Cheers
> Petr
&
See
Example 5. Insert Variables
on the sqldf home page.
https://github.com/ggrothendieck/sqldf
On Wed, Feb 3, 2016 at 2:16 PM, Amoy Yang via R-help
wrote:
> First, MVAR<-c("population) should be the same as "population'". Correct?
> You use tab[[MVAR]] to refer to "population" where doub
sqldf does not use Tk so you can ignore this.
On Fri, Feb 19, 2016 at 12:32 PM, Divakar Reddy
wrote:
> Dear R users,
>
> I'm getting Waring message while trying to load "sqldf" package in R3.2.3
> and assuming that we can ignore this as it's WARNING Message and not an
> error message.
> Can you g
This manufactures the functions without using eval by using substitute
to substitute i-1 and a[i] into an expression for the body which is
then assigned to the body of the function:
hh <- vector("list", 5)
hh[[1]] <- f(a[1])
for(i in 2:5) {
hh[[i]] <- hh[[1]]
body(hh[[i]]) <- substitute(
This is a quadratic programming problem that you can solve using
either a quadratic programming solver with constraints or a general
nonlinear solver with constraints. See
https://cran.r-project.org/web/views/Optimization.html
for more info on what is available.
Here is an example using a nonline
Regress on a multivariate polynomial:
lm(y ~ polym(x1, x2, x3, x4, degree = 3))
See ?polym
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www
ive Analyst - Convertibles
> aljosa.aleksandro...@man.com
> Tel +41 55 417 76 03
>
> Man Investments (CH) AG
> Huobstrasse 3 | 8808 Pfäffikon SZ | Switzerland
>
> -Original Message-
> From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
> Sent: Dienstag, 26. Apri
This involves mucking with the internals as well but it is short:
structure(T1, tzone = "UTC")
On Mon, May 9, 2016 at 9:24 AM, Arnaud Mosnier wrote:
> Dear UseRs,
>
> I know two ways to convert dates and time from on time zone to another but
> I am pretty sure that there is a better (cleaner)
Here are two ways that do not use any packages:
s <- paste(letters, collapse = "") # test input
substring(s, first, last)
## [1] "abcde" "fghij" "klmnopqrs"
read.fwf(textConnection(s), last - first + 1)
## V1V2V3
## 1 abcde fghij klmnopqrs
On Wed, May 11, 2016 at 4:
If you are not tied to that model the SSasymp() model in R could be
considered and is easy to fit:
# to plot points in order
o <- order(cl$Area)
cl.o <- cl[o, ]
fm <- nls(Retention ~ SSasymp(Area, Asym, R0, lrc), cl.o)
summary(fm)
plot(Retention ~ Area, cl.o)
lines(fi
Replace newlines and colons with a space since they seem to be junk,
generate a pattern to replace the attributes with a comma and do the
replacement and finally read in what is left into a data frame using
the attributes as column names.
(I have indented each line of code below by 2 spaces so if
Recessions are typically shown by shading. The zoo package has
xblocks for this purpose. If app1 is your zoo object then:
plot(app1)
tt <- time(app1)
xblocks(tt, tt >= "1990-07-01" & tt <= "1991-03-31",
col = rgb(0.7, 0.7, 0.7, 0.5)) # transparent grey
See ?xblocks for more info.
On Thu,
Assuming that the input is x <- 1:4, try this one-liner:
> embed(c(0*x[-1], x, 0*x[-1]), 4)
[,1] [,2] [,3] [,4]
[1,]1000
[2,]2100
[3,]3210
[4,]4321
[5,]0432
[6,]0043
[7,]0004
On Mo
You can use wrapnls from the nlmrt package to get an nls object. Run
it instead of nlxb. It runs nlxb followed by nls so that the output is
an nls object.. Then you can use all of nls' methods.
On occiasion that fails even if nlxb succeeds since the nls
optimization can fail independently of nlx
You could do it without a panel function using xyplot and type "h" :
df2 <- transform(df, Compound = factor(abbreviate(Compound)))
xyplot(Ratio ~ Compound | Class, df2, type = c("h", "g"), lwd = 7,
par.settings = list(grid.pars = list(lineend = 1)))
On Wed, Jul 16, 2008 at 6:48 AM, Henni
Its not clear from your post what the decimal portion is supposed
to represent since Feb is not 35% of the way through the year
but in any case see R News 4/1 and the full page table at the end
of that article, in particular, for some date idioms that you can use.
On Wed, Jul 16, 2008 at 7:41 AM,
It depends on what the values for certain variables were set to when it was
compiled. See:
http://www.sqlite.org/limits.html
On Wed, Jul 16, 2008 at 4:14 PM, Vidhu Choudhary
<[EMAIL PROTECTED]> wrote:
> Hi All,
> I am trying to make write a table in RSQLite. And I get the error mentioned
> below
na.contiguous.zoo() will return the longest stretch of non-NA data.
Its a zoo method of the na.contiguous generic in the core of R.
rle(!is.na(rowSums(coredata(z will find all stretches.
On Fri, Jul 18, 2008 at 6:47 AM, stephen sefick <[EMAIL PROTECTED]> wrote:
> I have a data frame that is 1
E, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE,
> TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE,
> TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE,
> TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE,
> TRUE, FALSE, TRUE, FALSE, TRUE, FAL
strapply in gsubfn finds matches of the indicated regexp,
in this case a \t followed by one or more minus, dot or digit,
and with backref of -1 it passes the backreference, i.e. portion
of the match within (..), to the function in the third arg. See
http://gsubfn.googlecode.com
library(gsubfn)
st
Try this:
plot(1, type="l", xlab="Wellenlänge [nm]", col="darkslategray",
main = ~ Spektrum ~ italic(Deschampsia ~ caespitosa))
On Sat, Jul 19, 2008 at 11:31 AM, Albin Blaschka
<[EMAIL PROTECTED]> wrote:
>
>
> Dear List,
>
> Is there a possibility to change the font-face for a part of the ti
Or this which looks slightly better:
plot(1, type="l", xlab="Wellenlänge [nm]", col="darkslategray",
main = ~ Spektrum ~ italic("Deschampsia caespitosa"))
On Sat, Jul 19, 2008 at 11:56 AM, Gabor Grothendieck
<[EMAIL PROTECTED]> wrote:
>
See ?paste and the collapse argument, in particular:
plot(d, main = paste(paste(colnames(x), collapse = " "),
paste(colnames(y), collapse = " "), sep = " - "))
Also your function sets na.method but never uses it and leaves the par settings
changed afterwards. See ?par. It could also
es
section of ?match.arg . Note that the choices are best placed in the formal
parameter list, not in the match.arg function.
>
> On Sat, Jul 19, 2008 at 12:36 PM, Gabor Grothendieck
> <[EMAIL PROTECTED]> wrote:
>>
>> See ?paste and the collapse argument, in
The Ryacas package is an interface between
R and the computer algebra system, yacas.
It includes an R to yacas parser/translator and an
OpenMath/XML to R parser/translator.
See:
http://ryacas.googlecode.com
On Sat, Jul 19, 2008 at 11:03 PM, Stuart Nettleton
<[EMAIL PROTECTED]> wrote:
> Tolga,
> Y
On Sat, Jul 19, 2008 at 5:21 PM, milton ruser <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have several sets of x-y-z points and I need to estimate the volume that
> encompass all my points.
> Recently I got some adivice to show the "convex hull" of my points using
> geometry package (see code belo
Try this:
library(lattice)
fancy.lm <- function(x, y, fit = TRUE, resid = TRUE){
model <- lm(y ~ x)
y.pred <- predict(model) # Compute residuals for plotting
res.x <- as.vector(rbind(x, x, rep(NA,length(x # NAs induce breaks
in line
res.y <- as.vector(rbind(
1 - 100 of 4523 matches
Mail list logo