I'm fairly new to r and currently using R-studio to generate different graphs. So, I have several CSV file and I have imported one of them using "import dataset" toolbar command in upper right pane. I can see the table and all. What I like to do is to use only one column of that table to generate a bargraph. The table has this format :
User_ID, Total_logins, Entry_time
And I would like to use "Entry_time" column only to generate the graph. How can I achieve that? I did google before I ask but I found only that relates to dataset not a table.
Next question is, if I want to create stacked column chart using two columns of table how do I do that?
Thanks
Related
I have a baffling question on how to extract a table from a PDF file using tabulizer.
Here is the table. You will notice that each cell has a value but it is also color coded.
https://anhd.org/wp-content/uploads/2016/11/20161106_anhd_ed_poster.pdf.
I have been using the R code method outlined in:> https://medium.com/#ketanrd.009/how-to-extract-pdf-tables-in-r-e994c0fe4e28
Can you give me any help on how to extract the cell count and color coded risk level?
Thank you.
I'm trying to plot some data in Google spreadsheet:
And as you may see all of the series are in a same column and I can't use the any of the rows as headers. My plot looks like this:
I would appreciate if you could help me know how I can edit/add legend labels.
Unfortunately I don't think the graphs were intended for your data format.
The only way I've been able to work out how to add a header is by reformatting my data so I have the header at the top of my ranges.
So I suggest you split your data into separate columns so you have;
D2:D4, E2:E4, F2:F4 etc with D1, E1, and F1 as your header and then selecting "Use row 1 as your headers." From the data menu.
Alternatively, you could add labels to the series themselves. Although not ideal, it could be quicker than reformatting your data. On the data menu, click on the three dots of a data series to bring up a menu that allows you to add a label. Unfortunately this needs to be a cell so you'll have to have that header on your sheet some where.
I had the same question this year (2021), and it looks like there's support for it now. In short, you just have to double-click on the empty legend item for the series, and it'll give you a place to put text, directly in the chart.
Here's what my chart looked like (with no series titles):
If you double-click on one, you'll get a small text input area.
Type in your series name and then press enter or click outside of the input area.
Repeat this for each series, and you should be good to go.
I had the same problem because I was selecting only the data I wanted to include in the chart and not the entire table, headers and all. When you create a chart in Google Sheets and you want to use a row or column (or both) as strings that are included in the chart's labeling, you must select the entire table before choosing the Chart command from the Insert menu.
After doing so, you may need to do all or some of the following:
Switch rows/columns if your axes are not correct
Eliminate any rows/columns that you don't want represented by editing the Data Range field in the chart editor
Select Use column A as headers or Use row 1 as headers
You could also potentially use the add labels option when clicking on the 3 dots in the series section:
Double-click on the symbols in your legend, then double-click on the symbol for the series you would like to label; you should be able to directly enter your legend label now. You can do further text formatting using the chart editor on the right.
I took them to a new sheet. first selected only the X-axis and one of the columns that will appear as one. label. In this sheet, I made all the "labels" as a header of the sheet. and added them one by one as a series. and this time it. add them as a label.
obviously this is a workaround and the bug should be fixed :) hopefully.
I am new to Kibana and need some help.
I can draw this line chart for a single query (java):
Now I would like to another line for another query (for example python) in the same chart. I am not so sure how to do that. Also "Markdown widget" is the way to add a legend?
Any help would be appreciated.
It is possible by adding the followings:
X-Axis -> Split Lines -> Sub Aggregation -> Filters
In the filters, you can add multiple ones such as query:java, query:react and so on.
As far as data is from same index we should be able to do it.
Any chart visualization edit buckets configuration will have option to split line/chart using that you can do split lines.Here you can do split by attribute also if you want to go with date you can go with following steps in high level.
In Visualize, select Line Chart
For Y-Axis, select "Average", then select PRICE -- note, you can't plot the exact prices, it has to be some bucketing function
In X-Axis, select "Date Histogram", then select CHK_IN_DATE
Then select "Add Sub-Buckets", select "Split Lines", select "Terms", select "SOURCE_SITE_C"
You should get something similar to the screenshot below.
If your graph ends up being too messy with more lines than you expected, switch the order of steps 3 and 4 (or just use the arrow keys to switch the order of operations, see this blog80 for explanation)
I found an interesting thread about plotting but I'm not happy with the answer. I would like to plot different amount of rows on the same graph. Just giving me the possibility to add as much rows as I want to.
I'd like to use glopts library but I am open for any other. First of all I want to plot those rows into pdf file. The script which I want to modify is:
which_rows <- c(12,156,4432) ## I want to choose which row I want to plot
pdf(file='Plots'.pdf)
x <- 1:(ncol(data_plot)-1) ## Can it be changed to use the name of the columns instead of pure numbers ?
for(i in which_rows){
## create new pdf page BUT I WANT TO PLOT IT ON THE SAME GRAPH!
plot(x=x,y=data_plot[i,-1],type='b',main=data_plot[i,1],xlab='columns',ylab='Intensity')
}
# closing pdf
dev.off()
Can you help me to modify this script to print just all of the rows which I decide on the same graph ? Would be great if you show me how I can jsut add new page in this pdf file using the other set of rows like which_rows2.
Of course each plot should has diffent colour or something.
Edit:
use points()to add points to the existing plot
I would like to put two series in the same graph on the graphite dashboard. However, since the dashboard requires single-line commands I could not find a way that doesn't involve the use of a wildcard.
Here's an example of the two series I would like in the same graph:
sum(base.foo.bar.positive.*)
sum(base.foo.bar.negative.*)
I tried several separators but I could not get it to work. Any ideas?
You have a few options here...
Merge the 2 graphs on to the graph via the drag and drop in the dashboard
OR
Use the sumSeriesWithWildcards() function
Merge 2 or more wildcard matching
Open your first graph on the dashboard
Open your second graph on the same dashboard
Click and hold the second graph and drag it over the first graph
Use groupByNode() and wildcard matching
This is not as nice, and will not always work however you will be able to do this all in one line.
sumSeriesWithWildcards(base.foo.bar.{positive,negative}.*, 3)
This will do the following:
Select all all the graphs that match base.foo.bar.positive.* and base.foo.bar.negative.*
Sum the data by the node at position 3: positive, negative
You might want to have a read over the following page: http://graphite.readthedocs.org/en/1.0/functions.html