-1

I am in need of your help.
I'm trying to generate a line chart in R using data from 2 excel files.
The graph I'm trying to generate is similar to the one shown below

Grafic

The data presented in this excel image is an example and has more than 1000 lines, but I only need the first 100 of each file Excel file example

Thanks for your help

excel

  • We cannot read data into R from images. Please [make this question reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by including a small representative dataset in a plain text format - for example the output from `dput(yourdata)`, if that is not too large. – neilfws Sep 22 '22 at 23:52
  • @neilfws Thanks for your hint I put an example file – Vamberto Rocha Junior Sep 23 '22 at 00:09

1 Answers1

0

After downloading the .xlt file from your public Onedrive account, I first looked at it with my Linux version of LibreOffice to make sure there was something there, then I did this:

> library(haven)
> help(pac=haven)  # drats I thought haven did excel, apparently not
> library(readxl)
> help(pac=readxl)   # read some of the help pages to see if an xlt format would be ok
dat <- read_excel("~/Downloads/teste.xlt") # no confirmation that it would be,
     # so experimented
                                                                                                                  
 str(dat)
#----
tibble [1,001 × 2] (S3: tbl_df/tbl/data.frame)
 $ Tempo: chr [1:1001] "0" "0.1" "0.2" "0.3" ...
 $ Prob : chr [1:1001] "0.0" "0.095188" "0.1813153" "0.2592441" ...

# So success and now to plot with base graphics, of course.

 plot(Tempo~Prob, dat[1:100, ])
 plot(Prob~Tempo, dat[1:100, ])

enter image description here

Oh, wait. You wanted a line with small points. Then do this:

png(); plot(Prob~Tempo, dat[seq(1,101, by=5), ], type ="b", cex=0.2, col="green"); dev.off()

enter image description here

IRTFM
  • 258,963
  • 21
  • 364
  • 487