similar to: RMarkdown question

Displaying 20 results from an estimated 5000 matches similar to: "RMarkdown question"

2017 Aug 29
0
RMarkdown question
Although it is not an elegant solution, but if your output format is HTML, you can add an arbitrary empty HTML element like <span id="foo"></span> before your code chunk. Then you can jump to this <span> via a link like "see [this code chunk](#foo)". Regards, Yihui -- https://yihui.name On Tue, Aug 29, 2017 at 1:30 PM, Roy Mendelssohn - NOAA Federal
2018 Jan 02
4
httr::content without message
Hi All: I am using httr to download files form a service, in this case a .csv file. When I use httr::content on the result, I get a message. Since this will be in a package. I want to suppress the message, but haven't figured out how to do so. The following should reproduce the result: myURL <-
2017 Oct 17
2
ggridges help
yes, thanks, and I was getting close to that. One thing I found is the manual says the height is the distance above the y-line, which should be, but doesn't have to be positive. In fact, the time series are estimates of a cycle, and has negative values, which unfortunately are not included in my sub-sample. And the negative values are not handled properly (the series disappears for
2017 Oct 17
2
ggridges help
I have tried: ggplot(plotFrame, aes(x = time, y = cycle, height = cycle, group = depth)) + geom_ridgeline() ggplot(plotFrame, aes(x = time, y = depth, height = cycle, group = depth)) + geom_ridgeline() ggplot(plotFrame, aes(x = time, y = depth, group = depth)) + geom_density_ridges() none are producing a plot that was a ridgeline for each depth showing the time series at that depth. The plot
2017 Jun 01
5
Reversing one dimension of an array, in a generalized case
Hi All: I have been looking for an elegant way to do the following, but haven't found it, I have never had a good understanding of any of the "apply" functions. A simplified idea is I have an array, say: junk(5, 10, 3) where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do: junk1 <- junk[, rev(seq_len(10), ] but what I am
2017 Oct 17
0
ggridges help
The min_height = -0.25 is there to make it show cycle values down to -1/4. You may want to change it to -1 so it shows more of the cycle values. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Oct 17, 2017 at 1:26 PM, Roy Mendelssohn - NOAA Federal < roy.mendelssohn at noaa.gov> wrote: > yes, thanks, and I was getting close to that. One thing I found is the > manual says the
2017 Oct 17
0
ggridges help
Does the following work for you? ggplot2::ggplot(plotFrame, aes(x = time, y = depth, height = cycle, group = depth)) + ggridges::geom_ridgeline(fill="red", min_height=-0.25) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Oct 17, 2017 at 12:43 PM, Roy Mendelssohn - NOAA Federal < roy.mendelssohn at noaa.gov> wrote: > I have tried: > > ggplot(plotFrame, aes(x =
2017 Oct 17
2
ggridges help
Hi All: I am just not understanding ggridges. The data I have are time series at different depths in the ocean. I want to make a joy plot of the time series by depth. If I was just doing a ggplot2 line plot I would be doing: ggplot(plotFrame, aes(x = time, y = cycle, group = depth)) + geom_line() but translating that to ggridges has not worked right. Below is the result from dput() of a
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
How about this: f <- function(a,wh){ ## a is the array; wh is the index to be reversed l<- lapply(dim(a),seq_len) l[[wh]]<- rev(l[[wh]]) do.call(`[`,c(list(a),l)) } ## test z <- array(1:120,dim=2:5) ## I omit the printouts f(z,2) f(z,3) Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into
2018 Jan 02
0
httr::content without message
Ahoy! That's a message generated by the readr::read_table() function (or it's friends). You can suppress it a number of ways, but this should work as httr::content() will pass through arguments, like col_types = cols(), to the file reader. junk <- httr::content(r1, col_types = cols()) See more here... https://blog.rstudio.com/2016/08/05/readr-1-0-0/
2018 Jan 02
1
httr::content without message
Thanks to all that replied. I had just looked through the httr code and sure enough for a .csv mime time it calls readr::read_csv(). The httr::content docs suggest not using automatic parsing in a package, rather to determine mime type and parse yourself and Ben's suggestion also works if I do: junk <- readr::read_csv(r1$content, col_types = cols()) Perfect. Using httr rather than
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
> On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote: > > Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave, > >>>> junk1 <- junk[, rev(seq_len(10), ] > > > so that > > junk[1,1,1 ] = junk1[1,10,1] > junk[1,2,1] =
2017 Oct 17
0
ggridges help
...and your question is...? ... and the code you tried that didn't work was? Bert On Oct 17, 2017 12:22 PM, "Roy Mendelssohn - NOAA Federal" < roy.mendelssohn at noaa.gov> wrote: > Hi All: > > I am just not understanding ggridges. The data I have are time series at > different depths in the ocean. I want to make a joy plot of the time > series by depth.
2017 Oct 18
1
dygraphs, multiple graphs and shiny
Hi All: This is really getting into the weeds, but I am hoping someone will have a solution. I am trying to use dygrahs for R, within Shiny. The situation arises when I am combining a number of dygraphs into one plot. If I am just in an RNotebook, if you look at: https://stackoverflow.com/questions/30509866/for-loop-over-dygraph-does-not-work-in-r the solution to have the plot shown from a
2017 Jun 01
2
Reversing one dimension of an array, in a generalized case
My error. Clearly I did not do enough testing. z <- array(1:24,dim=2:4) > all.equal(f(z,1),f2(z,1)) [1] TRUE > all.equal(f(z,2),f2(z,2)) [1] TRUE > all.equal(f(z,3),f2(z,3)) [1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >" [2] "Mean relative difference: 0.6109091" # Your earlier example > z <- array(1:120, dim=2:5) >
2017 Jun 01
1
Reversing one dimension of an array, in a generalized case
Thanks again. I am going to try the different versions. But I probably won't be able to get to it till next week. This is probably at the point where anything further should be sent to me privately. -Roy > On Jun 1, 2017, at 1:56 PM, David L Carlson <dcarlson at tamu.edu> wrote: > > On the off chance that anyone is still interested, here is the corrected function using
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
On the off chance that anyone is still interested, here is the corrected function using aperm(): z <- array(1:120,dim=2:5) f2 <- function(a, wh) { idx <- seq_len(length(dim(a))) dims <- setdiff(idx, wh) idx <- append(idx[-1], idx[1], wh-1) aperm(apply(a, dims, rev), idx) } all.equal(f(z, 1), f2(z, 1)) # [1] TRUE all.equal(f(z, 2), f2(z, 2)) # [1] TRUE
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
Here is an alternative approach using apply(). Note that with apply() you are reversing rows or columns not indices of rows or columns so apply(junk, 2, rev) reverses the values in each column not the column indices. We actually need to use rev() on everything but the index we are interested in reversing: f2 <- function(a, wh) { dims <- seq_len(length(dim(a))) dims <-
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave, >>> junk1 <- junk[, rev(seq_len(10), ] so that junk[1,1,1 ] = junk1[1,10,1] junk[1,2,1] = junk1[1,9,1] etc. The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all
2017 Sep 06
3
withr::set_makevars
Hi All; This problem has come about from trying to learn some of the review practices recommend by rOpensci. One of them is to use the package goodpractice. After installing goodpractice, it kept failing on my own packages which are under development, and I was concerned something was funny in my own , so I have a fork of the package rerddap, and I tested goodpractice on that. I get the