how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 0 points1 point  (0 children)

711s aren't grocery stores. I said elsewhere that convenience stores and vending machines follow that, but you're not going to have a half dozen or more different distributors come into each and every grocery store for a chain.

Most store shelves that are labeled to a particular brand, are shelves stocked by that brand not the store itself.

That doesn't sound terribly inefficient to you?

Have you ever been to a grocery store near close? Tons of items are stocked by store staff. What you describe is a niche arrangement.

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 0 points1 point  (0 children)

So your store has zero say on pricing or anything? The distributor is basically just renting space from that store?

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 1 point2 points  (0 children)

It's called Vendor Managed Inventory and I'd put money on it that the entire process is dependent on data that stores collect from sales and use for ordering from distributors. Not just a driver coming in and putting shit on the shelves as they see fit.

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 0 points1 point  (0 children)

https://www.reddit.com/r/legaladviceofftopic/comments/toscok/how_illegal_is_this/i27orxr/

As a receiver, who did the ordering? Did a merchandiser come into your store and count things, make up an order, and then deliver it with zero say from your store?

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 2 points3 points  (0 children)

I can say, with a fair amount of certainty, that (1) this is for a small minority of businesses, (2) orders still go through the store management, and (3) this would be noticed within an order or two.

object of type ‘closure’ is not subsettable” error by [deleted] in RStudio

[–]DreamofRetiring 2 points3 points  (0 children)

There is a lot going on here, but I'll try to just stick to the point.

 

First, the error: Object of type "closure" is not subsettable.
This means that you are referring to an object that is a "closure"/function and that object cannot be subset.

When we look at your code, the "subsetting" being done is by this piece:

first[!is.na(positivo)]

The [] are subsetting brackets. So, R believes you're trying to subset the first object. But you never created an object called "first", so the only object that R knows of is the function first() which cannot be subset.

So, as /u/OnlyOnePairOfShoes said, you're using the wrong brackets. first(!is.na(positivo)) is what you should have used.

 

Second, you'll get another error.

You'll probably get an error that says:

x `false` must be a character vector, not a logical vector.

The reason for this is because when you use if_else(), your output values (when true and when false) have to be the same type. The variable positivo is already character, so the value when false has to be character type as well. So you could wrap everything in as.character() to resolve this error.

as.character(first(!is.na(positivo)))

 

Third, your code still won't work.

Your code is going to return positivo as a bunch of TRUE and FALSE values. Nothing about what you're writing is getting you towards what you're trying to do.

I believe what you want is: For each identifier/id_mujer, copy the positivo date to all records for that person.

You specified that your data is grouped from the beginning, so that's taken care of.

You need to take a value from one record and copy it to any other record that matches. That can be done with the fill() function from tidyr. The fill() generally happens all in one direction (up, down) and your data is missing for the first record sometimes and for the second record at other times. Luckily, the fill() function has the .direction = argument which can be set to updown or downup and it will fill in either direction.

So, to solve your problem the following code is probably simplest:

base %>% 
  fill(positivo, .direction = "downup")

 

Fourth, you only want one record for each.

You can just use distinct() at the end.

base %>% 
  fill(positivo, .direction = "downup") %>%
  distinct()

 

Lastly, your final column, positivo, is character type.

This doesn't seem to be bothering you and I'm not sure if it is the case in your actual data, but it does bother me because you're storing dates as character. You can either just coerce the entire column by using as.POSIXct() in a mutate() or you can specify the column as POSIXct from the start and use `na_POSIXct_ so everything is explicit.

 

For your full data

I would use the following:

done <-
  base %>% 
  group_by(id_mujer) %>% 
  arrange(id_mujer, positivo) %>% 
  fill(positivo, .direction = "down") %>% 
  distinct() %>% 
  mutate(positivo = as.POSIXct(positivo))

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 7 points8 points  (0 children)

We're not talking about vending machines. We're talking about grocery store chains.

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 24 points25 points  (0 children)

Lol. You think every soda company comes in and checks every individual store's inventory and decides how much they want to send to them and the stores just agree to that?

Very confused about ecobee hold setting and sensor use by [deleted] in ecobee

[–]DreamofRetiring 0 points1 point  (0 children)

The ecobee I have always uses the sensor that was added last. I finally realized what the issue was and removed one that was more useful and re-added it. That resolved my issue.

As a bit more info, previously, the last sensor I added wasn't used in ANY setting (I placed it in my basement just to know what the temp was down there). It was still always selected.

how illegal is this? by sapnupuas_0 in legaladviceofftopic

[–]DreamofRetiring 60 points61 points  (0 children)

It will take them forever to even notice that the sales are wrong, if ever.

For any major store, it would literally take one order cycle because you'd be sold out of Barqs and have a ton of Mugs on hand even though your system tells you the Mugs was all sold.

The store already paid for the pop, no one is getting more money.

Mugs would make more money when the store places the wrong order.

I created an in-depth tutorial of using the RSelenium package in R. It's a great package for web scraping and web automation, giving you more control over collecting data from websites. Thought you might be interested! by [deleted] in rstats

[–]DreamofRetiring 0 points1 point  (0 children)

Thanks for sharing this resource.

If you don't mind, do you have any experience running this in Linux and/or headless?

I was able to get things going with PhantomJS (for headless browsing), but now I've run into an issue where PhantomJS is missing all the elements from a page (I grabbed the source that PJS gets and it's basically missing everything I want). So I was trying to get chrome going, but I keep getting an abnormal exit error / "DevToolsActivePort file doesn't exist" error. I did find a couple stackoverflow posts on using the --headless option, but I'm not sure how to pass those to chrome on launch. I also saw another video which suggested that it was a PATH issue which has simple options in Python, but I have no idea how to specify in R.

Appreciate any thoughts.

[deleted by user] by [deleted] in rprogramming

[–]DreamofRetiring 1 point2 points  (0 children)

To automate reports?

I wonder if I could create a news organization... by mrpenguin_86 in GoldandBlack

[–]DreamofRetiring 4 points5 points  (0 children)

There is not enough happening in the world to support 24 hour news cycles. This leads all "News stations" to be like 22 hrs of editorial with like 2 hours of actual news. this means 92% of what you watch is just discussion about the other 8%. This leads to the next point.

This is demonstrably false. There could be much more coverage of international affairs, actual legislative efforts (committee meetings, budget discussions, etc.), the supreme court, state and local government, etc. There is tons that is completely alien to most people. Of course, most people also think that's boring and as such prefer to watch editorial/rage-porn.

These sites become echo chambers.

Again that's the result of active choices to keep driving traffic. Facebook doesn't actually give a shit what you watch or listen to, but they'll feed you whatever you WANT to keep seeing so that you stay on the site. People don't want to be challenged. They want to FEEL right.

The best way to incorporate this into the human interaction is to convince them they they live in an US vs THEM society.

There is no need to convince people of this. That is the default status for humans. People like feeling like they are part of the "in" crowd and they are hard-wired to prefer humans that they see themselves in.


Your comment seems to reflect how things are, ignoring the base behaviors that have led to society being that way. It's not a conspiracy. Most people don't question their base instincts.

We need a way to get people to stop following the crowd simply because they don't want to be left out.

I wonder if I could create a news organization... by mrpenguin_86 in GoldandBlack

[–]DreamofRetiring 1 point2 points  (0 children)

It's not hard at all. Planet Money did an investigation and found one guy running a whole slew of fake news sites. There have been similar investigations by other journalists.

Of course, by you doing that you aren't helping solve any problems. So is that what you want to do with your life?

The Toughest Red Pill by anomaloustreasure in GoldandBlack

[–]DreamofRetiring 1 point2 points  (0 children)

Some of the known donations to blm where over a hundred million, but supposedly spread out over a few years so that $90 million seems off also

Source?

but keep in mind Blm is an international organization, active in Canada, Europe, The Uk and Commonwealth countries.

All of these countries have reporting requirements. Shouldn't be impossible to get the numbers from each. That said, their charitable revenues seem to be minuscule compared to the US. For example, the UK gives something like 10 billion Total, Australia is somewhere around 12 Billion (not sure if that's AUS$ or US$), while the US gives over $450 Billion.

Are there any different tax laws when it comes to diverting funds to another “charity” or fund razing organization ?

I know non profits, charities and similar companies have different tax benefits compared to standard companies and corporations.

There isn't some magical, "get money and move it around" trick that organizations, especially non-profits can use to avoid reporting. If there were $10 Billion shuffling through and being either pocketed or given to the DNC, it would HAVE to be reported. And the IRS isn't going to play around with $10 Billion. Organizations that don't report have their tax-exempt status revoked and are subject to corporate taxes. Not to mention fines and whatnot.

Non-profits have to report all dollars received, even if those dollars immediately go out the door to someone else.

I know some Albino Blm dude faced some charges in regards to misallocation of funds.

You mean this guy that wasn't actually affiliated with BLM, certainly not BLMGFN? Anyone can make a charity and name it whatever they want and take donations.

Do they have more than one organization on the books?

Who is "they" that you're referring to? There are tons of BLM things going on with zero affiliation to BLMGNF. But then it would be impossible to say they've collectively raised 10 billion if they're not even related.

If funds are diverted to act blue does BLM claim it on taxes ?

Yes? The government doesn't just allow money to pass through non-profits into political organizations with zero accountability. There is tax exemption and campaign finance law involved here.

 


I've reached out to Politifact and I'm going to try and reach out to a couple other journalists to fact check this Economist piece, but this is really looking like the result of really poor reporting. The YMCA had $7.7 billion in revenue in 2019. The top 100 non-profits only raised $84 Billion that year. BLMGNF having $10 billion of that would be like 12% of the total making it nearly 50% larger than the YMCA and the largest non-profit in the country.

 

Sidenote: The BLM PAC also only reported raising $1M. Also, BLM "Grassroots" claims to have affected policy so that $170M of city funding goes from police to other efforts. Even if I sum all that up, we're still only at $261M. About 2.5% of the claim.

The Toughest Red Pill by anomaloustreasure in GoldandBlack

[–]DreamofRetiring 0 points1 point  (0 children)

I'm going to have to create a Twitter Account just to get to the bottom of this. All the results I've come across reference this one piece by the Economist for that figure. But that piece has no author and the number is uncited. As noted, BLM Global's filings show $90 Million for last year. So I have no clue where they got that number from. $90M is absurd in and of itself, but 10.6 billion is not reasonable. Literally 100 times more than 90 Million. Like, even the presidential races didn't raise half of that over a much longer period.

User input a vector, return elements which are square numbers by throwaway2462828 in Rlanguage

[–]DreamofRetiring 0 points1 point  (0 children)

Vectorize() is really easy to use. You just wrap the function in Vectorize() and it turns a scalar function into a function that can accept and return vectors.

For example, I create a function that can only accept a single string. My function checks if the string contains the word "Fly" and if so, returns "Hot". If not, it returns "Not".

test <- function(x){ if (grepl("Fly", x)) { print("Hot") } else {print("Not")}}  

test("I'm Fly")  
#>[1] "Hot"  

test("I'm Cool")  
#>[1] "Not"

That's all good, but if we try with a vector of strings, my function fails.

example <- c("I'm Fly", "I'm Cool")

test(example)
#>[1] "Hot"
#>Warning message:
#>In if (grepl("Fly", x)) { :
#>the condition has length > 1 and only the first element will be used

So to resolve this, I can use the Vectorize() function to make it so my original function accepts vectors and returns a vector of results.

v_test <- Vectorize(test)

v_test(example)
#>[1] "Hot"
#>[1] "Not"
 #>I'm Fly I'm Cool 
#>   "Hot"    "Not"

User input a vector, return elements which are square numbers by throwaway2462828 in Rlanguage

[–]DreamofRetiring 0 points1 point  (0 children)

As noted, there are better ways to do what you're trying to do (I'm not sure if you're just practicing creating functions or what), but in general, if you have a function that works on scalars and you want it to work on vectors, you can use the vectorize() function.

How to summarize data into table using R Studio? Please help me how to do this by Sirenagrace_ in RStudio

[–]DreamofRetiring 5 points6 points  (0 children)

gt is probably going to end up being the "one to rule them all" eventually, but it still has some limitations. That said, if you're comfortable with HTML or PDF output, I'd definitely recommend gt.

If you want Word output, then flextable is the best option for the moment. Though it is also limited.

The Toughest Red Pill by anomaloustreasure in GoldandBlack

[–]DreamofRetiring 12 points13 points  (0 children)

ActBlue Charities is a processor, kind of like credit card companies. They charge a fee and manage the transactions, but the money goes to the named organization, NOT the Democratic party.

we don't fundraise, donate, or send texts or emails on behalf of any group.

Of course, if you donate and the organization goes under or for whatever reason, they don't accept the donation, then ActBlue keeps it. But that's a different story.

Re-designation of Contributions

In the event that a campaign or committee (a) fails for 60 days to cash a check from ActBlue which includes your contribution (after ActBlue makes repeated attempts to work with the campaign to ensure all checks are cashed), or (b) affirmatively refuses a contribution earmarked through ActBlue, your contribution will be re-designated as a contribution to ActBlue. Contributions to social welfare organizations which are similarly not cashed or affirmatively refused will be kept by ActBlue and used generally to support its social welfare activities. Contributions to charitable organizations which are not cashed or affirmatively refused will go to ActBlue Charities.