You haven't described what you are trying to get with the command that doesn't
work. My guess is that this might be what you want:
plot( x, MyData$NWorth, type="l" )
lines( x, MyData$NWorthSm)
However, you might also have to calculate and supply a for the ylim argument to
plot(
Probably more appropriate for R-SIG-Mac
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 12/11/18, 12:22 AM, "R-help on behalf of cowan robin"
wrote:
I am running a small simulation, and getting ver
Sarah's answer is probably the best approach, but to do it using very basic R
methods that predate the very good spatial support that R now has, I would
likely do this:
## Thanks, Jim Lemon, for this step:
df1 <- read.table(text=
"latitude longitude Precip
45.5 110.5 3.2
45
I could not find the word "censor" in the documentation for the missRanger
package, so I think additional explanation is needed.
Also, I would expect information about censoring to be included in data
provided to a function in a package -- inserting censoring into a package
doesn't make sense.
It appears that at the bottom of the nesting, so to speak, you have a character
matrix.
That is, the contents of the [[1]][[1]][[1]] element is a character matrix
that, according to the row and column labels, has 4 rows and 5 columns.
However, the matrix itself, as printed, has, apparently, 4 col
Without more study, I can only give some general pointers.
The as.vector() in X1 <- as.vector(coord[1]) is almost certainly not needed. It
will add a little bit to your execution time.
Converting the output of func() to a one row matrix is almost certainly not
needed. Just return c(res1, res2).
Probably
sort the data frame by date
Then
plot( mydf$geogr.longitude, mydf$geogr.latitude, type='l')
Search the web for some tutorials
See the help pages for
plot
plot.default
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
If this is homework, then r-help has a no homework policy. I'm assuming that if
it is homework then the focus is on statistical concepts, not on R programming.
It looks like your gen_p_vals function should be defined as
gen_p_vals <- function(reps = n)
instead of n = reps.
Why not just use
Wrong comparisons, I think.
The opposite of
A & B
is
!(A & B)
There is no single operator that can replace the "&" in A & B that gives the
"opposite"
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
Here's an example of 24 hours of data at one second intervals.
npts <- 24*60*60
df <- data.frame(
tm = seq( Sys.time(), by='1 sec', length=npts),
yd = round(runif(npts),2)
)
head(df)
with(df, plot(tm,yd))
The x axis appears to me to be display
A few facts (and some opinions):
First fact:
R understands relative paths (as do the other languages you mentioned) (you
have misunderstood R if you think it doesn't)
Second fact:
R interprets relative paths as being relative to its current working directory
Third fact:
To find out R'
Bert (in his separate email) is right about learning the basics, and using
R-sig-geo. You're kind of jumping right into the deep end! None the less,
here's an example that should help.
For one thing, you're being more complicated than necessary.
SpatialPointsDataFrame objects can, much of the t
In addition, the function you want is
sp::over
or its equivalent in sf
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 10/2/18, 1:41 PM, "R-help on behalf of Ben Tupper"
wrote:
Hi,
I'm pr
Try
A <- lapply(file.names, function(fn) extract_tables(fn)
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 10/1/18, 3:32 PM, "R-help on behalf of Ek Esawi"
wrote:
Hi All—
I am using Tabu
First compare
> format(c(0.52, 0.17, 0.03, 1e-20))
[1] "5.2e-01" "1.7e-01" "3.0e-02" "1.0e-20"
> prettyNum(c(0.52, 0.17, 0.03, 1e-20))
[1] "0.52" "0.17" "0.03" "1e-20"
>
If you want to print one column at a time, that will do what you ask. If you
want to print the entire data frame, with num
Or
sink('stuff.txt') ; graphics::box ; sink()
to have it in a text file.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 9/27/18, 4:55 AM, "R-help on behalf of Rui Barradas"
wrote:
Hello,
I wonder if the lintr package might be helpful.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 9/26/18, 7:00 AM, "R-help on behalf of Spencer Brackett"
wrote:
R users,
Is anyone aware o
In my opinion this is a pretty reasonable question for someone new to R.
Yes, it can be written without a for loop, and it would be better. Rich
Heiberger gave a good solution early on, but I'd like to add an outline of the
reasoning that leads to the solution.
You are taking the log of a ratio
ory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 9/20/18, 12:36 PM, "Jeff Newmiller" wrote:
re: your last comment... why do you prefer to multiply by the reciprocal?
On September 20, 2018 10:56:22 AM PDT, "MacQueen, Don via R-hel
In addition to what the other said, if callM is a vector then an expression of
the form
if (callM <= call0)
is inappropriate. Objects inside the parentheses of if() should have length
one. For example,
> if (1:5 < 3) 'a' else 'b'
[1] "a"
Warning message:
In if (1:5 < 3) "a" else "b" :
th
I'm a little surprised at some of what happens, but you can get date labels on
the x axis like this:
drng <- as.Date( c('2005-1-1' , '2005-12-31') )
plot(1, type="n", xlab="", ylab="", xaxt='n', xlim=drng, ylim=c(-.5, -10))
axis(1, at= pretty(drng), lab=format(pretty(drng)))
and if you prefer so
I'm also going to guess that maybe your object
rainfall_by_site
has already been split into separate data frames (because of its name).
But by() does the splitting internally, so you should be passing it the
original unsplit data frame.
You could supply example data by providing the first few
Try changing it to
by(rainfall_by_site, rainfall_by_site[, 'name'],
function(x) {mean.rain <- mean(x[, 'prcp'])
})
Inside the function, so to speak, the function sees an object named "x",
because that's how the function is defined: function(x).
So you have to operate on x inside
If l.out is not a data frame, what is it? A list? A matrix? Some other
structure? Try
str(l.out)
class(l.out)
and see what you get.
Can't help you convert it to a data frame without knowing what it is.
After you have a data frame, then write.table(), write.csv(), or write.csv2()
will "con
In my experience, any path that can be used at the shell prompt in a unix-alike
can be used anywhere that R wants a file name.
[that is, when running R on a unix-alike system, and when pwd at the shell
prompt returns the same value as getwd() in R]
Hopefully, that helps...
-Don
--
Don MacQue
In addition to the other suggestions, try typing
x11()
before using hist().
That *should* start a graphics window. If it does not, then type
capabilities()
and see if "X11" is TRUE.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-
(this is somewhat a change of subject from the original question)
Rich, there functions such as aggregate() in base R. There are also many
options in CRAN packages.
But I tend to have difficulty getting them to do exactly what I want, and
usually end up rolling my own.
The idea is to split the
n
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 8/27/18, 4:10 PM, "R-help on behalf of MacQueen, Don via R-help"
wrote:
You could start with split()
grp <- rep('', nrow(mydata) )
You could start with split()
grp <- rep('', nrow(mydata) )
grp[mydata$stand_ID %in% c(7,9,67)] <- 'A-training'
grp[mydata$stand_ID %in% c(3,18,20,21,32)] <- 'B-testing'
split(mydata, grp)
or perhaps
grp <- ifelse( mydata$stand_ID %in% c(7,9,67) , 'A-training', 'B-testing' )
split(mydata, grp)
I don't know of any such option, but it's easy enough to achieve something more
or less equivalent.
x <- runif(5)
for (ir in seq(nrow(myi <- cbind(x, 1:length(x) {
i <- myi[ir,1]
j <- myi[ir,2]
cat(i,j,'\n')
}
I consider that for() statement to be ugly and unreadable. Normally I would
CA 94550
925-423-1062
Lab cell 925-724-7509
From: Bert Gunter
Date: Monday, August 20, 2018 at 3:38 PM
To: "MacQueen, Don"
Cc: array R-help
Subject: Re: [R] plotmath and logical operators?
This is clumsy and probably subject to considerable improvement, but does it
work for you:
lef
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)
## not so well
tmp <- expression(x >= 3 & y <= 3)
plot(1)
mtext(tmp)
Although the text that's displayed makes sense, it won't be obvi
small typo in previous: should be
quote=""
(I left behind a single quote by mistake)
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 8/17/18, 5:03 PM, "R-help on behalf of MacQueen,
Hi Rich,
It's not obvious what would be causing that error from read.csv. But here's
what I would probably try:
Add quote='"" to your arguments. The default is to use surround text strings
with double quotes, but your file doesn't.
Copy the first few rows into another file and try it. If it su
I would appreciate some suggestions of a good way to prepare a report using
rmarkdown,
in which I loop through subsets of a data set, creating a plot of each subset,
and interspersing
among the figures some text relevant to each figure.
One way is to have an R script write the rmd file, then ren
-423-1062
Lab cell 925-724-7509
From: Deepa
Date: Monday, August 13, 2018 at 8:36 PM
To: "MacQueen, Don" , array R-help
Subject: Re: [R] searching for a specific row name in R
Hi Don,
When there is a list of identifier names that I want to check, the only way is
to loop over each
Or to return a logical value, i.e., TRUE if the column contains the value,
FALSE if it does not:
any( x[,2] == 'A501' )
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 8/13/18, 12:09 AM, "R-help o
't even look at the other error messages until that one has been solved.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 8/10/18, 9:53 AM, "R-help on behalf of Rich Shepard"
wrote:
I would start by trying to install rgdal by itself, rather than as part of a
"batch" update. As in
Install.packages('rgdal')
My expectation is that you will see a more complete error message specific to
rgdal, which presumably will provide a clue or pointer.
-Don
--
Don MacQueen
Lawrence L
There are quite a few messages on R-sig-geo about installing rgdal on Ubuntu.
Maybe one of them contains your solution?
(I use Mac, so can't help directly)
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
In my experience, error messages that reference a closure usually mean that you
have supplied a function where you aren't supposed to.
In this case, I'd look and see if lon, lat, or time is a function (by accident,
of course).
More specifically, right now in one of my R sessions, I get:
> clas
Normally, one turns off the x-axis tick marks and labels by supplying
xaxt='n' in the plot() call, and then adds a customized x-axis using the
axis() function.
But without more information, little help can be provided (a vague question
receives a vague answer).
I'd suggest reviewing the pos
From what I can tell, the simplest way is to
First generate all the combinations
Then exclude those you don't want.
Here's an example, with only three variables (D, E, and F), that excludes those
where E and F both fail
> tmp <- c('p','f')
> X <- expand.grid(D=tmp, E=tmp, F=tmp)
> X <- sub
Or, without removing the first line
dadf <- read.table("xxx.txt", stringsAsFactors=FALSE, skip=1)
Another alternative,
dadf$datetime <- as.POSIXct(paste(dadf$V1,dadf$V2))
since the dates appear to be in the default format.
(I generally prefer to work with datetimes in POSIXct class rather tha
lf of Rich Shepard"
wrote:
On Fri, 27 Jul 2018, MacQueen, Don wrote:
> Given your description, I would start with
>
> sink('wysumallyrs.txt')
> print( summary(wyallyrs) )
> sink()
>
> and see if that doesn't meet your n
Given your description, I would start with
sink('wysumallyrs.txt')
print( summary(wyallyrs) )
sink()
and see if that doesn't meet your needs.
Some of the basic principles:
(1) Whenever you type the name of an R object at the R prompt, it is as if R
wraps whatever you typed inside print(). Here
work now on the right drivers that might be appropriate
for centos, but if anyone happens to know, hints are appreciated
Harold
-----Original Message-
From: MacQueen, Don [mailto:macque...@llnl.gov]
Sent: Thursday, July 26, 2018 11:26 AM
To: Doran, Harold ; '
From my point of view, the logic is this:
If the external database is Oracle, use ROracle
If the external database is MySQL, use RMySQL
and similarly for other databases
If there is no R package specific to the database, then you drop back to RODBC
or RJDBC. Hopefully you can get the necessa
From my perspective, which is a unix-alike perspective, Rscript makes R useable
in exactly the same way as other unix style scripting languages such as perl,
tcsh, bash, etc. This is useful, and a good thing. If I remember (and
understood) correctly, it is why Rscript was introduced, later in R
There's a CRAN Task View on optimization. There might be something useful there.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 7/13/18, 11:43 AM, "R-help on behalf of Federico Becerra"
wrote:
Maybe I missed it, but I didn't see anyone suggest a visit to the CRAN Spatial
task view. This would be a good place to start learning how to work with
spatial data in R.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell
Or (perhaps preferably) "US/Pacific" for daylight savings time support.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 7/9/18, 1:46 AM, "R-help on behalf of Jeff Newmiller"
wrote:
Several of the "c
In addition to what Ben and Jeff have said, I think you can simplify your
function considerably. See these examples:
> substr( c('abc', 'abcd','abcde') , c(2,1,3), c(2,2,4))
[1] "b" "ab" "cd"
> foo <- c('abc', 'abcd','abcde')
> substr( foo , 1, nchar(foo)-2)
[1] "a" "ab" "abc"
> foo <- c('
Does this example help?
> for (ii in 1:10) { cat( ii,'\n') ; if (ii >3) break }
1
2
3
4
The loop won't stop unless you tell it to stop, and I don't see any place where
you told it to stop.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-42
What David Winsemius said, plus:
Does
legend('topleft', c("Climax", "Thule", "Sopo"), lty = 1, col =
("black","red","blue"))
not work?
It should, which will illustrate that you CAN add a legend to the plot.
The x,y that you supply to legend must be values that are within the x,y range
of the
What Jeff, said, plus to see it explicitly:
> print(cpgbins[5:7], digits=18)
[1] 0.200011 0.25 0.300044
> print(c(0.2, 0.25, 0.3), digits=18)
[1] 0.200011 0.25 0.299989
-Don
--
Don MacQueen
Lawrence Livermore Nation
The unlist solution is quite clever.
But I will note that none of the solutions offered so far succeed if the input
is, for example,
YH <- list(1:5, letters[1:3], 1:7)
iuhV <- c(2,2,4)
and the desire is to return a list whose elements are of the same types as the
input list. Which would
In case no one else has made the suggestion yet, take this question to
R-sig-geo, where there has already been discussion and sharing of information
and experiences about this.
You'll need to include the output of sessionInfo().
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000
When I want to run multiple scripts one after the other, and have variables
created in a script be still in memory for use by a subsequent script, I
normally create a master script (say, "runall.r") and it sources each of the
others in turn. For example, my master script (runall.r) would look li
After you've solved the format inconsistency issues, per Peter's advice, you
will need to understand that R internally converts and stores the timedate
values in UTC. Therefore, it is absolutely essential to give it the correct
timezone specification on input.
The user does not "convert to UTC
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
From: Bill Poling
Date: Friday, June 1, 2018 at 10:43 AM
To: "MacQueen, Don" , array R-help
Subject: RE: [R] Time-series moving average question
Hi Don
arning comes from the second step.
Print tnr.ma and you will see some NAs.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
From: Bill Poling
Date: Friday, June 1, 2018 at 8:58 AM
To: "MacQueen, Don"
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
Eric's approach seems reasonable to me, and I agree that it's probably not the
use of a "for" loop that makes the original version slow. As Eric mentioned,
there are lots of unnecessary things happening in the loop.
For example, list.files() was called twice inside the loop, which is
unnecessar
It would help if you show exactly the structure of your desired result, using
the simple example data you supplied (what, exactly, do you mean by "array"?)
If you want mydata[[1]] "to provide the values for all three 3 variables (Y, X1
and X2) of the first imputation only" then this will do it:
Here is a simplified example:
dat <- data.frame(x=1:4, y1=runif(4), y2=runif(4), y3=4:1)
for (icol in 2:4) plot(dat[,1] , dat[,icol] )
(not tested, so hopefully all my parentheses are balanced, no typos, etc.)
This shows the basic principle.
An alternative is to construct each column name as a
unique(dat1$B))
Indexing 1:k with numbers between 1 and k is a bit of a no-op...
AFAICT, this even works without stringsAsFactors=FALSE
-pd
> On 11 May 2018, at 21:30 , MacQueen, Don wrote:
>
> dat1$C <- seq(length(unique(dat1$B)))[ mat
Interesting comments, and they serve as a reminder that so much depends on:
-- what is known or can be assumed about the structure of the incoming data
-- what will be done with the data next
(and is this a one-time effort, or will it be repeated multiple times with
similarly-structured but di
Sarah's solutions are good, and here's another, even more basic:
tmp1 <- unique(dat1$B)
tmp2 <- seq_along(tmp1)
dat1$C <- tmp2[ match( dat1$B, tmp1) ]
> dat1
N B C
1 1 29_log 1
2 2 29_log 1
3 3 29_log 1
4 4 27_cat 2
5 5 27_cat 2
6 6 1_log 3
7 7 1_log 3
8 8 1_log 3
9
And more helpful, probably, would have been the str() function:
> str(mtcars)
'data.frame': 32 obs. of 11 variables:
$ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ...
$ cyl : num 6 6 4 6 8 6 8 4 4 6 ...
$ disp: num 160 160 108 258 360 ...
$ hp : num 110 110 93 110 175 105 2
I think you are confusing row names with the first column. The first column in
mtcars is not alphanumeric:
> class(mtcars)
[1] "data.frame"
> class(mtcars[,1])
[1] "numeric"
> rownames(mtcars)
[1] "Mazda RX4" "Mazda RX4 Wag" "Datsun 710" "Hornet
4 Drive" "Hornet S
Evidently, you want your loop to create new data frames, named (in this example)
df_selected1
df_selected2
df_selected3
Yes, it can be done. But to do it you will have to use the get() and assign()
functions, and construct the data frame names as character strings. Syntax like
df_bs_id[
I would just add, see
?strptime
for information about those date format specifications ( "%V" for example),
and an introduction to R's handling of date and date-time values.
And a few quick examples, to see that %V works as advertised:
> format( Sys.Date() , '%V')
[1] "19"
> format( as.Date('
In addition to which, the original question uses an incorrect way to reference
columns in the data frame.
It should probably have been:
newMyData <-MyData[!is.na(MyData$col1) | !is.na(MyData$col2) |
!is.na(MyData$col3) |
!is.na(MyData$col4) | !is.na(MyData$col5) , ]
That is assuming that "col
Regarding the question:
From the linux shell I use the "-k" switch with cURL to ignore cert
errors.. is there an equivalent in the R world?
I have (sometimes) had success by creating a .curlrc file and putting the
necessary curl options in it. When R invokes curl, curl picks up the options
But:
> dev.new(height=10,width=10)
> dev.size('in')
[1] 10 10
Whereas
> dev.new(length=10,width=10)
> dev.size('in')
[1] 10 7
Obviously, because height was not specified, some default calculation was used
to set the height. And length was ignored.
And thanks to Duncan Murdoch for pointing ou
94550
925-423-1062
Lab cell 925-724-7509
From: Luca Meyer
Date: Monday, April 30, 2018 at 8:08 AM
To: Rui Barradas
Cc: "MacQueen, Don" , array R-help
Subject: Re: [R] How to visualise what code is processed within a for loop
Hi Rui
Thank you for your suggestion,
I have tested the code
Try putting this
options(echo=TRUE)
at the beginning of your script
See ?source for a clue
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 4/24/18, 2:23 AM, "R-help on behalf of P. Roberto Bakker"
Your code doesn't make sense to me in a couple of ways.
Inside the loop, the first line assigns a value to an object named "t".
Then, the second line does the same thing, assigns a value to an object named
"t".
The value of the object named "t" after the second line will be the output of
the if
Your email is hard to read because you sent html email. Please send plain text.
You will need to say what you mean by "join". It's not a standard term with a
universally agreed upon meaning within R.
If you have 5 data frames, each with 5 rows, and it makes sense that after
joining you should h
Perhaps this toy example will help:
## example data
output <- list(1:5, 1:7, 1:4)
lens <- lapply(output, length)
maxlen <- max(unlist(lens))
outputmod <- lapply(output, function(x, maxl) c(x, rep(NA, maxl-length(x))),
maxl=maxlen)
outputmat <- do.call(cbind, outputmod)
write.csv(outputmat, na=''
I am trying to get rmarkdown with bookdown to include a table of contents in
html output, and having trouble.
Here is an example that I think illustrates the trouble.
I have a file "test.Rmd" as follows:
[127]% cat test.Rmd
---
title: Test Document
output:
html_document:
toc: true
---
#
For that matter, a simple within-browser search for "gradient" on the CRAN
packages-by-name webpage, finds
Gradient Descent for Regression Tasks
Holonomic Gradient Method and Gradient Descent
Continuous Generalized Gradient Descent
And a few more that might or might not be relevant.
Plus,
I would try using the xlim, ylim arguments in your first map() command, and
then using the add argument in the second one. See the help page for the map
function.
This assumes that the map() function you are using comes from the maps package.
Otherwise, perhaps you should be using the rgdal pac
What does
capabilities()
return?
For example, I get
> capabilities()
jpeg pngtiff tcltk X11
TRUETRUETRUETRUETRUE
aquahttp/ftp sockets libxmlfifo
TRUETRUETRUE
What Dave said, plus here's a hint. Try this example (which uses base graphics):
plot(1:5)
plot(1:5, cex.lab=2)
Then look at the help page for par
help('par')
or
?par
to search for other graphics parameters (base graphics) you can use to change
various things.
Success will depend, as Dave
Or the openxlsx package, which does not require Java, and is similar to the
xlsx package in functionality (both reads and writes, for example).
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 1/16/18, 4:42
Just a couple of minor comments:
> help.search('read_delim')
No vignettes or demos or help files found with alias or concept or
title matching 'read_delim' using regular expression matching.
read_delim is not part of base R; it must come from some unnamed non-base
package. I'd recommend using ba
You could try this and see what you get:
unique( yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o") )
or maybe
table( yguii(ZEEL.NS, "o") - yguii(ZEEL.NS, "o") )
You showed two sets of output from the expression
yguii(ZEEL.NS, "o")
Were they done one right after the other? Or could ZEEL.NS h
In addition to which, I would recommend
df <- read.table("DATAM", header = TRUE, fill = TRUE, stringsAsFactors=FALSE)
and then converting the Time column to POSIXct date-time values using
as.POSIXct()
specifying the format using formatting codes found in
?strptime
because the times are not in
Because ifelse is not intended to be an alternative to if ... else. They exist
for different purposes.
(besides the other replies, a careful reading of their help pages, and trying
the examples, should explain the different purposes).
--
Don MacQueen
Lawrence Livermore National Laboratory
7000
And if you have trouble with read.export(), then another option is to use SAS
to export the data to a text file, then load it into R using R's read.table()
function.
I would suggest that the SAS export be to a tab-delimited file, with column
headers, and no quotes around text fields, but there
Here's the quickest way I know of to get a scatterplot of many variables
against a single variable. I create example data to illustrate.
x <- 1:10
ys <- matrix( runif(30), ncol=3)
matplot(x,ys)
## or, a little better,
matplot(x,ys, type='b')
To add regression lines:
for (iy in seq(ncol(ys))) a
Do you mean that you have
One data frame, and it has a bunch of variables within it named P1, P2,
P3...
or
A bunch of data frames names P1, P2, P3...
?
I'll assume it's the latter. Here is one way:
dfnms < c('P1', 'P2', 'P3')
for (nm in dfnms) {
tmp <- get(nm)
rownames(tmp) <- tmp[[
In addition to which, the
rgeos
package may have something.
If it's just a single polyline, it may be pretty easy to pull out the
coordinates as a two column matrix, append the first row at the end, and
rebuild it as a polygon.
The readOGR function in the rgdal package is probably a better ch
A trip to the Spatial Task View on CRAN might be in order. The RandomFields
package comes to mind.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 11/9/17, 12:37 AM, "R-help on behalf of PIKAL Petr"
Saving your workspace means that the variables you currently have defined in
your session [ everything that shows up when you type ls() ] are saved to a
file, by default named “.RData”. To restore the workspace, you use the “Load
Workspace” command and navigate to the (same) .RData file. Its def
Try looking at the help page for factor
?factor
for something to start with.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 10/5/17, 10:54 AM, "R-help on behalf of Alexandra Thorn"
wrote:
I'm tryi
For the initial data step, assuming a data frame named stress already exists,
and using base R, you can start with something like this:
barcodes.to.delete <- c('16187DD4015', '16187DD6002', {complete the
comma-delimited vector of barcodes you don't want} )
yield <- subset(stress, !(barcode
Have you tried following the example in
?'SpatialLines-class'
You'll probably get better help from R-sig-geo
And please don't send html email, it makes your email hard to read.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab ce
1 - 100 of 556 matches
Mail list logo