R CMD check gives me below message at the end. There does not seem
to be a problem with my TeX installation. Is it possible that R CMD check is
not looking in the correct location? How can this problem be fixed?
Thanks,
Naresh
* checking PDF version of manual ... WARNING
LaTeX errors when c
e are ways to set it conditionally and save the previous value and
> restore it after but this gets to be lots more work ...
>
>
> -Original Message-
> From: R-help On Behalf Of Naresh Gurbuxani
> Sent: Tuesday, January 28, 2025 4:25 PM
> To: Duncan Murdoch
> Cc: r-hel
This solution worked.
Thanks
Sent from my iPhone
> On Jan 28, 2025, at 3:09 PM, Duncan Murdoch wrote:
>
> On 2025-01-28 1:55 p.m., Naresh Gurbuxani wrote:
>> Data.frame is returned by SQL query. It does have column names. In the
>> function, I make small ch
___
From: R-help on behalf of avi.e.gr...@gmail.com
Sent: Tuesday, January 28, 2025 12:01:25 AM
To: 'Naresh Gurbuxani' ; r-help@r-project.org
Subject: Re: [R] R CMD check says no visible binding for global variable
Naresh,
I am not sure how you are creating your data.frame so it
I have written a function which returns an SQL query result as a data.frame.
Each column of data.frame is a variable not explicitly defined.
For every column name, R CMD check says ‘no visible binding for global variable
. Status: 1 NOTE
Is it possible to tell R CMD check that these variables
[121] NA -1458 NA NA NA NA NA NA NA NA
[131] NA NA
I'm not familiar enough with TS to know how you make them 31d month units...
On Tue, 14 Jan 2025, 23:08 Naresh Gurbuxani,
mailto:naresh_gurbux...@hotmail.com>> wrote:
For below data, I f
For below data, I find strange results in basic time series analysis. Why does
acf() function find missing values? When crossprod(xmat) is invertible, why
does arima() find system exactly singular?
Thanks,
Naresh
x <- c(24957, 10577, -18516, 2940, -1458, 32704, -26697, -46902, 48413, -11937,
In addition to many good solutions already provided, this solution uses
data.table package.
library(data.table)
mydf <- data.frame(id = c(rep(1,10),rep(2,6),rep(3,2)), date =
c(rep(1,2),rep(2,2),rep(3,2),rep(4,2),rep(5,2), rep(5,3),rep(6,3),rep(10,2)))
setDT(mydf)
mydf[, `:=`(firstdate = with(.S
How can I use subscripts to draw the last graph with one call to
function xyplot()?
Thanks,
This code gives unexpected result.
library(data.table)
library(lattice)
set.seed(123)
mydt <- data.table(date = seq.Date(as.IDate("2024-01-01"), by = 1,
length.out = 50), xgroup = "A", x = runif(50, 0, 1))
mydt <- rbindlist(list(mydt, data.table(date = mydt$date, xgroup = "B", x =
runif(50, 0,
), .(fit)][[1]][[1]] |> summary()
carsreg3[, .(rsq = summary(fit[[1]])$r.squared), by = .(cyl)]
# cyl rsq
#1: 6 0.7217114
#2: 4 0.7080702
#3: 8 0.4970692
data.table is a fantastic tool.
Thanks again,
Naresh
On 9/22/24 07:44, Naresh Gurbuxani wrote:
Thanks everyone for their res
l free to ignore without replying if my gratuitous remarks
are unhelpful.
Cheers,
Bert
On Sat, Sep 21, 2024 at 2:25 PM Naresh Gurbuxani
wrote:
I am trying to store regression objects in a data.table
df <- data.frame(x = rnorm(20))
df[, "y"] <- with(df, x + 0.1 * x^2 + 0.2 * rn
I am trying to store regression objects in a data.table
df <- data.frame(x = rnorm(20))
df[, "y"] <- with(df, x + 0.1 * x^2 + 0.2 * rnorm(20))
mydt <- data.table(mypower = c(1, 2), myreg = list(lm(y ~ x, data = df),
lm(y ~ x + I(x^2), data = df)))
mydt
# mypower myreg
#
#1: 1
On converting character variables to ordered factors, regression result
has strange names. Is it possible to obtain same variable names with
and without intercept?
Thanks,
Naresh
mydf <- data.frame(date = seq.Date(as.Date("2024-01-01"),
as.Date("2024-03-31"), by = 1))
mydf[, "wday"] <- weekday
AM, Deepayan Sarkar
> wrote:
>
> On Sat, 18 Nov 2023 at 06:44, Naresh Gurbuxani
> wrote:
>>
>> In below graph, I would like to add two vertical lines using
>> panel.abline(). Is this possible?
>
> I assume you want the 'v' variable in panel.abline()
In below graph, I would like to add two vertical lines using
panel.abline(). Is this possible?
Thanks,
Naresh
mydf <- data.frame(hour = rep(6:20, 2),
traffic = c(round(dnorm(6:20, 9, 3) * 1), round(dnorm(6:20, 17, 4) *
1)),
direction = rep(c("inbound", "outbound"), c(15, 15)))
vehicles
density() function in R accepts weights as an input. Using this
function, one can calculate density and plot it. Is it possible to
combined these two operations in lattice densityplot()?
mydf <- data.frame(name = "A", x = seq(-2.9, 2.9, by = 0.2), wt =
diff(pnorm(seq(-3, 3, by = 0.2
mydf <
Updating to latest version of R and reinstalling RQuantLib worked.
Thanks
> On Sep 24, 2023, at 5:29 PM, David Winsemius wrote:
>
>
> On 9/24/23 08:23, Ivan Krylov wrote:
>> On Sun, 24 Sep 2023 02:19:20 +
>> Naresh Gurbuxani wrote:
>>
>>>> in
y dedicated for Mac.
> • https://github.com/Rdatatable/data.table/wiki/Installation
>
> You will see that you will most likely have to modify the "Makevars" file to
> include the paths of different compilers.
>
> Thank you,
> Carlos.
>
> On Mon, Sep 25, 2
My data.table installation uses single thread only.
Instruction on this site do not apply to Ventura 13.6
https://github.com/Rdatatable/data.table/wiki/Installation
Has anyone got data.table working with multi-thread?
Thanks,
Naresh
__
R-help@r-proj
In my mac, using brew, I installed boost and quantlib packages. But
installation of RQuantLib errored out because R could not find
libgfortran.5.dylib
My mac does have this file, but in a different location. Is there a
simple fix to install RQuantLib?
Thanks,
Naresh
~ $ ls /usr/local/gfortran
Reinstall of jpeg followed by reinstall of latticeExtra solved this problem.
Thanks
Sent from my iPhone
> On Sep 8, 2023, at 6:34 PM, Ivan Krylov wrote:
>
> 8 сентября 2023 г. 22:25:10 UTC, Naresh Gurbuxani
> пишет:
>>> library(latticeExtra)
>> Error: package o
In my AWS Sagemaker account latticeExtra does not load. It has worked in the
past.
How can this problem be fixed?
Thanks,
Naresh
Sent from my iPhone
Begin forwarded message:
Lattice package is preinstalled. I installed latticeExtra.
> .libPaths()
[1] "/home/ec2-user/SageMaker/R-library"
[
I want to apply interpolation functions from one data.table to each row
of another data.table.
interp.dt <- data.table(scen = rep(c("a", "b"), c(3, 3)), term = c(1,
20, 60, 1, 32, 72), shock = c(10, 20, 30, 9, 12, 32))
interp.fn <- function(df, x) with(df, approx(term, shock, xout = x)$y)
mydt
ham wrote:
>
> It sounds like you might want a rolling join, e.g.
> https://dplyr.tidyverse.org/reference/join_by.html#rolling-joins.
>
> (And data.table has similar functionality which inspired dplyr)
>
> Hadley
>
> On Mon, Aug 7, 2023 at 9:32 PM Naresh Gurbuxani
&
gt; dplyr::select(1,2,4,3) ->
> myres2
>
> identical(myres, myres2) ## TRUE
>
>
> On Tue, Aug 8, 2023 at 5:32 AM Naresh Gurbuxani
> wrote:
>>
>>
>> I have two dataframes, each with a column for timestamp. I want to
>> merge the two
I have two dataframes, each with a column for timestamp. I want to
merge the two dataframes such that each row from first dataframe
is matched with the row in the second dataframe with most recent but
preceding timestamp. Here is an example.
option.trades <- data.frame(timestamp = as.POSIXct(c(
In my Amazon Web Services (AWS) account, I use R via emacs launched from
terminal. While R computations work well, viewing graphs is inconvenient. I am
not able to use screen device. I can send graphs to a png or pdf file, then
open the file.
I would like a setup where code is run in one wi
26504430 0.02037657
>
> Cheers
> Petr
>
>> -Original Message-
>> From: R-help On Behalf Of Naresh Gurbuxani
>> Sent: Tuesday, February 7, 2023 1:52 PM
>> To: r-help@r-project.org
>> Subject: [R] preserve class in apply function
>>
>>
&
> Consider a data.frame whose different columns have numeric, character,
> and factor data. In apply function, R seems to pass all elements of a
> row as character. Is it possible to preserve numeric class?
>
>> mydf <- data.frame(x = rnorm(10), y = runif(10))
>> apply(mydf, 1, function(row) {
lt;- do.call("cbind", mysim["two.mat", ])
> four.mat <- do.call("cbind", mysim["four.mat", ])
> ```
>
>> On Thu, Jan 26, 2023 at 10:33 PM Naresh Gurbuxani
>> wrote:
>>
>>>
>>> I am looking for a more elegant
>
> I am looking for a more elegant way to write below code.
>
> #Simulation results have different dimensions
> mysim <- lapply(1:10, function(y) {
>two.mat <- matrix(rnorm(4), nrow = 2)
>four.mat <- matrix(rnorm(16), nrow = 4)
>list(two.mat = two.mat, four.mat = four.mat) #results w
Recently I installed Linux on my desktop. I discovered that R for Linux ships
with info files of manuals. R for Windows and Mac only ship with html and pdf
files of manuals.
Why not include info files in R distributions for Windows and Mac? These are
very convenient with emacs. Using pandoc
I am trying to understand ``deviance'' in classification tree output
from tree package.
library(tree)
set.seed(911)
mydf <- data.frame(
name = as.factor(rep(c("A", "B"), c(10, 10))),
x = c(rnorm(10, -1), rnorm(10, 1)),
y = c(rnorm(10, 1), rnorm(10, -1)))
mytree <- tree(name ~ ., da
This is the solution I was looking for. Thanks to Deepayan and Bert for
sticking with me.
Naresh
Sent from my iPhone
On Aug 12, 2022, at 8:02 AM, Deepayan Sarkar wrote:
On Thu, Aug 11, 2022 at 9:03 PM Naresh Gurbuxani
mailto:naresh_gurbux...@hotmail.com>> wrote:
Bert,
Than
).
Is it possible?
Thanks,
Narrsh
Sent from my iPhone
> On Aug 10, 2022, at 9:37 AM, Deepayan Sarkar
> wrote:
>
> On Wed, Aug 10, 2022 at 4:53 PM Naresh Gurbuxani
> wrote:
>>
>>
>> I want to merge two panels into one. Is it possible to do this?
>&g
unt)
>
> myplots <- sapply(names(mydf.split),
> function(name, x = NULL) {
>df <- x[[name]]
>myts <- aggregate(sale ~ date, FUN = sum, data = df)
>xyplot(sale ~ date, data = myts, main = name)
> }, x = mydf.split, USE.NAMES = TRUE, simplify = FALSE)
&g
install it on your own machine then you can continue working as before.
From: R-help on behalf of Naresh Gurbuxani
Sent: Sunday, June 26, 2022 9:28:41 AM
To: r-help@r-project.org
Subject: [External] [R] Sweave
I want to use Sweave, but incorporate some features
Hi Naresh,
Have a look at the emptyspace function in the plotrix package. This
returns the center of the largest empty space on the plot.
Jim
On Thu, May 5, 2022 at 10:41 PM Naresh Gurbuxani
mailto:naresh_gurbux...@hotmail.com>> wrote:
>
> Is it possible to define legend in the plot c
>>> Time series toolkit with identical behavior for all time series
>>>>> classes: 'ts','xts', 'data.frame', 'data.table', 'tibble', 'zoo',
>>>>> 'timeSeries', 'tsibble', 'tis&
c(0.5, 0, 1, 0.5), more = FALSE)
Naresh
From: Richard M. Heiberger
Sent: Wednesday, April 20, 2022 12:02 PM
To: Naresh Gurbuxani
Cc: r-help@r-project.org
Subject: Re: [External] [R] A simple lattice histogram
start here
library(latticeExtra)
c(histogram(~ card, data=CreditCard), histogr
I am struggling with a simple histogram where scales of x-axis should be free.
Each panel should only show the range relevant for data plotted in that panel.
library(lattice)
library(AER)
data(CreditCard)
histogram( ~ card + reports, data = CreditCard, scales = "free")
This code creates two p
I hit send button too fast.
Thanks for this alternative solution,
Naresh
From: R-help on behalf of Naresh Gurbuxani
Sent: Wednesday, March 23, 2022 6:16 PM
To: David Carlson
Cc: r-help mailing list ; John Fox
Subject: Re: [R] print only a few lines of an object
Sent from my iPhone
8604e+00
>> 0.6265465033
>> [2,] -1.693822e+00 2.689917e-01 -1.703176e-01 1.128759e+00
>> -0.7594760299
>> [3,] 1.260585e-01 6.589839e-01 -7.928987e-01 6.430545e-01
>> 1.1951731814
>> [4,] -1.890582e+00 7.614779e-01 -5.726204e-01 1.090881e+00
>
Thanks for your quick response. It works as I wanted.
From: Rui Barradas
Sent: Friday, June 12, 2020 7:08 AM
To: Naresh Gurbuxani ; r-help@r-project.org
Subject: Re: [R] function to return plots
Hello,
plot.list is a list, try '[[' to access its members.
('[' return
I want to write a function that will return lattice plots. This simple
function output a list of two plots. These plots can be
individually shown on the console. But I am unable to put them on two
panels of a single plot.
What changes do I need to make to this function?
Thanks,
Naresh
libra
I am trying to install ESS so that it can be used when EMACS is launched from
Mac Terminal. After running "make" from the directory where ESS files are
saved, the instructions ask the following to be added to .emacs file:
(require 'ess-site)
But I cannot find .emacs file.
I have already ins
This worked very well for me.
Thanks,
Naresh
From: P Tennant
Sent: Saturday, November 5, 2016 7:57 PM
To: Naresh Gurbuxani
Cc: R-help@r-project.org
Subject: Re: [R] lattice graph with free scales and reversed axis values
Hi Naresh,
You could calculate the
I would like to print a barchart without labels for categorical variables.
What change should be made to below command?
Thanks,
Naresh
boy.age <- data.frame(name = c("alpha", "beta", "charlie", "gerald"), age =
c(7, 9, 6, 5))
boy.age$name <- with(boy.age, reorder(name, age))
# draws with nam
I want to use tikz() function in tikzDevice package so that it generates a pdf
file to be included in the bigger tex file. Below code works, but directly
inserts tikz commands in the output tex file.
This works:
<>=
This does not work:
<>=
Full code is given below:
\documentclass{article}\use
I would like to use a mapping to name panel strips. Directly using mapping
table does not work. What is the problem here?
my.df <- data.frame(x = rnorm(100, mean = 0, sd = 2), name = "A")
my.df <- rbind(my.df, data.frame(x = rnorm(100, mean = 0, sd = 4), name = "B"))
my.df <- rbind(my.df, data.f
pe = "l")
>})
>
>
> 2015-04-29 13:09 GMT+02:00 Naresh Gurbuxani :
>> I want to plot multiple variables in xyplot, but plot loess trend for only
>> one of these variables. My problem is that the last command below does not
>> give the desired
I want to plot multiple variables in xyplot, but plot loess trend for only one
of these variables. My problem is that the last command below does not give
the desired result.
Any help will be gratefully received.
Thanks,Naresh
my.df <- data.frame(date = as.numeric(as.Date("2015-01-01")) + 0:49,
panel.xyplot(x, y, ...)
> panel.abline(lm(y~x), col="red")
> panel.text(1, -1, bquote(R^2 == .(summary(lm(y~x))$r.squared)))
>},
>grid = TRUE
> )
>
> Is this what you are looking for? I hope this helps.
>
> Chel Hee Lee
>
>
> O
In a conditional xyplot, I would like to add some numerical results in every
panel. Consider below example.
df <- data.frame(x = rnorm(100), name = "A")
df <- within(df, {y <- x + 0.2 * rnorm(100)})
df2 <- data.frame(x = rnorm(100), y = rnorm(100), name = "B")
df <- rbind(df, df2)
rm(df2)
with(
55 matches
Mail list logo