I am trying to create 120 questions that have the same text and options (multiple choice) but with different images below in Qualtrics. Any idea on how to do it without manually creating 120 blocks?
Use a Loop & Merge block and pipe in the image url as a loop & merge field.
Related
I have 23 data frames listed as followed sorted into 3 seperate lists link to project https://posit.cloud/content/4971864
final_dfs_2015= list(July_2015F,August_2015F, Sept_2015F,Oct_2015F,Dec_2015f)
final_dfs_2016= list(Jan_2016f, Feb_2016F, March_2016f,April_2016f,May_2016f,June_2016f,July_2016f,Aug_2016f, Sept_2016f, Oct_2016f, Nov_2016f, Dec_2016f)
final_dfs_2017= list(Jan_2017f, Feb_2017f,March_2017f,Apri_2017f,May_2017f,June_2017f)
id also like to add the file name as the name of each graph if possible
I am using
barplot(height=Sept_2015F$Frequency,
names=Sept_2015F$arrival_date_day_of_month, col="#69b3a2")
to create plots however something i want to learn is how would i combine the lists if possible with the barplot and some form of exporting to mass export plots all at once
all dataframes have the same 2 columns "arrival_date_day_of_month, frequency"
Im not sure what kind of export to use and how to combine all the things i want to do at once with the data if anyone has any sources on that overall idea id love to read on them.
I have a dataset that I'd like to export to multiple Excel workbooks with conditional formatting. I can't post the actual data, but a sample is below. Essentially, I've got a dataset showing whether or an individual qualifies for a survey, what department and team within the department they are in:
Survey Status
Department
Team
1
Budget Off
Acts
0
Budget Off
Acts
1
Sales
Local
1
Public Rel
Social
I want to do the following:
Conditionally format the data so that rows with a survey status of 1 are in bold, black text and rows with a survey status of 0 are in non-bold, red text for easier reading.
Maintain this formatting when exporting to Excel.
Creating an individual workbook for each Department/Team grouping.
I can format the data how I'd like within R, and I can create an individual workbook for each Department/Team grouping without a problem.
The issue is that the formatting gets lost. I've tried a few different packages, including xlsx, openxlsx, formattable, and condformat, but can't seem to bridge the gap so that the formatting is applied within the Excel files.
I was previously able to do this is SAS with no problems. We're transitioning to R, which is why I'm recreating these documents. However, I'm wondering if R is the best choice for this procedure. Perhaps Python would be better?
Thanks in advance for all your help. The SO community is my lifeline in learning to code, and has been an invaluable resource.
Finally discovered the problem with the help of YouTuber CradleToGraveR. User error! It was in the formula for the "rule" within conditionalFormatting()
I had been using the formatting examples in the documentation for openxlsx (e.g., rule = "$colname=1", but applying it to a string (e.g., rule = "$colname=YES"), which is why Excel didn't recognize it.
When conditionally formatting strings, use single quotes around the rule with double quotes around the value (e.g., rule = '$colname="YES"').
CradleToGraveR shows how to format for text values in this video, https://www.youtube.com/watch?v=ACdCQuQJxhU
So generally what I would like to do is to load a sheet with 4 different tables, and split this one big data into smaller tables using str_detect() to detect one fully blank row that's deviding those tables. After that I want to plug that information into the startRow, startCol, endRow, endCol.
I have tried using this function as followed :
str_detect(my_data, ‘’) but the my_data format is wrong. I’m not sure what step shall I make do prevent this and make it work.
I’m using read_xlsx() to read my dataset
I'd like to hear how one could bypass the default View() options. In my computer it only shows up to 100 columns. I'd like it to about 400 columns. It's possible?
Meanwhile, you can use the utils::View() to view more columns of the data. This isn't quite as useful or pretty as the RStudio Viewer but it does a decent job on tables with more than 100 columns.
The other option that I occasionally use is View(df[,101:200]) etc. to view different columns of the data--sometimes this can be combined with some columns at the beginning so that I can see the necessary key data.
So I'm trying to manipulate a simple Qualtrics CSV, and I want to use colSums on certain columns of data, given a certain filter.
For example: within the .csv file called data, I want to get the sum of a few columns, and print them with certain labels (say choice1, choice2 etc). That is easy enough by itself:
firstqn<-data.frame(choice1=data$Q7_2,choice2=data$Q7_3,choice3=data$Q7_4);
secondqn<-data.frame(choice1=data$Q8_6,choice2=data$Q8_7,choice3=data$Q8_8)
print colSums(firstqn); print colSums(secondqn)
The problem comes when I want to repeat the above steps with different filters, - say, only the rows where gender==2.
The only way I know how is to create a new dataset data2 and replace data$ with data2$ in every line of the above code, such as:
data2<-(data[data$Q2==2,])
firstqn<-data.frame(choice1=data2$Q7_2,choice2=data2$Q7_3,choice3=data2$Q7_4);
however i have 6 choices for each of 5 questions and am planning to apply about 5-10 different filters, and I don't relish the thought of copy/pasting data2 and `data3' etc hundreds of times.
So my question is: Is there any way of getting R to reference data by default without using data$ in front of every variable name?
I can probably use attach() to achieve this, but i really don't want to:
data2<-(data[data$Q2==2,])
attach(data2)
firstqn<-data.frame(choice1=Q7_2,choice2=Q7_3,choice3=Q7_4);
detach(data2)
is there a command like attach() that would allow me to avoid using data$ in front of every variable, for a specified amount of code? Then whenever I wanted to create a new filter, I could just copy/paste the same code and change the first command (defining a new dataset).
I guess I'm looking for some command like with(data2, *insert multiple commands here*)
Alternatively, if anyone has a better way to do the above in an entirely different way please enlighten me - i'm not very proficient at R (yet).