Categories

## Separate colour mappings in R plotly

I’ve got two layers of markers for which I’d like to use separate colour mappings. The problem is that the second add_marker inherits the palette from the first one. Is there anything like ggnewscale::new_scale_color() in native plotly? require(plotly) df = data.frame(x = runif(10), y = runif(10), m = runif(10), b = round(runif(10))) plot_ly(data = df, […]

Categories

## How to do 3D line plots grouped by two factors with the Plotly package in R?

I have checked up the official webpage of Plotly, but how to plot the following task still escapes me: id <- c(rep(1,5), rep(2,5), rep(3,5), rep(4,5)) t <- rep(seq(50,75,length.out=5), 4) x <- runif(20) + sin(t) y <- rnorm(20) + cos(t) gender <- c(rep(“F”,10), rep(“M”,10)) smoke <- c(rep(“Y”,5), rep(“N”,10), rep(“Y”,5)) DATA <- data.frame(ID, t, x, y, gender, […]

Categories

## r Plotly can’t get xaxis tickmode=”array” working for dates

I am trying to get xaxis tickmode=”array” working for dates for plotly graphs. Here is an example: x <- as.Date(c(“2016-08-12”, “2016-08-13”, “2016-08-14”, “2016-08-15”, “2016-08-16”)) y <- c(1, 2, 3, 4, 5) df <- data.frame(x,y) str(df) plot_ly(df, x = x, y = y) %>% layout(xaxis = list( tickmode = “array”, tickvals = c(as.numeric(as.POSIXct(“2016-08-12″, format=”%Y-%m-%d”))*1000, as.numeric(as.POSIXct(“2016-08-16″, format=”%Y-%m-%d”))*1000), […]

Categories

Categories

## Prove that the set {u_1, …,u_k,w_1,…,w_m} is a basis for V and formulate a conjecture that relates the dimensions of U,W,U∩W, and U+W.

U = {(x + y, x, y): x, y ∈ R} W = {(x, x, 0): x ∈ R Let V = U⊕W, and let {u1, u2, . . . , uk} be a basis for the subspace U and {w1, w2, . . . , wm} be a basis for the subspace W. Prove […]

Categories

## #MTASA Server Error: Attempt to index a nil value

I really don’t know what is wrong here. This is the error I am getting: s_interior_admin.lua:944: attempt to index local ‘interiors’ And here is my code: local interiors = exports[“official-interiors”].getInteriorsList() –/MAXIME interior = interiors[tonumber(interiorId)] if interior then local ix = interior[2] local iy = interior[3] local iz = interior[4] local optAngle = interior[5] local interiorw […]

Categories

## Plotting SMA regressions lines (smatr package) into ggplot

I would be very grateful for advise on how to plot Standardised Major Axis (SMA) regressions lines into a faceted ggplot. I used the following code: Run the SMA analysis and create a data frame with the SMA reg line coefficients (intercept and slope) I want to plot smaReg = sma(Y ~ X * Type, […]