We created an exam with a total of 29 points. However, we would like to present to students the HTML using a 0 to 20 scale (Points row of the HTML; with the nops_eval function):
The corresponding points of each exercise (summing a total of 29) should continue appearing in the Evaluation grid, e.g.:
Keeping the points and evaluation for the exercises as it was and just changing the scaling of the sum of the points is not possible. If you want to do so for the HTML reports, I guess it is easiest to read the individual .html files into R, replace the points with what you want to put there. readLines(), gsub(), and writeLines() should be useful here.
However, what is possible, is to change the points associated with each exercise in the entire evaluation. To do so you can use
nops_eval(..., points = ...)
where points must be a vector of the same length as the number of exercises (22 in your case). This overrules the number of points that was previously set within the exercises (via expoints) or in exams2nops(..., points = ...).
Related
I want to perform a binomial GLM with my data, which is based on the proportions of land use type per used or unused cell on a map. With used being: where an owl was heard an unused being: where no owl was heard. I know have two polygon layers, one containing all the used areas and their land type and one containing all the unused areas and their land types.
I am unsure how to perform this analysis in R. I probably first need to put a grid over the layers, to divide the maps in cells that are either used or unused. Then I need to calculate the proportion of land use type per grid cell.
Are there any packages I could use for this? How would you go about this?
I'm busy trying to plot the number of children (turtle breed 1) treated by an organisation (turtle breed 2). The organisations have a turtles-own variable called children-treated where all the children are stored which are being treated.
In the 'plot update commands' I now have:
ask organizations [
create-temporary-plot-pen (word who)
set-plot-pen-color color
plot [length children-treated]
]
However, an error message says
Expected a number here, rather than a list or block
It is not clear to me to which place this error applies.
It is necessary to make this automatic, and not manually the different plot pens, as the number of organisations can be adjusted by a slider.
This is how I want the plot to look like:
As you can see here, the syntax for plot is plot number, without square brackets (that in NetLogo identify a list or a block of commands). Your length children-treated is a number (so I understand that children-treated is a list), so you don't need to enclose it in square brackets:
plot length children-treated
At most you can use parentheses for the purpose of readability:
plot (length children-treated)
I am attempting to generate heatmaps from a data file I've been generating. I could re-format the data however I like, but for the time being, let's say it's a list of 16 numbers that I'd like put into a 4x4 heatmap. However, I have many sets of these 16 numbers sequentially in the same file, and hope to eventually animate them together (something I am more comfortable with, and will come later)
However, for the time being, I cannot find a way to get GnuPlot to select only certain sections of the data file while still plotting properly. A loose example of what I would've thought it WOULD look like:
plot "SortedData.txt" every ::0::15 w image
or:
splot "SortedData.txt" every ::0::15
Both give me errors and fail to render. I could label the data values with an x-y coordinate if needed, but the task is fairly repetitive: I just want the first 16 points mapped, and then the ability to iterate once and have the next 16 points mapped on their own, etc. Stripping the data file to just the first 16 points and removing the 'every' command confirms that it can plot, but trying to specify even just the first 16 manually messes it up.
Can anyone point me in the right direction? The "every" command has been fairly nebulous and seems largely incompatible with images / 3-D data. Also, I am running on Windows, so piping in linux commands is something I'd like to avoid.
Thanks!
edit: Here is 4 example frames of the data. Reformatting it to, say, present as a matrix or label with pixel addresses are all something I can do if needed.
0.000000 -49.314654 -44.425234 -46.613870 -48.494232 -46.884806 -46.553071 -46.555624 -43.755972 -47.817691 -42.481637 -46.819782 -44.347586 -49.487077 -47.291832 -45.140636 -47.945934
0.839906 -49.325396 -44.425493 -46.613214 -48.501283 -46.887236 -46.550858 -46.555285 -43.752786 -47.814706 -42.453793 -46.814333 -44.329492 -49.493501 -47.289394 -45.133555 -47.944045
1.679721 -49.336151 -44.425787 -46.612573 -48.508348 -46.889684 -46.548645 -46.554958 -43.749626 -47.811707 -42.425757 -46.808866 -44.311344 -49.499930 -47.286951 -45.126476 -47.942155
2.519466 -49.346920 -44.426117 -46.611946 -48.515427 -46.892152 -46.546431 -46.554641 -43.746492 -47.808695 -42.397525 -46.803382 -44.293140 -49.506365 -47.284501 -45.119398 -47.940264
It seems that each line in your data file has 17 elements. I assume that the first column is not part of your image data. I would format the remaining 16 values as a 4x4 matrix, with each frame separated by two blank lines:
-49.314654 -44.425234 -46.613870 -48.494232
-46.884806 -46.553071 -46.555624 -43.755972
-47.817691 -42.481637 -46.819782 -44.347586
-49.487077 -47.291832 -45.140636 -47.945934
-49.325396 -44.425493 -46.613214 -48.501283
-46.887236 -46.550858 -46.555285 -43.752786
-47.814706 -42.453793 -46.814333 -44.329492
-49.493501 -47.289394 -45.133555 -47.944045
-49.336151 -44.425787 -46.612573 -48.508348
-46.889684 -46.548645 -46.554958 -43.749626
-47.811707 -42.425757 -46.808866 -44.311344
-49.499930 -47.286951 -45.126476 -47.942155
-49.346920 -44.426117 -46.611946 -48.515427
-46.892152 -46.546431 -46.554641 -43.746492
-47.808695 -42.397525 -46.803382 -44.293140
-49.506365 -47.284501 -45.119398 -47.940264
You can then visualize each frame with the command
plot "data.dat" index FRAME matrix w image
where FRAME is 0, 1, 2 or 3.
I wish to visualise changes in relative rankings between categories through time, much like this so-called 'subway-style' plot. However, not all categories are present in all time steps.
I have made a preliminary plot (see attached) that is sufficient to interpret the data (one simply needs to look at the crossing lines). However, because not every category is represented in every time slice, lines may traverse the y-axis without any change in rank, which is visually confusing:
Do algorithms exist for minimising the kinks in static ranks when missing data is present? To put it another way, my goal is to maintain straight lines wherever possible (when there is no change in relative rank).
I have different time-series corresponding to different individuals and their location within a building (a categorical variable -- more like a room name).
I would like to study the similarity in movement of different individuals by something like cross-recurrence plots, where the two time-series correspond to the two axes and the actual points correspond to the presence/absence of individuals in the same room.
Has anyone tried doing such plots in R or while using ggplot? Any help would be great!
I haven't used this routine. I used only d2 dimension and Lyapunov exponent for EEG but this package Tisean (RTisean for your case) has a routine ['recurr'] that returns the specific plot.
This link has a nice wrap up of tutorials and links
Edited:
In this link you can find a nice example of application of recurrence plot.
The return variables of function recur(and similar functions of other packages) you can access after putting $ after the dataset (like database)
and you can access them inside in ggplot function and applying the appropriate aes.