Hi Anamaria
Thanks for the data.
See in line.
> -Original Message-
> From: R-help On Behalf Of Ana Marija
> Sent: Wednesday, June 28, 2023 6:00 PM
> To: r-help
> Subject: [R] horizontal grouped stacked plots and removing space between
> bars
>
> I have code like this:
>
> data
On Wed, 28 Jun 2023 16:55:33 +0500
Jannie Pretorius wrote:
> ./configure: line 24446: ${}: bad substitution
> ## Export LD_LIBRARY_PATH or equivalent.
> if eval "test -z \"\*${*${Rshlibpath_var}*}*\""; then
> eval "${Rshlibpath_var}=\"${R_LD_LIBRARY_PATH}\""
>
Hi Anupam
Using Jim's data
library(reshape2)
at_long <- melt(at_df)
at_long$innum <- as.numeric(as.factor(at_long$Income))
ggplot(at_long, aes(x=innum, y=value)) + geom_path() + facet_wrap(~variable,
ncol=1)
is probably close to what you want.
You need to fiddle with labels, facets variable
Reposting the data did not help. We do not like to guess, and doing so takes a
great deal of time that is likely wasted.
Rows are observations.
Columns are variables.
In Excel, the first row will be variable names and all subsequent rows will be
observations.
Income is the first variable. It
Anupa,
I think your best bet with your data would be to tidy it up in Excel, read
it into R using something like the readxl package and then supply some
sample data is the dput() function.
In the case of a large dataset something like dput(head(mydata, 100))
should supply the data we need.
Ivan and Bert, thank you so much for your help.
Ivan, your solution worked perfectly. I didn't really understand how to
do string processing on a vector of strings, and your solution
demonstrated it for me. I modified it to work with the tidyverses'
stringr library in this way:
bg3_race_sum
Okay. Here is a modification that does four single line plots.
at_df<-read.table(text=
"Income MF MF_None MF_Equity MF_Debt MF_Hybrid Bank_None Bank_Current
Bank_Savings Bank_NA
$10 1 3.05 29.76 31.18 36.0 46.54 24.75 25.4 3.307
$25 2 2.29 28.79 32.64 36.27 54.01 24.4 18.7 2.891
$40 3 2.24
7 matches
Mail list logo