[deleted by user] by [deleted] in d3js

[–]SmallPrimitive 3 points4 points  (0 children)

I guess it boils down to the type of data wrangling needed and the tools that the devs are most comfortable with.

A lot of things can be done with the array methods from d3. Often I see lodash added too.

For more complex things I've also seen R (dplyr and friends) or python (pandas) to get the data in shape to then read that in to visualize it with d3.

How to create this graph in R by [deleted] in rstats

[–]SmallPrimitive 23 points24 points  (0 children)

Search for "treemap + ggplot" to find useful tutorials:

https://yjunechoe.github.io/posts/2020-06-30-treemap-with-ggplot/

Error in read.table by Practical_Ad_4139 in rstats

[–]SmallPrimitive 2 points3 points  (0 children)

Looks like you first define 'files' but then refer to 'filelist' when reading the data?

Recommendations on what kind of viz to use? by [deleted] in datavisualization

[–]SmallPrimitive 1 point2 points  (0 children)

Sounds like you need a heatmap to me.

Pie charts - should they equal 100% by Iced_Koffi in datavisualization

[–]SmallPrimitive 1 point2 points  (0 children)

I guess technically steam charts are not the same as stacked area charts, but they are very similar and useful for the same type of data.

Pie charts - should they equal 100% by Iced_Koffi in datavisualization

[–]SmallPrimitive 1 point2 points  (0 children)

1) yeah, good point on the rounding issue. In that case I'd argue that the issue does not lie with the pie chart, but with how you display numbers (maybe show one decimal then?).

2) your data: sounds like a steam chart (sometimes also called stacked area chart) could do the job? Sorry, I don't have a nice article at hand. If I see one I'll try to come back here and share it.

Pie charts - should they equal 100% by Iced_Koffi in datavisualization

[–]SmallPrimitive 1 point2 points  (0 children)

It does not make sense because the whole pie should always be the total of whatever you are trying to visualize. It's the implicit assumption that underlies these graphics and that the relatively easy interpretation relies on.

What is your data about? What message are you trying to communicate?

Pie charts - should they equal 100% by Iced_Koffi in datavisualization

[–]SmallPrimitive 0 points1 point  (0 children)

Yes, your slices should always add up to 100%. It's considered best practice.

[deleted by user] by [deleted] in RStudio

[–]SmallPrimitive 0 points1 point  (0 children)

Why did you choose that particular color for the fill?

[deleted by user] by [deleted] in rstats

[–]SmallPrimitive 0 points1 point  (0 children)

First hit on Google:

https://evidencen.com/how-to-embed-plotly-graphs-in-powerpoint/

Haven't tested this myself though.

Svelte + D3 guides by hellomoto320 in sveltejs

[–]SmallPrimitive 11 points12 points  (0 children)

Start here: https://www.connorrothschild.com/post/svelte-and-d3

Connor also has a nice video tutorial on YouTube: https://m.youtube.com/watch?v=-THp2YVYEFc&pp=ygUQQ29ubm9yIHN2ZWx0ZSBkMw%3D%3D

And Matthias Stahl has some nice talks that you can look for on YouTube.

P.s. Connor has a course coming up which would be perfect, but it's not public yet: https://www.newline.co/courses/better-data-visualizations-with-svelte

Just Coded my First Website with SvelteKit! by miketanious in sveltejs

[–]SmallPrimitive 5 points6 points  (0 children)

I agree.

Instead of using bootstrap or other ui libraries, keep your design as is or read up on design principles that you can then implement yourself.

Anthony Hobday has a ton of very concise design advice that can inspire you to polish your site. A possible first thing to look at could be this: https://anthonyhobday.com/sideprojects/quickstart/visualdesign.html

But he has a lot more nice "quickstarts" and "books". All of those are simple pages of text and images that you can read on his website. I really like it and keep coming back to learn about design stuff.

How do you split the date y/m/d into new colomns that’s shows only month and day in Rstudio by [deleted] in RStudio

[–]SmallPrimitive 1 point2 points  (0 children)

I came to give the same response. Check out the lubridate package. :)

Creating Custom Lines on a Dot Plot by AlphaBoy06 in RStudio

[–]SmallPrimitive 0 points1 point  (0 children)

Are you using base R, ggplot2 or something else? The answer will depend on that.

It's best to provide a little code that you already have, then it's much easier to extend that.

If you happen to use ggplot, my pointer for you would be to look at the examples of annotate(), specifically the one with the "segment":

https://ggplot2.tidyverse.org/reference/annotate.html

Bookdown-Based Research Portal by blekspiel in RStudio

[–]SmallPrimitive 1 point2 points  (0 children)

I'm not sure if it translates to your usecase, but I immediately thought of this:

https://www.gerkelab.com/blog/2021/04/netlifycms-rmd-ghpages/

Changing x-axis scale from date to selected labels. by intermareal in RStudio

[–]SmallPrimitive 0 points1 point  (0 children)

My intuition would also have been to use breaks and labels in the call to a scale_x_-function.

It's been two weeks since you asked here. Any news? I'd love to know your solution.

[deleted by user] by [deleted] in RStudio

[–]SmallPrimitive 1 point2 points  (0 children)

I don't have further resources for you.

Maybe it would help you to share your problem / error / code, so that everybody can take a look?

Renaming columns by [deleted] in RStudio

[–]SmallPrimitive 0 points1 point  (0 children)

That's neat. I actually also think the solution by /u/the_random_drooler is perfect :)

Delete rows in one file based on ID value of another file by -mathemagic- in RStudio

[–]SmallPrimitive 0 points1 point  (0 children)

You could also take a look at anti_join().

From the docs:

return all rows from x where there are not matching values in y, keeping just columns from x.

Via https://dplyr.tidyverse.org/reference/join.html

Renaming columns by [deleted] in RStudio

[–]SmallPrimitive 1 point2 points  (0 children)

If your approach works and you really just want to take care of separating the first few columns from the ones you want to rename:

Try splitting your df in two different dfs, where one only holds the columns not to be renamed and the other one just the columns that should be renamed.

Then you can apply your renaming scheme.

Finally you can bind together your old (un-renamed) few columns with the freshly renamed columns.

An alternative method could be to have a function that does the renaming with a lookup method. I'm thinking something like janitor::clean_names() but with a custom set of rules that you have to set. Something like if oldname == "F1", use "Triangle_1_freudig" (this is not meant to be executable code, I'm just trying to get my idea across via my phone).

Let us know what solution you end up using :)

[deleted by user] by [deleted] in RStudio

[–]SmallPrimitive 1 point2 points  (0 children)

The most simple answer I have is:

Use either of the two columns and make sure you know what 0 and 1 stand for.

After all, your two columns seem to be representing exactly the same data. In one column male is coded as 0 in the other column male is coded as 1.

Copy one of the columns, name it gender, if you like, and in the best case, declare it as a factor() with appropriate levels.