r/RStudio

▲ 34 r/RStudio

Resources to Learn RStudio from Scratch

I'm looking for resources to learn RStudio from scratch. Does anyone have any recommendations?

reddit.com
u/Kkkk2994 — 5 days ago
▲ 0 r/RStudio+1 crossposts

can't knit to pdf because of error(latex)

this is my first time using LaTex for school work and I have no idea whats causing error.... Any help appreciated thank you

[WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead.
! Missing $ inserted.
<inserted text> 
                $
l.168 \sum
          \emph{\{i=1\}\^{}ne\_i =
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

Try to find the following text in Question_4.Rmd:
  \sum 

You may need to add $ $ around a certain inline R expression `r ` in Question.Rmd (see the above hint). See https://github.com/rstudio/rmarkdown/issues/385 for more info.
Error: LaTeX failed to compile Question.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Question.log for more info.
Execution halted

$$

\begin{aligned}

\frac{\partial RSS}{\partial \beta_0}

&= -2\sum_{i=1}^n(y_i-\beta_0-\beta_1x_i)\\

&= -2(\sum_{i=1}^n y_i-\sum_{i=1}^n\beta_0-\beta_1\sum_{i=1}^n x_i)\\

&= -2(n\bar{y}-n\beta_0-n\beta_1\bar{x})\\

&= -2(n\bar{y}-n\beta_0-n\beta_1\bar{x})\\

&= (n\bar{y}-n\beta_0-n\beta_1\bar{x})\\

&= (\bar{y}-\beta_0-\beta_1\bar{x})\\

&= \beta_0 = \bar{y}-\beta_1\bar{x}

\end{aligned}

$$

$$

\begin{aligned}

\frac{\partial RSS}{\partial \beta_1}

&= -2\sum_{i=1}^n x_i(y_i-\beta_0-\beta_1x_i)\\

&= -2(\sum_{i=1}^n x_iy_i-\beta_0\sum_{i=1}^n x_i-\beta_1\sum_{i=1}^n x_i^2)\\

&= -2(\sum_{i=1}^n x_iy_i-n\beta_0\bar{x}-\beta_1\sum_{i=1}^n x_i^2)\\

&= -2(\sum_{i=1}^n x_iy_i-n\bar{x}(\bar{y}-\beta_1\bar{x})-\beta_1\sum_{i=1}^n x_i^2)\\

&= -2(\sum_{i=1}^n x_iy_i-n\bar{x}\bar{y}+n\beta_1\bar{x}^2-\beta_1\sum_{i=1}^n x_i^2)\\

&= \sum_{i=1}^n x_iy_i-n\bar{x}\bar{y}+n\beta_1\bar{x}^2-\beta_1\sum_{i=1}^n x_i^2=0\\

&= \beta_1(\sum_{i=1}^n x_i^2-n\bar{x}^2)

=\sum_{i=1}^n x_iy_i-n\bar{x}\bar{y}\\

&= \beta_1S_{xx}=S_{xy}\\

&= \beta_1=\frac{S_{xy}}{S_{xx}}

\end{aligned}

$$

$$

\sum_{i=1}^ne_i

= \sum_{i=1}^n(Y_i-b_0-b_1X_i)\\

= \sum_{i=1}^nY_i-nb_0-b_1\sum_{i=1}^nX_i\\

= \sum_{i=1}^n(b_0+b_1X_1)-nb_0-b_1\sum_{i=1}^nX_i\\

=0

$$

$$

\begin{aligned}

\sum_{i=1}^n e_iX_i

&= \sum_{i=1}^nX_i(Y_i-b_0-b_1X_i)\\

&= \sum_{i=1}^nX_iY_i-\sum_{i=1}^nX_ib_0-\sum_{i=1}^nb_1X_i^2\\

&= \sum_{i=1}^nX_iY_i-\left(b_0\sum_{i=1}^nX_i+b_1\sum_{i=1}^nX_i^2\right)\\

&= \sum_{i=1}^nX_iY_i-\sum_{i=1}^nX_iY_i\\

&= 0

\end{aligned}

$$

u/Potential-Radish-822 — 7 days ago
▲ 23 r/RStudio+1 crossposts

R code review: best packages?

Let’s say that I’m working in RStudio on a geospatial data-science project that involves some pretty gnarly, extensive code across multiple R scripts. Let’s also say that I do not have access to any AI code assistants or chatbots due to workplace restrictions.

What packages and functions would you use to comprehensively check your code for errors, inefficiencies, conceptual problems (that may be a stretch), etc.?

I’m using lintr::lint() and rstyler::style_file(), but that’s the extent of my knowledge in this area.

Many thanks in advance, friends.

reddit.com
u/LoudConsideration266 — 12 days ago
▲ 17 r/RStudio

R beginner

Hello,

I am a beginner and I am totaly lost.

Even for loading a file it is very very difficult.

I feel useless and incompetent...

reddit.com
u/ChangeUnhappy8494 — 14 days ago

aws.s3 in R

Hi,

Apologies if this is the wrong place to post - I can’t find any resources online that seem to cover this issue.

I’m using aws.s3 package in R, to read in files from a LakeFS storage area.

When I use s3read_using or s3write_using, the connectivity works. The functions include (e.g.):

S3read_using(FUN = read.csv,
Object = path/file.csv,
Opts = …,
Bucket = my_repo)

This works fine and I am able to read in the object, same goes for writing using same opts.

However, when I try and run for example head_object (so I can list the objects contained in one of my buckets) or get_object, I get :

error in curl::curl_fetch_memory(url, handle = handle):
Could not resolve hostname
Could not resolve host: [path]

I’m not sure if I’m missing something simple - I’m using the exact same repo, opts, and object (/paths) for both. The [path] here looks correct - I don’t see any issues with it. Does something happen within s3read_using where it points to a location that I need to specify myself with in head_object? Should they not be pointing to the same place?

Again sorry if this is hard to follow or make sense of, I just can’t seem to find anything online relating to this problem or solutions.

Thanks

reddit.com
u/Soft-Duty-7395 — 13 days ago
▲ 30 r/RStudio+1 crossposts

Introducing FitVerse: an R package for fitting and analysing 52 probability distributions in one call

Hi r/rstats,

My colleague and I just published FitVerse on CRAN. It fits parametric probability distributions to continuous data, covering 52 distribution families with three estimation methods: MLE, Method of Moments, and L-Moments.

The basic usage is just:

r

install.packages("FitVerse")
library(FitVerse)

x <- as.numeric(precip)
fit <- fitverse(x, xlab = "Annual precipitation (inches)")

It automatically ranks all distributions by AIC/BIC, runs four goodness-of-fit tests, and produces a diagnostic plot. It also includes bootstrap confidence intervals, return levels, batch fitting, report generation, and a built-in Shiny app.

Full write-up here: https://rpubs.com/KarunaGReddy/FitVerse

CRAN: https://cran.r-project.org/package=FitVerse

Happy to answer any questions!

reddit.com
u/KarunaGReddy — 13 days ago
▲ 0 r/RStudio+1 crossposts

I just asked my dot to check some R code (R is a statistical programming language)...

And it says it has reconstructed the R operating environment to run its checks (I find that remarkable). It then found the data on my PC (unnerving but not unexpected) and is running its analysis using the R code I gave it, and its results are matching the prior run's results.

reddit.com
u/TrafficWinter2278 — 13 days ago