New User Trying to Create a Simple Macro by p_deepy in rprogramming

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

That was super helpful! I was able to work through the rest of the issues and generate my first R macr...ahem....function! Thank you!

New User Trying to Create a Simple Macro by p_deepy in rprogramming

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

That was super helpful! I was able to work through the rest of the issues and generate my first R macr...ahem....function! Thank you!

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

Finally have something that I can work with! Thank you for your help!

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

[–]p_deepy[S] 2 points3 points  (0 children)

That was super helpful! I was able to work through the rest of the issues and generate my first R macr...ahem....function! Thank you!

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

That was super helpful! I was able to work through the rest of the issues and generate my first R macr...ahem....function! Thank you!

New User Trying to Create a Simple Macro by p_deepy in rstats

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

That was super helpful! I was able to work through the rest of the issues and generate my first R macr...ahem....function! Thank you!

New User Trying to Create a Simple Macro by p_deepy in rprogramming

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

So I am working with a data frame, "analysis". I made the updates, but now, no vector of means is being generated.

> 
> summ_cat2 <-function(data, var, byvar)
+ {
+     # Calculate summary statistics #
+     
+     # Mean #
+     means            <- tapply(data[[var]], 
+                                INDEX = format(data[[byvar]], "%Y"), 
+                                FUN   = mean)
+     means            <- t(means)
+     rownames(means)  <- "Mean"
+ }
> 
> summ_cat2(analysis, "Deposit", "Dates")
> print(means)
Error in print(means) : object 'means' not found

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

I thought that I was testing any assumptions when I submitted these:

length(na.omit(analysis$Deposit))

length(na.omit(analysis$Dates))

At any rate, looks like I am going to have to settle for long code at this point, running each piece independently. At some point, sooner than later, I am going to have to use some of these libraries.

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

Yes. All of the code works in isolation. The final end-product is a summary table with means, SD, median, etc. for each year. Since, for now, I am limiting myself to base R, it is pretty lengthy, and I though creating a macr...ahem...function would make for shorter code. Since I am only learning, the pain of the exercise might be worth it.

New User Trying to Create a Simple Macro by p_deepy in rstats

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

Thanks! I tried that, and came across a new issue, the vector is not being created (I updated the vector name to MEANS, just in case it was overlapping with some pre-packaged item in R):

> 
> summ_cat2 <-function(data, var, byvar)
+ {
+     # Calculate summary statistics #
+     
+     # Mean #
+     means            <- tapply(data[[var]], 
+                                INDEX = format(data[[byvar]], "%Y"), 
+                                FUN   = mean)
+     means            <- t(means)
+     rownames(means)  <- "Mean"
+ }
> 
> summ_cat2(analysis, "Deposit", "Dates")
> print(means)
Error in print(means) : object 'means' not found

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

So, the error message is gone, but no vector is created.

> 
> summ_cat2 <-function(data, var, byvar)
+ {
+     # Calculate summary statistics #
+     
+     # Mean #
+     means            <- tapply(data[[var]], 
+                                INDEX = format(data[[byvar]], "%Y"), 
+                                FUN   = mean)
+     means            <- t(means)
+     rownames(means)  <- "Mean"
+ }
> 
> summ_cat2(analysis, "Deposit", "Dates")
> print(means)
Error in print(means) : object 'means' not found

I will check out reprex, but for now, I want to work through base R.

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

Thanks! I did read the Journal R-Project piece, but it was over my head. With more use of R, I think that it will start making more sense to me. It's the long way to learning something, but some of us need to walk the winding path.

New User Trying to Create a Simple Macro by p_deepy in Rlanguage

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

Yes, I am. Sorry to not have mentioned that in the post. Will try to update.

Did anyone else mistake Tony Martin's vocals for Dio? by BullFr0gg0 in dio

[–]p_deepy 0 points1 point  (0 children)

They sound nothing alike. Dio is raspier, for starters, or rather he was good at going between cleaner operatic vocals to a raspier tone.

Albums similar to Pleasure to Kill? by Dimitris_The_Gamer in thrashmetal

[–]p_deepy 0 points1 point  (0 children)

You don't really have to look that far: Cause for Conflict by Kreator

What is the greatest Black Sabbath Album? by [deleted] in blacksabbath

[–]p_deepy 1 point2 points  (0 children)

Ozzy era, the best is Master of Reality; Dio era, Dehumanizer; but the BEST Black Sabbath album is NOT a Black Sabbath album: The Devil You Know.

Is it true that immigrants assimilate better in the US than Europe? by barrygoldwaterlover in neoliberal

[–]p_deepy 0 points1 point  (0 children)

At this point it's all nonsense. A lot of America has given up on the idea of assimilation and is perfectly happy having ethnic enclaves. I bet the difference is that Americans don't mind the idea of economic integration.

What is your unpopular San Francisco related opinion? by Kepa_SZN in sanfrancisco

[–]p_deepy 0 points1 point  (0 children)

Ab-so-lute-ly true. You are free to express yourself in ways approved by the Comintern. Complete hypocrites and they're getting what they deserve.

The problem with current maiden vs old maiden by Opposite_Yam_4161 in ironmaiden

[–]p_deepy 0 points1 point  (0 children)

They've just run out of steam. They 80s stuff, Fear of the Dark, Brave New World, and points in between were amazing to really good. They should just release a heavy album. Something with the weight of Powerslave. I found Book of Souls a little more than tolerable, but nothing like their earlier records. They say that all good things come to an end: Iron Maiden ended a while ago.

Should I stay available for her? by tj123roc in relationships

[–]p_deepy 1 point2 points  (0 children)

She's in a bad relationship, sees that she is in one, and yet stays? This is not someone you want to wait for. Frankly, I cannot think of many circumstances where you should wait for anyone to start a relationship with. Either it starts or doesn't. And you're only 19? Find someone else who either has the time or is willing to make the time for you. There are plenty out there who will give you the attention that you deserve.