Hi, I'm working on R trying to find a distribution that fits data from a csv file. The csv contains data on pressure exerted by a certain vehicle in terms of pressure [kPa] and I have around 3000 data points. I want to call forth this csv and by using (fitdistr) or if you could recommend a function to use, get a plot of my csv and the distributions I can compare it to (Weibull, chi, beta, etc). Now im a complete amateur with the program R, and I can't write a code to call forth the csv with every data point. I?ve been stuck trying to write a code that works for over a week and have not gotten it to work. I've come to the conclusion that this is the only program capable enough to help me plot the distributions to my data, any help is greatly appreciated! Kind regards [[alternative HTML version deleted]]
Dear Mohammad Perhaps if you showed us what you tried people could offer more helpful advice? When you say you want to call it forth do you mean you want to read in the file using read.csv? Michael On 16/04/2018 11:23, Mohammad Areida wrote:> Hi, I'm working on R trying to find a distribution that fits data from a csv file. The csv contains data on pressure exerted by a certain vehicle in terms of pressure [kPa] and I have around 3000 data points. > > I want to call forth this csv and by using (fitdistr) or if you could recommend a function to use, get a plot of my csv and the distributions I can compare it to (Weibull, chi, beta, etc). Now im a complete amateur with the program R, and I can't write a code to call forth the csv with every data point. I?ve been stuck trying to write a code that works for over a week and have not gotten it to work. I've come to the conclusion that this is the only program capable enough to help me plot the distributions to my data, any help is greatly appreciated! > > Kind regards > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Michael http://www.dewey.myzen.co.uk/home.html
Hi, You may use the keyword to google for what you want to do to start with. Slowly you will learn...this forum is,really helpful but we should provide or show some effort..all the best! I like this forum very much and always feel thankful to very helpful and committed members. Sent from my Sony Xperia? smartphone ---- Mohammad Areida wrote ---->Hi, I'm working on R trying to find a distribution that fits data from a csv file. The csv contains data on pressure exerted by a certain vehicle in terms of pressure [kPa] and I have around 3000 data points. > >I want to call forth this csv and by using (fitdistr) or if you could recommend a function to use, get a plot of my csv and the distributions I can compare it to (Weibull, chi, beta, etc). Now im a complete amateur with the program R, and I can't write a code to call forth the csv with every data point. I?ve been stuck trying to write a code that works for over a week and have not gotten it to work. I've come to the conclusion that this is the only program capable enough to help me plot the distributions to my data, any help is greatly appreciated! > >Kind regards > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]
There are plenty of options for reading csv files. For built-in solutions look at ?read.csv or at read_csv from the package reader. If the measurements are ordered in columns rather than in rows, reading the data can be very slow. HTH Ulrik Mohammad Areida <areidamh at gmail.com> schrieb am Mo., 16. Apr. 2018, 13:25:> Hi, I'm working on R trying to find a distribution that fits data from a > csv file. The csv contains data on pressure exerted by a certain vehicle in > terms of pressure [kPa] and I have around 3000 data points. > > I want to call forth this csv and by using (fitdistr) or if you could > recommend a function to use, get a plot of my csv and the distributions I > can compare it to (Weibull, chi, beta, etc). Now im a complete amateur with > the program R, and I can't write a code to call forth the csv with every > data point. I?ve been stuck trying to write a code that works for over a > week and have not gotten it to work. I've come to the conclusion that this > is the only program capable enough to help me plot the distributions to my > data, any help is greatly appreciated! > > Kind regards > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hi, I do not know how to post in general again, however my csv contains around 5-250k data Points depending on vehicle/road type and pressure exerted on geotechnical structures. I have used R to develope histograms of said csv files and will attach such Picture to you in this mail and the csv used. Below I will type the R code I have used for this histogram. ------------------------------------------------------------ ---------------------------- tryck <- read.csv("radmanso_2017.csv", sep=";", dec=",") ##### H??R KOLLAR VI ALLA DATA PUNKTER ###### ggplot(data=tryck, aes(tryck[,1])) + geom_histogram(aes(y =..density..), breaks=seq(min(tryck[,1]-1), max(tryck[,1]+1), by = 0.5), col="black", fill="green", alpha = .2) + geom_density(col=2) + labs(title="Pressure for r?dmans?") + labs(x="Pressure [kPa]", y="Amount of vehicles (Percentage)")+ stat_function(fun=dnorm, colour="blue", args = list(mean mean(tryck[,1]), sd = sd(tryck[,1]))) My problem now is to find a statistical distribution that corresponds well with my histograms with the use of Visual aids, cumulative distributions or goodness of fit tests which I can?t develope a code for as my csv wont get called forth and I do not know how to proceed from that Point on to develop such an aid. If you have any input on how to read the csv file and call forth a distribution to try on my data points such as Weibull, beta, chi or gen. Extreme value distributions I would much appreciate the help! Kind regards, Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: Radmanso 2017.PNG Type: image/png Size: 51587 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20180416/8f649333/attachment-0006.png>
Hi Mohammad, The plot you attached suggests that the underlying distribution may be a mixture. Is there anything in your data that would explain this, such as laden/unladen, uphill/downhill, different road surface? Jim On Mon, Apr 16, 2018 at 11:31 PM, Mohammad Areida <areidamh at gmail.com> wrote:> Hi, I do not know how to post in general again, however my csv contains > around 5-250k data Points depending on vehicle/road type and pressure > exerted on geotechnical structures. I have used R to develope histograms of > said csv files and will attach such Picture to you in this mail and the csv > used. Below I will type the R code I have used for this histogram. > > ------------------------------------------------------------ > ---------------------------- > > tryck <- read.csv("radmanso_2017.csv", sep=";", dec=",") > > ##### H??R KOLLAR VI ALLA DATA PUNKTER ###### > > ggplot(data=tryck, aes(tryck[,1])) + > > geom_histogram(aes(y =..density..), > > breaks=seq(min(tryck[,1]-1), max(tryck[,1]+1), by = 0.5), > > col="black", > > fill="green", > > alpha = .2) + > > geom_density(col=2) + > > labs(title="Pressure for r?dmans?") + > > labs(x="Pressure [kPa]", y="Amount of vehicles (Percentage)")+ > > stat_function(fun=dnorm, colour="blue", args = list(mean > mean(tryck[,1]), sd = sd(tryck[,1]))) > > > > My problem now is to find a statistical distribution that corresponds well > with my histograms with the use of Visual aids, cumulative distributions or > goodness of fit tests which I can?t develope a code for as my csv wont get > called forth and I do not know how to proceed from that Point on to develop > such an aid. If you have any input on how to read the csv file and call > forth a distribution to try on my data points such as Weibull, beta, chi or > gen. Extreme value distributions I would much appreciate the help! > > > > Kind regards, > > Mohammad > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >