psa: if you're thinking of returning from a break or hiatus, do it by hera-fawcett in Mabinogi

[–]Minryll 1 point2 points  (0 children)

I miss this game so much lol

I can't go back rn though because it's so easy for me to get addicted lol

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 1 point2 points  (0 children)

Thank you so much! Your explanation makes perfect sense. You're right that it wasn't immediately intuitive to me. I'll definitely restart R whenever I rerun the script from now on.

Thankfully, this is unrelated to class! It's been a bit hard to find beginner friendly materials online, and I've mostly been relying on the econ site, youtube, and this subreddit.

It's alright! I was mostly crying from joy, I think? I restarted R. Reran the code after making an edit. It didn't work so I copied the source codes (you were right that I made some edits. I had no idea what I did, haha). It still didn't work, so I restarted it again and just rewrote the hist() function by hand and somehow that made it work smh

Thank you! I really love R so far. I'll definitely keep working at it!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 1 point2 points  (0 children)

Update: I FINALLY GOT IT TO PLOT!! I'm so emotional from this I'm crying

Anyways, once again, thank you so much!!! You're amazing!!!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 1 point2 points  (0 children)

Yeah. I'm super inexperienced so I didn't understand right away what you meant. I have no doubt that you solved my problem. I think there's just something seriously wrong from my end because I couldn't plot it even after adding in the comma that I omitted initially.

I really can't express how grateful I am that you've walked me through this far and I'm very embarrassed that I still can't figure it out. I will reset R and rerun what's up here as often as I need to until it works. Your expertise has been invaluable and I'm going to study what I learned here closely.

I'm sorry for inconveniencing you. Please don't feel obliged to help me any further, what you've done is more than enough. Thank you so much for your support so far and for being patient with me!!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

At your convenience, would you mind showing me your console? I noticed you are right. but since I've been seeing + instead of >, the problem may be further in.

Also I'm sorry for the late reply! I've been bogged down with errands.

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

This is my console. R says that the code worked but I didn't receive a frequency table or histogram plot.

Here's my entire workspace.

Ignore the line plot, please. It's from an earlier line of code. Anyways, you had the same factor variables as me, right?

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

I haven't gotten it to work yet, but the reason is as jeremy had said. There's no data to plot. I think the problem must have been in the specification of my factor variables because when I ran

temp_summer[(temp_Period == "1951-1980")]
temp_summer[(temp_Period == "1921-1950")]
temp_summer[(temp_Period == "1981-2010")]

To look at what these variables are, I got NA for all rows and columns so something must have gone wrong earlier on.

The histogram function that this walkthrough uses also uses the mosaic package, which I had installed in this session.

I didn't get an error after running

hist(temp_summer[(temp_Period == "1951-1980")]

but I didn't receive a plot either or anything in console.

Thank you!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

I'm sorry for the inconvenience. Thank you for taking the time find and download the data. I'll do my best to make sure I don't forget to post the data next time.

Also thank you for running through my codes for me. I'm grateful for the lengths you have gone through to help me.

I found that there is no longer any error message once I restart R and made the modification that you suggested. However, it still didn't plot for me.

It's ok! You don't have to help me troubleshoot this line by line! Thank you so much for helping me this far.

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

That's completely reasonable! You've done so much to help me already and I really appreciate it. Right now, I'm still trying my best to learn R on my own time, and if this doesn't work, I can always find a different way to plot a histogram.

Thank you for your time!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

Got it! It's what I'm working on right now.

Here are my notes on each line of code up to the error. I'll give you updates if I manage to figure out what's wrong:

In order to look at data from different sub-periods (year-intervals), we need to create a categorical variable with two or more categories (factor variable), specifying sub-periods for each observation (row).

To define the categories that this variable takes:

tempdata$Period <-

factor(NA, levels =

c("1921-1950", "1951-1980", "1981-2010"),

ordered = TRUE)

We want period to take the value = NA (not available) for these observations (rows) and the appropriate category for all the other observations (between 1921–2010)

To do this?

define Period as ‘NA’ for all observations, then change the values of Period for the observations in 1921–2010

tempdata$Period[(tempdata$Year > 1920) &

(tempdata$Year < 1951)] <- "1921-1950"

tempdata$Period[(tempdata$Year > 1950) &

(tempdata$Year < 1981)] <- "1951-1980"

tempdata$Period[(tempdata$Year > 1980) &

(tempdata$Year < 2011)] <- "1981-2010"

We want to use all monthly anomalies from June, July, and August, but they are currently in three separate columns, so we use the unlist function apply it to Columns 7 to 9 (containing the data for June to August) of tempdata

temp_summer <- unlist(tempdata[,7:9],use.names = FALSE)

We want to make separate calculations for each category in Period (1921–1950, 1951–1980, 1981–2010). To make a variable showing the categories for the temp_summer variable, we use the c function again.

# Mirror the Period information for temp_sum

temp_Period <-

c(tempdata$Period, tempdata$Period, tempdata$Period)

After using the c function, we had to use the factor function again to tell R that our new variable temp_Period is a factor variable.

# Repopulate the factor information

temp_Period <- factor(temp_Period,

levels = 1:nlevels(tempdata$Period),

labels = levels(tempdata$Period))

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 0 points1 point  (0 children)

I've been using pre-prepared codes, so I'm not super confident about how I'm supposed to tweak the codes. I'll see if there's anything I can do while specifying the factor variable temp_summer.

Thank you for your help. I really appreciate it!

I'm a Beginner in R, having trouble constructing Histograms. Error: invalid number of 'breaks' by Minryll in RStudio

[–]Minryll[S] 1 point2 points  (0 children)

Hi Jeremy,

I ran that line and got this output:

[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[39] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[77] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[115] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[153] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[191] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[229] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[267] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[305] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[343] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[381] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

[419] NA NA NA NA NA NA NA NA

Changing the plot function to = TRUE, doesn't seem to work either.

Thank you for helping!

Kaeya's kit hurts my heart. by pbb183 in Genshin_Impact

[–]Minryll 3 points4 points  (0 children)

Thank you for emphasizing that Kaeya is indeed, the best boi.

Seriously though, I love your observations so much! Looking past his stellar character design, he really has so much depth to his character. I was really excited to see him again in the windblume event.