Swapping the colour scheme for negatively phrased likert questions

I’m creating graphs for responses to survey questions which have a 5 point likert style scale of ‘very true’ to ‘not true at all’. The survey is administered before and after taking part in an activity. Some of the questions are asked positively (ie, a move towards ‘very true’ would be considered an improvement) and some are phrased negatively (ie, a move towards ‘not true at all’) would be an improvement.

I’ve created graphs using the likert function in the HH package. What I would like to do is flip the colour scale for the negatively phrased questions to make it more visually intuitive to see where improvements have taken place (ie, so that a shift towards pink is always positive, regardless of whether thats towards ‘very true’ or ‘not true at all’).

Is there an easy way to do this?

So this is the sort of thing I have:

##Packages 

library (HH)

# Data

section_1 <- data.frame(
                        question = c("I know when I have understood a new concept or idea","After I finish a test, I can't tell whether I have done well or not until I get the results","I know when I have understood a new concept or idea","After I finish a test, I can't tell whether I have done well or not until I get the results"), 
                        pre_post=c("PRE","PRE","POST","POST"), 
                        "Very true"=c(4,9,15,4), 
                        "Mostly true"=c(5,6,8,3), 
                        "A little bit true"=c(5,12,4,8), 
                        "Not really true"=c(7,6,3,11), 
                        "Not true at all"=c(5,9,17,4))

# creating the graph

fig1 <- likert(pre_post~.| question,
               data =  section_1, 
               as.percent = TRUE, 
               ReferenceZero = 3,
               ylab = "Question", 
               xlim=c(-100, 100), 
               main = list("Knowledge of Cognition", x=unit(.55, "npc")), 
               col= c("#E6007E","#F380BF" ,"#DDDFE4" , "#80CFF1", "#009FE3"),
               strip=strip.custom(factor.levels=c("I know when I have understood na new concept or idea", "After I finish a test, I ncan't tell whether I have ndone well or not until I get nthe results")),
               par.strip.text=list(cex=0.6, lines=5),
)

So I would want to flip the order of the colours of the second one (‘After I have finished a test, I can’t tell whether I have done well or not until I get the results’) compared to the first one (‘I know when I have understood a new concept or idea’).

If I just add colours in a list to the ‘col’ argument, it just adds more colours to the legend.

Does anyone have any ideas? If its not possible here, would it be possible by making a similar graph in, for example, ggplot2? I’ve been trying to make it work to avoid starting from scratch but I will if I need to.

PS I’m largely self taught with R and learning mostly from trial and error, and I often find myself struggling to fully understand answers to questions on here, so I would really appreciate it if you could try to explain anything as clearly as possible! Thanks in advance !

New contributor

Sophie Elizabeth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật