Displaying 20 results from an estimated 1000 matches similar to: "Mutate issue help needed"
2024 Dec 17
1
Mutate issue help needed
Hi all,
It has been a year or so since I have run this code to plot temporal 
activity.
It was working now I am getting an error related to MUTATE.
Error in UseMethod("mutate") :
 ? no applicable method for 'mutate' applied to an object of class 
"character"
Any help/suggestions welcomed.
Tnx to all the R code gurus out there.
R v 4.4.0
Bat Dude
The saved code I
2024 Dec 17
1
Mutate issue help needed
Posting Error. OP sent HTML email which by default  includes a backup text version with "helpful" marks where formatting was in the original, and the mailing list deleted the HTML (per policy stated in the posting guide linked at the bottom of every email) which effectively leaves the mailing list recipients guessing as to what was originally sent.
Correct configuration of OPs email
2024 Dec 17
1
Mutate issue help needed
I did a quick clean-up and deleted a couple of , I hope, library calls and
I think the OP's code should look like this
==========================================
# Load packages & set ggplot theme ----------------------------------------
library(tidyverse)
theme_set(theme_bw())
# Select dataset and assign name to "All" ???
-----------------------------------
fname <-
2024 Dec 17
2
Mutate issue help needed
Hi all,
Tnx for the varied suggestions.? I tried the "cleaned up code" John 
suggested with the same Mutate error message
No clue why an asterisk * was added to the message lines that were only 
# comments.
Eons ago Hadley helped with the code with early versions of the original 
GGPLOT and it has been modified a bit to reflect current packages and 
worked when pasted into the R 4.4.0
2024 Dec 17
1
Mutate issue help needed
Am I being "thick" here
..
mutate(data, *# text
Is interpretated as mutate (data, *
The star is the character...
(Data is the line above being piped)
Why have the comments been *'d?. Is that the source error or a posting
error here?
On Tue, 17 Dec 2024, 14:57 Ivan Krylov via R-help, <r-help at r-project.org>
wrote:
> ? Tue, 17 Dec 2024 06:44:50 -0700
> Neotropical
2014 Nov 10
2
range () does not remove NA's with complete.cases() for dates (dplyr/mutate)
Hello,
The range() with complete.cases() removes NA's for the date variables that are read from a data frame.  However, the issue is that the same function does not remove NA's for the other date variable that is created using the dplyr/mutate().  The console and the reproducible example are given below. Any advice how to resolve this issue would be appreciated.
Thanks,
Pradip Muhuri
2014 Nov 09
4
Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)
Hello,
The example data frame in the reproducible code below has 5 columns (1 column for id and 4 columns for dates), and there are 7 observations.  I would like to insert the most recent date from those 4 date columns into a new column (oiddate) using the mutate() function in the dplyr package.   I am getting correct results (NA in the new column) if a given row has all NA's in the four
2024 Oct 18
1
DPLYR Multiple Mutate Statements On Same DataFrame
?s 22:50 de 17/10/2024, Sparks, John escreveu:
> Hi R Helpers,
> 
> I have been looking for an example of how to execute different dplyr mutate statements on the same dataframe in a single step.  I show how to do what I want to do by going from df0 to df1 to df2 to df3 by applying a mutate statement to each dataframe in sequence, but I would like to know if there is a way to execute this
2024 Dec 17
2
Mutate issue help needed
? Tue, 17 Dec 2024 06:44:50 -0700
Neotropical bat risk assessments <neotropical.bats at gmail.com> ?????:
> fname <- "Buzz.txt"
 
> All<- fname
I think the code needs a call to read.table() or another function to
read your data here. 'All' is still a string containing the name of the
file, not its contents.
> All %>%
> mutate(*#convert Date from chr
2018 Feb 22
0
alternative for multiple if_else statements
Hi Kevin,
I ran the code on the full data set and was able to reproduce the problem
that you are facing.
My guess is that you have an error in your intuition and/or logic, and that
this relates to the use of the subscript [1].
Specifically, on the full dataset, the condition
trialData$date[trialData$survey_start == "Y" & trialData$year == 2013 &
trialData$site ==
2018 Feb 22
0
alternative for multiple if_else statements
I don't fully understand the logic you are trying to implement, but
something along the lines of
foo <- cut(trialData$date,
           breaks = as.Date(c("2007-01-01",
                              "2008-05-01",
                              "2009-04-01",
                              "2010-05-01",
                             
2018 Feb 26
0
alternative for multiple if_else statements
That many ifelse statements is obviously rather a pain.
Would you not have got what you want with 
... paste("survey", year, sep="_") 
?
If that is not what you're looking for (eg because 'year' is the observation year and not the study start year), perhaps something that picks the minimum year for a subject or other relevant group might work? For example
2024 Oct 17
2
DPLYR Multiple Mutate Statements On Same DataFrame
Hi R Helpers,
I have been looking for an example of how to execute different dplyr mutate statements on the same dataframe in a single step.  I show how to do what I want to do by going from df0 to df1 to df2 to df3 by applying a mutate statement to each dataframe in sequence, but I would like to know if there is a way to execute this in a single step; so simply go from df0 to df1 while executing
2018 Feb 21
7
alternative for multiple if_else statements
Hi, I am having trouble trying to figure out why if_else is behaving the way it is, it may be my code or the way the data is structured.
Below is a snapshot of a database am working on and it represents a longitudinal survey of study participants in a trial with weekly follow up.
The variable "survey_start" represents the start of the study-defined one year follow up (which we called
2017 Sep 08
0
need help for finding related sales with R
Hello everyone. Could you please help me? I need to do some sales analysis
and i'm stuk.
I've got a dataset that contains next information:
Sales_department; sales_manager; Client; transaction ID; Product (SKU),
 Cost, Gross income, Profitability
Ineed to perfom an ABC analysis (by the Cost of sold products to this
client) to find the A clients of each manager, i'm doing it this
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
I have a model layer containing Movie, Person, Role, and RoleType, 
making it possible to express facts such as "Clint Easterbunny is 
director of the movie Gran Milano".
The relevant model and associations look like this
class Movie < ActiveRecord::Base
  has_many :roles, :include => :role_type, :dependent => :destroy
  has_many :participants, :through => :roles, :source
2011 Jul 10
2
grey colored lines and overwriting labels i qqplot2
I created this graph in ggplot and added ablines to the different facets by
specifying with subset commands.  As you might see, there are still a few
issues.
1.)	I would like to have the diamonds in a grey scale instead of colors. I
accomplished this (see graph 2) until I overwrote the label title for the
treatments and the colors came back (graph 1). I used these two commands:
p=ggplot(data =
2016 Aug 12
2
ifelse() woes ... can we agree on a ifelse2() ?
Excuse for the delay;  I had waited for other / additional
comments and reactions (and been distracted with other urgent issues),
but do want to keep this thread alive  [inline] ..
>>>>> Duncan Murdoch <murdoch.duncan at gmail.com>
>>>>>     on Sat, 6 Aug 2016 11:30:08 -0400 writes:
    > On 06/08/2016 10:18 AM, Martin Maechler wrote:
    >> Dear
2016 Aug 15
2
ifelse() woes ... can we agree on a ifelse2() ?
On Fri, Aug 12, 2016 at 11:31 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
>>     >> One possibility would also be to consider  a "numbers-only" or
>>     >> rather "same type"-only {e.g., would also work for characters}
>>     >> version.
>>
>>     > I don't know what you mean by these.
>>
>> In the
2016 Aug 12
0
ifelse() woes ... can we agree on a ifelse2() ?
>     >> One possibility would also be to consider  a "numbers-only" or
>     >> rather "same type"-only {e.g., would also work for characters}
>     >> version.
>
>     > I don't know what you mean by these.
>
> In the mean time, Bob Rudis mentioned   dplyr::if_else(),
> which is very relevant, thank you Bob!
>
> As I have