Name all your arguments (the vignette gets this wrong), including
siteNumber=siteNumbers.
Also, the vignette uses 'statCd', not 'statCD'.
dataAvailable <- whatNWISdata(siteNumber=siteNumbers, service="all",
statCd="all")
gives some results.
-Bill
On Sat, Sep 5, 2020 at 4:44 PM Rich Shepard
https://help.waterdata.usgs.gov/codes-and-parameters/codes
- *Time series identifier* - A 5-6 digit number (ts_id) which uniquely
identifies a series of data for one parameter at one location at a
continuous-recording data site. The ts_id is used by the database for
selecting data
>% rename(X2B = `2B`, X3B = `3B`)
>
> library(dplyr)
> dbGetQuery(con2,"SELECT * FROM batting WHERE yearID = 2018 AND AB >600
> ORDER BY AB DESC") %>% `colnames<-`(make.names(colnames(.)))
>
> library(dplyr)
> dbGetQuery(con2,"SELECT * FROM batting WHE
moments::anscombe.test(x) does give errors when x has too few values or if
all the values in x are the same
> moments::anscombe.test(c(1,2,6))
Error in if (pval > 1) pval <- 2 - pval :
missing value where TRUE/FALSE needed
> moments::anscombe.test(c(2,2,2,2,2,2,2,2))
Error in if (pval > 1) pval
nation behind the
> error, I will highly appreciate it.
>
> Best wishes,
> Sania
>
> On Thu, 15 Oct 2020 at 20:43, Bill Dunlap
> wrote:
>
>> moments::anscombe.test(x) does give errors when x has too few values or
>> if all the values in x are the same
>>
>>
Another way to make columns out of the stuff before and after the
underscore, with NAs if there is no underscore, is
utils::strcapture("([^_]*)_(.*)", F1$text,
proto=data.frame(Before_=character(), After_=character()))
-Bill
On Tue, Sep 22, 2020 at 4:25 PM Bert Gunter wrote:
> To be clear, I
The warning gives some suggestions. E.g., replace funs(sum,prod) with
list(sum=sum,prod=prod).
% R CMD Rscript -e 'library(dplyr,warn.conflicts=FALSE);
data.frame(X=1:3,Y=c(11,13,17)) %>% summarize_all(funs(sum,prod))'
X_sum Y_sum X_prod Y_prod
1 641 6 2431
Warning message:
Philip wrote:
> The \”2B\” worked. Have no idea why. Can you point me somewhere that can
> explain this to me.
>
> Thanks,
> Philip
>
> *From:* Bill Dunlap
> *Sent:* Friday, October 2, 2020 3:54 PM
> *To:* Philip
> *Cc:* r-help
> *Subject:* Re: [R] Lahman Baseball
Have you tried putting double quotes around 2B and 3B: "...2B, 3B, ..." ->
"...\"2B\",\"3B\",..."?
-Bill
On Fri, Oct 2, 2020 at 3:49 PM Philip wrote:
> I’m trying to pull data from one table (batting) in the Lahman Baseball
> database. Notice X2B for doubles and X3B for triples – fourth and
The problem might to due to using an UNC path (//machine//blah/...) instead
of the traditional DOS path ("H:/blah/...").
E.g., if my working directory has a UNC path, cmd.exe will not work as
expected:
> getwd()
[1] "server/dept/devel/bill-sandbox"
> system("C:\\WINDOWS\\SYSTEM32\\cmd.exe /c
And if you have multiple labels, use lapply with bquote:
plot(1:5, sin(101:105)^2, type="n")
text(2:4, sin(102:104)^2, labels=lapply(102:104,
function(i)bquote(sin(.(i))^2)))
-Bill
On Tue, Dec 29, 2020 at 8:31 AM Bert Gunter wrote:
> Does this do what you want?
>
> plot(0:1, 0:1)
> x <- .25
>
Instead of using breaks="30 mins" construct the breaks explicitly with
seq() so you can control the start point. E.g.,
> init_day <- as.POSIXct("2018-02-01-00-00", format="%Y-%m-%d-%H-%M",
tz="Etc/GMT-1")
> fin_day <- as.POSIXct("2018-02-01-02-00", format="%Y-%m-%d-%H-%M",
tz="Etc/GMT-1")
> mydf
The "\n" is probably not in the file name. Does omitting it from the call
to str_c help?
-Bill
On Thu, Dec 24, 2020 at 6:20 AM Anbu A wrote:
> Hi All,
> I am a newbie. This is my first program.
> I am trying to read SAS dataset from below path. I added escape "\" along
> "\" found in path
inalizer, lib="lib")
Loading testFinalizer from /home/bill/packages/lib
Installed finalizer for
> objects(all=TRUE)
character(0)
> q("no")
cleanup()
cleaning
On Fri, Dec 18, 2020 at 7:39 AM Bill Dunlap
wrote:
> Have you tried using reg.finalizer(..., onexit=TRU
Have you tried
abline(v=as.Date("2019-04-06"), col="red")
-Bill
On Fri, Dec 18, 2020 at 9:29 AM Gregory Coats wrote:
> I need to be able to draw and label a vertical line, representing the date
> of some arbitrary event. The date of the first entry is 2013-11-29. How
> would I draw, and
You didn't show the entire call to read.table. If it included the argument
header=TRUE then it would make the first entry in each column the name of
the column. Use header=FALSE (or omit the header argument) if you don't
want the first entry to be considered the column name.
-Bill
On Wed, Dec
You left out some calls to c(). Note that
(2,3,5)
is not valid syntax for making a vector of numbers; use
c(2,3,5)
You also left out a comma and gave different lengths for day and value.
You also left out plus signs between the various components of your ggplot
expression.
Try
data <-
Have you tried using reg.finalizer(..., onexit=TRUE)?
-BIll
On Fri, Dec 18, 2020 at 7:29 AM Jiefei Wang wrote:
> Hi,
>
> I am looking for a way to clean up my package resources before R is ended.
> It looks like the .onUnload function would not be helpful as it would not
> be called before R
fit <- robustgam::robustgam(...) produces a list, with no class attached,
so residuals(fit) invokes the default method for residuals(), which
essentially returns the 'residuals' component of 'fit'. There is no such
component so it returns NULL, an object of length zero. The mean of a
length-zero
What should the result be for
Data1 <- data.frame(Vendor=c("V1","V2","V3","V4"),
Account=c("A1","A2","A2","A2"))
?
Must each vendor have only one account? If not, what should the result be
for
Data2 <- data.frame(Vendor=c("V1","V2","V3","V1","V4","V2"),
> 10.1/0.1 was successfully calculated
Note that 'computed as' is not the same as 'printed as'. Computations
are
done with 52 binary digits of precision and printing is, by default, done
with
7 decimal digits of precision. See FAQ 7.31.
> 101 - 10.1/0.1
[1] 1.421085e-14
>
Use one of the POSIXt classes, POSIXct or POSIXlt, instead of the Date
class.
They have more methods for doing arithmetic. E.g.,
> dates <- as.POSIXct(tz="UTC", c("2004-03-01", "2005-03-01"))
> difftime(dates, trunc(dates, units="year"), units="days") # add 1 if you
want -01-01 to be day 1
Your translate... function seems unnecessarily complicated and reusing the
name 'var' for both the input and the data.frame containing the input makes
it confusing to me. The following replacement, f, uses your algorithm but
I think gets the answer you want.
f <-
function(var, upper, lookup) {
Note that in R-3.6.3 commandArgs() does not include the arguments
intended to be processed by the shell, "1>", "arguments.txt", etc.,
but in R-4.0.3 it does include them. It is as though an R shell()
command was replaced by a system() command so cmd.exe didn't get a
chance to process the command
t; print(cmd403)
C:/R/R-4.0.3/bin/R.exe --vanilla --quiet -e "commandArgs()" --args
"arguments.txt" 1> "log403.txt" 2>&1
>>> status403 = subprocess.call(cmd403)
> commandArgs()
[1] "C:\\R\\R-4.0.3/bin/x64/Rterm.exe" "--vanilla"
[3
"[3] \"--vanilla\"
"
[5] "[4] \"-e\"
" "[5] \"commandArgs()\"
"
[7] "[6] \"SPACE/log.txt\"
" "> "
[9] "> "
>
> unlink(logname)
> system(p
I believe the problem is from svn 77925 in gnuwin/front-ends/rcmdfn.c,
which was committed a few days after 3.6.3 was released. Rterm used
to put double quotes around a command line argument only if it
contained a space, now it double quotes all arguments. It sees shell
constructs like "1>" and
as
> >
> > cmd.exe 1>log.txt 2>&1 /C R.exe -f code.R --args "~/file.txt"
> >
> > (but I haven't tested it). You could also use the slightly more
> > efficient
> >
> > cmd.exe 1>log.txt 2>&1 /C Rterm.exe -f code.R --args "~/
Martin wrote
Use
num[num %% 2 == 1]
instead of much slower and ...@#^$
num[ifelse(num %% 2 == 1, TRUE, FALSE)]
Read the '[' as 'such that' when the subscript is logical
(=="Boolean"==TRUE/FALSE-values).
[The original post had a typo/thinko, num<-num+i instead of num<-num+1,
which
> a variable that equals 1 for the elements I want to select:
>
> t = c(1,1,1,0,0)
How do you typically make such a variable? If you use something like
t <- ifelse(x == "Yes", 1, 0)
you should instead use
t <- x == "Yes"
Naming the variable something like 'isYes' instead of 't' might
Note that !! and !!! are special operators involving "quasiquotation" in
the dplyr package.
I would use as.logical(x) instead of !!x since its meaning is clear to any
user.
-Bill
On Wed, Jun 23, 2021 at 11:13 AM Jeff Newmiller
wrote:
> For the record, `!!` is not an operator so it does not
Use backquotes, `X/Y`, to specify a name, not double quotes.
-Bill
On Wed, Jun 23, 2021 at 11:58 AM Mahmood Naderan
wrote:
> Hi
> I have a column in my data file which is "X/Y". With '/' I want to
> emphasize that values are the ratio of X over Y.
> Problem is that in the following command for
Try using unzip(zipfile, files="desiredFile", exdir=tf<-tempfile()), not
unz(zipfile, "desiredFile"), to copy the desired file from the zip file to
a temporary location and use read_fst(tf) to read the desired file.
-Bill
On Wed, Jun 9, 2021 at 11:27 AM Jeff Reichman
wrote:
> Jan
>
> Makes
Also, normalizePath("power.pdf").
On Sun, May 9, 2021 at 5:13 PM Bert Gunter wrote:
> ?getwd
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On
You didn't say how the values differed. If one in the plot is a rounded
version of the other then adding the ggpur::ggscatter() argument
cor.coeff.args=list(digits=7)
will fix things up.
-Bill
On Sun, May 30, 2021 at 9:18 AM Mahmood Naderan-Tahan <
mahmood.nade...@ugent.be> wrote:
> Hi
>
>
Try
matrix(init_l, nrow=4, ncol=4,
dimnames=list(c("X1","X2","X3","X4"),c("X1","X2","X3","X4")))
It doesn't give exactly what your code does, but your code introduces an
extra level of "list", which you may not want.
-Bill
On Fri, Jul 9, 2021 at 10:40 AM Laurent Rhelp wrote:
> Dear
Does this do what you want?
> df <- data.frame(check.names=FALSE,
lapply(c(Date="date",netIncome="netIncome",`Gross Profit`="grossProfit"),
function(nm)vapply(ISY, "[[", nm, FUN.VALUE=NA_character_)))
> str(df)
'data.frame': 36 obs. of 3 variables:
$ Date: chr "2020-09-30"
Installing a package involves running several R subprocesses, each of
which is running that .Rprofile. You may be able to stop the infinite
recursion by setting an environment variable that subprocesses can
check. E.g. replace
install_github("xxx/yyy")
with
if
Using rle() may make it easier - finding the peak values is easier and
select from cumsum(lengths) to get the positions of the last values
before the peaks, then add 1. I have not tested the following very
much.
function(x) {
rx <- rle(x)
cumsum(rx$lengths)[c(diff(diff(rx$values)>0) ==
That error means that fviz_famd_ind has more than one argument that
starts with 'col' and you must type a more complete name to
disambiguate it. Perhaps col.ind=ifelse(...)?
> args(factoextra::fviz_famd_ind)
function (X, axes = c(1, 2), geom = c("point", "text"),
repel = FALSE, habillage =
Printing the return value of plot_ly and friends works for me in the
following examples:
# make base plot
p0 <- plotly::plot_ly(na.omit(palmerpenguins::penguins), x =
~bill_length_mm, y = ~body_mass_g)
# now add things to base plot
for(vrbl in list(~species, ~island, ~year)) {
tmp <-
help(stat_summary) suggests you use the fun.args=list(...) argument to
pass arguments to the fun.* functions. Try replacing mult=1 by
fun.args=list(mult=1).
It is possible that ggplot2::stat_summary changed its behavior since
that web page was written or that the web page was always wrong.
Section
> Via del Colle Ameno 5
> 60126 Torrette di Ancona, Ancona (AN)
> Uff: +39 071 806 7743
> E-mail: stefano.so...@regione.marche.it
> ---Oo-oO----
>
>
> Da: Bill Dunlap [williamwdun...@gmai
Does this happen if you start R with the --vanilla flag? If so it may
be that you have a startup file, .\.Rprofile or %HOME%\.Rprofile that
is calling set.seed(n) for a fixed n.
-Bill
On Mon, Mar 29, 2021 at 12:16 AM Mika Hamari wrote:
>
> Hi!
>
> I have Windows 10 on PC and different versions
ette di Ancona, Ancona (AN)
> Uff: +39 071 806 7743
> E-mail: stefano.so...@regione.marche.it
> ---Oo-oO
>
>
> Da: Bill Dunlap [williamwdun...@gmail.com]
> Inviato: venerdì 26 marzo 2021 18.40
> A: Stefano Sofia
> Cc: r-help mailing list
> Ogg
> rutledge_param <- function(p, x, y) ((p$M / (1 + exp(-1*(p$x-p$m)/p$s))) +
> p$B) - y
Did you mean that p$x to be just x? As is, this returns numeric(0)
for the p that nls.lm gives it because p$x is NULL and NULL-aNumber is
numeric().
-Bill
On Sun, Mar 14, 2021 at 9:46 AM Luigi Marongiu
install.packages("hms")
A 'library' is a directory (aka folder) that contains installed
'packages'. I.e., one installs packages into a library, but one does
not install a library.
-Bill
On Wed, Mar 17, 2021 at 10:08 AM Gregory Coats via R-help
wrote:
>
> On my MacBook, I do not have, and do
Does optim go out of bounds when you specify hessian=FALSE?
hessian=TRUE causes some out-of-bounds evaluations of f.
> optim(c(X=1,Y=1),
> function(XY){print(unname(XY));(XY[["X"]]+1)^4+(XY[["Y"]]-2)^4}, method=
> "L-BFGS-B", lower=c(0.001,0.001), upper=c(1.5,1.5), hessian=TRUE)
[1] 1 1
[1]
The length of the mean vector must match the number of rows and
columns of the sigma matrix. Once you give 3 entries in the mean
vector you will run into the problem that the sigma you are using is
not positive (semi-)definite - a variance must be the product of a
matrix and its transpose.
-Bill
1 at 11:28 AM Henrik Bengtsson
wrote:
>
> Test with:
>
> clusterCall(cl, function() { suppressWarnings(source("xx.R")) })
>
> If the warnings disappear, then the warnings are produced on the
> workers from source():ing the file.
>
> /Henrik
>
> On Thu, Mar 4,
To avoid the warnings from gc(), call parallel::stopCluster(cl) before
removing or overwriting cl.
-Bill
On Thu, Mar 4, 2021 at 1:52 AM Shah Alam wrote:
>
> Hello everyone,
>
> I am using the "parallel" R package for parallel computation.
>
> Code:
>
># set number of cores
> cl <-
k there's something in the 'xx.R' script that opens
> a connection but doesn't close it. Possibly multiple times. A good
> check is to see if the same warnings are produced when calling
> source("xx.R") sequentially in a for() loop or an lapply() call.
>
> Hope this helps,
>
Terry wrote
I confess to being puzzled WHY the R core has decided on this
definition [of vector] ...
I believe that "R core" followed S's definition of "vector". From the
beginning (at least when I first saw it in 1981) an S vector was the basic
unit of an S object - it had a type and
R_ext/Utils.h:void R_qsort_int_I(int *iv, int *II, int i, int j);
The last 2 arguments are int, not int*. .C() passes pointers to vectors so
you cannot call this function directly from .C().
-Bill
On Thu, Apr 15, 2021 at 3:15 PM Evangelos Evangelou via R-help <
r-help@r-project.org> wrote:
>
> but if I give these commands to a local file:
> ```
> fasta.file <- system.file("extdata", "IMGT_data", "templates",
> "stx.fa", package = "openPrimeR")
> fasta.file <- system.file("stx.fa", package = "openPrimeR")
> ```
> where stx.fa il the file I wanted to open and that is
This will happen if you select no points when it asks you to 'click on
the graph' (to select the level at which to cut the tree). On Windows
you can select no points by right clicking and selecting 'Stop' from
the menu that pops up. RStudio may have a different way to select no
points.
-Bill
Since the columns in the file are separated by a space character, " ",
add the read.table argument sep=" ".
-Bill
On Mon, Feb 22, 2021 at 2:21 PM Val wrote:
>
> Hi all, I am trying to read a messy data but facing difficulty. The
> data has several columns separated by blank space(s). Each
1 D53\n60 D62 ",
> :
> more columns than column names
>
> On Mon, Feb 22, 2021 at 5:39 PM Bill Dunlap wrote:
> >
> > Since the columns in the file are separated by a space character, " ",
> > add the read.table argument sep="
Does this happen when you start R with the --vanilla flag? When you remove
or rename ./.RData?
-Bill
On Tue, Apr 20, 2021 at 8:37 PM N. Jordan Jameson
wrote:
> I have a 64-bit Windows machine and I've installed R versions 4.0.0 through
> 4.0.5 and only versions 4.0.2 and below will
The packages "officer" and "readxl" both contain functions named
"read_xlsx". It looks like you want the one from readxl so refer to it as
readxl::read_xlsx instead of just read_xlsx.
-Bill
On Thu, Aug 26, 2021 at 12:03 PM Kai Yang via R-help
wrote:
> Hi all,
> I found something, but I don't
Is this the kind of thing you are looking for? It separates the scoping
issue from the method dispatch by defining another S3-generic function,
".foo".
> foo <- function(x, ..., data=NULL) with(data, .foo(x, ...))
> .foo <- function(x, ...) UseMethod(".foo")
> .foo.default <- function(x, ...)
> z <- tibble(Code=c("NA","NZ",NA), Name=c("Namibia","New Zealand","?"))
> z
# A tibble: 3 x 2
Code Name
1 NANamibia
2 NZNew Zealand
3 ?
> subset(z, Code=="NA")
# A tibble: 1 x 2
Code Name
1 NANamibia
> subset(z, is.na(Code))
# A tibble: 1 x 2
Code Name
1 ?
>
`single_study_df` must be compatible with existing data.
> ℹ Error occurred for column `third_ventricle_mn`.
> x Can't convert from to due to loss of precision.
> * Locations: 1, 2.
> Backtrace:
> Run `rlang::last_trace()` to see the full context.
>
>
>
>
> ---
What is the best way to read (from a text file) timestamps from the fall
time change, where there are two 1:15am's? E.g., here is an extract from a
US Geological Survey web site giving data on the river through our county
on 2020-11-01, when we changed from PDT to PST,
> Run `rlang::last_error()` to see where the error occurred
What did rlang::last_error() show?
-Bill
On Mon, Sep 6, 2021 at 9:19 AM John Tully
wrote:
> Dear colleagues
> >
> > in conducting a meta-analysis (of MRI data) I am running into the
> repeated issue:
> >
> > Error: Assigned data
In maximum likelihood problems, even when the individual density values are
fairly far from zero, their product may underflow to zero. Optimizers have
problems when there is a large flat area.
> q <- runif(n=1000, -0.1, +0.1)
> prod(dnorm(q))
[1] 0
> sum(dnorm(q, log=TRUE))
[1]
unlist(strsplit(vect, "\n"))
On Fri, Aug 6, 2021 at 7:13 AM Luigi Marongiu
wrote:
> Hello,
> I have a vector that contains some elements with concatenated values, such
> as:
> ```
> > vect
> [1] "name_1"
> [2] "name_2"
> [3] "name_3\nsurname_3"
> [4] "some other text\netc"
> ```
> How can I
On my Windows 10 laptop I see evidence of the operating system caching
information about recently accessed files. This makes it hard to say how
the speed might be improved. Is there a way to clear this cache?
> system.time(L1 <- size.f.pkg(R.home("library")))
user system elapsed
0.48
tools:::prepare2_Rd contains the lines
## FIXME: we no longer make any use of \Rdversion
version <- which(sections == "\\Rdversion")
if (length(version) > 1L)
stopRd(Rd[[version[2L]]], Rdfile,
"Only one \\Rdversion declaration is allowed")
so I am guessing you
I just tried installing forensim on R-devel/Ubuntu 20.04/WSL-2.0 without an
X server (hence DISPLAY was not set). Loading tktcl gives a warning that
Tk is not available because DISPLAY is not set. The installation hung
after the byte-compile message:
installing to
package tile
error reading package index file
/home/bill/R-devel/R-build/site-library/tcltk2/tklibs/ttktheme_radiance/pkgIndex.tcl:
can't find package tile
...
-Bill
On Thu, Sep 30, 2021 at 9:00 AM Bill Dunlap
wrote:
> I just tried installing forensim on R-devel/Ubuntu 20.04/WSL-2.0 without
>
You can define the environment variable R_DONT_USE_TK (to any value) to
avoid this hang caused by code in the tkrplot package. You do not have to
have an X server running if R_DONT_USE_TK is set. This will avoid
potential hangs while installing the 23 packages that depend on tkrplot.
I agree with Stefan. Try using valgrind (on Linux) to check for memory
misuse:
R --debugger=valgrind --debugger-args="--leak-check=full
--track-origins=yes"
...
> yourTests()
> q("no")
-Bill
On Fri, Oct 22, 2021 at 7:30 AM Stefan Evert
wrote:
> Just to add my personal cent to this: I've
>
> > Why would one ever *add* a final unneeded path separator,
> > unless one wanted it?
>
Good question, but it is common for Windows installer programs to add a
terminal backslash to PATH entries. E.g., on my Windows laptop I get
> grep(value=TRUE, "$",
"
[15] "C:\\Users\\willi\\AppData\\Local\\GitHubDesktop\\bin"
> table(grepl("$", strsplit(Sys.getenv("PATH"), ";")[[1]])) # c. 2:1
against terminal backslash
FALSE TRUE
15 8
On Mon, Dec 20, 2021 at 9:30 AM Martin Maechler
wrote:
>
This is the sort of thing that you should first ask the package maintainer
about; there is an error in the rdf method for write_nquads:
> rdflib:::write_nquads.rdf
function (x, file, ...)
{
rdf_serialize(rdf, file, "nquads", ...)
}
I suspect that the first argument to rdf_serialize should be
And a fourth thing to do:
* dput(tail(n=20, readBin(".RData", what=raw(), n=file.size(".RData"
This can show if the file got truncated.
-Bill
On Thu, Dec 23, 2021 at 5:25 PM Bill Dunlap
wrote:
> Three things you might try using R (and show the results in this emai
Three things you might try using R (and show the results in this email
thread):
* load(verbose=TRUE, ".RData") # see how far it gets before stopping
* file.info(normalizePath(".RData")) # is this the file you think it is?
* dput(readBin(".RData", what=raw(), n=100))
The last will print some hex
And how does one [easily] download those files from sourceforge?
-Bill
On Wed, Jan 5, 2022 at 10:15 AM Chuck Coleman via R-help <
r-help@r-project.org> wrote:
> This is a rather complex error, for which I created
> https://sourceforge.net/projects/rhelp/files/Metro/ to hold a minimal
>
Try using at=c(1.8, 2.8) to specify the contour levels you want (and omit
the cuts= argument).
-Bill
On Wed, Nov 17, 2021 at 5:41 AM Luigi Marongiu
wrote:
> I have a dataframe of three variables: x, y, z. The value of z are:
> ```
> > unique(df$z)
> [1] 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.6 3.0 2.4
I googled for "ggplot2 boxplots by group" and the first hit was
https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
which displays lots of variants along with the code to produce them. It
has links to ungrouped boxplots and shows how violin plots can better
display your data.
Did the 3 warnings come from three separate calls to read_csv? If so, can
you identify which files caused the warnings? E.g., change the likes of
lapply(files, function(file) read_csv(file, ...))
to
options(warn=1) # report warnings immediately
lapply(files, function(file){ cat(file,
Use the col_type argument to specify your column types. [Why would you
expect '2009' to be read as a string instead of a number?]. It looks like
an
initial zero causes an otherwise numeric looking entry to be considered
a string (handy for zip codes in the northeastern US).
help(read_csv) says
Note that an environment carries a hash table with it, while a named list
does not. I think that looking up an entry in a list causes a hash table
to be created and thrown away. Here are some timings involving setting and
getting various numbers of entries in environments and lists. The times
e
>> UndefinedBehaviorSanitizer (UBSan). Those have helped me in the past
>> to track down mistakes, and even spot things I was not aware of. And
>> it's an ease of mind as a developer when these tools and Valgrind
>> checks give all OK reports.
>>
>> The R-hub se
The error message arises because you are sometimes delimiting character
strings using non-ASCII open and close double quotes, '“' and '”', instead
of the old-fashioned ones, '"', which have no open or close variants. This
is a language syntax error, so R didn't try to compute anything.
The
On the 'bad' machines, what did you get for
summary(fit)
summary(k)
summary(Z)
summary(gm*gsd^Z)
?
-Bill
On Thu, Dec 2, 2021 at 6:18 AM Labone, Thomas wrote:
> In the code below the first and second plots should look pretty much the
> same, the only difference being that the first
The following makes degree signs appropriately, as shown in ?plotmath:
plot(68, 20, xlab=expression(degree*F), ylab=expression(degree*C))
If you want the word "degree" spelled out, put it in quotes.
-Bill
On Tue, Nov 30, 2021 at 12:31 PM Rich Shepard
wrote:
> On Tue, 30 Nov 2021, Rich
You can use as.matrix() to convert your data.frame to a matrix, but that
loses the speed/space advantages of colMins (as well as causing issues if
some columns are not numeric). You could write to the maintainer of the
package to ask that data.frames be directly supported. In the meantime you
ggplot2::labs() interprets expressions as plotmath. E.g.,
data.frame(X=1:10,Y=(1:10)^2) %>% ggplot(aes(X,Y)) + geom_point() +
labs(x = expression(beta), y = expression(beta^2))
-Bill
On Mon, Jul 19, 2021 at 4:24 PM Rolf Turner wrote:
>
>
> Thanks to Jeff Newmiller, Rui Barradas
Suppose your data were represented as parallel vectors "time" and "type",
meaning that at time[i] a type[i] event occurred. You didn't say what you
wanted if there were a run of "A" or "B". If you are looking for the time
span between the last of a run of one sort of event and the first of a run
stats::approx can do the job:
> approx(x=df$seq, df$count, xout=1:7, method="constant", f=0)
$x
[1] 1 2 3 4 5 6 7
$y
[1] 4 7 7 3 5 5 2
-Bill
On Tue, Mar 29, 2022 at 7:47 PM Jeff Reichman
wrote:
> R-help
>
> Is there a R function that will insert missing sequence number(s) and then
> fill a
The base 2 representation of 0.4 repeats the digit sequence 1001
infinitely, hence must be rounded. The problem occurs in C the same as it
does in R.
bill@Bill-T490:~$ cat a.c
#include
int main(int argc, char* argv[])
{
double d = 0.4 + 0.3 + 0.2 + 0.1;
printf("0.4+0.3+0.2+0.1 ->
: %s \n", bar, (bar > 1.0 ? "true" : "false"));
> }
>
> gcc c-check.c -o c-check
> ./c-check
> foo: 1.00 , foo > 1: false
> bar: 1.00 , bar > 1: true
>
> Again, it was my mistake for not reading the R-FAQ. I had no idea it would
>
> fraction <- 0/0
> if (fraction < .5) TRUE else FALSE
Error in if (fraction < 0.5) TRUE else FALSE :
missing value where TRUE/FALSE needed
-Bill
On Fri, Jan 14, 2022 at 12:55 PM Bert Gunter wrote:
> Unlikely.
>
> > 1/0
> [1] Inf ## not NA
>
> Bert
>
> On Fri, Jan 14, 2022 at 12:41 PM Jim
This sounds like what I think is a bug in stats::model.matrix.default(): a
numeric column with all identical entries is fine but a constant character
or factor column is not.
> d <- data.frame(y=1:5, sex=rep("Female",5))
> d$sexFactor <- factor(d$sex, levels=c("Male","Female"))
> d$sexCode <-
ike summarize(y) or mean(y) if that was the goal.
>
> Tim
>
> -Original Message-
> From: R-help On Behalf Of Bill Dunlap
> Sent: Wednesday, April 13, 2022 9:56 AM
> To: Neha gupta
> Cc: r-help mailing list
> Subject: Re: [R] Error with text analysis data
>
&
uggest working until the model works, no errors and no NA
> values. The reason is that I can get NA in several ways and I need to
> understand why. If I just ignore the NA in my model I may be assuming the
> wrong thing.
>
>
>
> Tim
>
>
>
> *From:* Bill Dunlap
>
MKL's results can depend on the number of threads running and perhaps other
things. They blame it on the non-associativity of floating point
arithmetic. This article gives a way to make results repeatable:
The answer depends on the encoding of the file containing the Chinese
characters and on the version of R (since you are using Windows). I copied
your subject line into Wordpad and and added some syntax to make a valid R
expression
s <- "永创 via R-help"
I then saved it with the type "Unicode Text
1 - 100 of 123 matches
Mail list logo