Copy values from a column across rows - copy

I have a dataset like this:enter image description here
I want to repeat the Norte and Nordeste values in the lines below in R.
I tried the fill function, but it is informed that only for numeric

I'm importing the data through read.table and I included na.strings = "NA", but when displaying the data, Rstudio does not detect missing and for this reason the fill command does not work. When testing including "NA", it worked perfectly.
What can it be ?enter image description here

Related

Anylogic Parameter Variation Experiment output to Excel

I'm trying to use parameter variation experiment of Anylogic and export the result "loss" of each run to the corresponding position in the Excel table. However, only a few of the results are successfully exported to the table. The related code and result are shown below.
enter image description hereenter image description hereenter image description here
I am looking for where it went wrong. Thanks!
You did not share the code that is writing the results to Excel which might be the reason for the problem. However, another possibility is that you have to turn off allowing parallel evaluations under Advanced.

PyQGIS: change expression for datadefined symbology

I have a QGIS project that displays calculation results on a map. There are several vector layers, each with >100 calculated fields. The way the data should be visualised is very similar for all these layers/fields. I try to write a script that duplicates a template layer, and changes the expressions for the symbology according to the selected fieldname.
Below is a screenshot of the properties I try to access (if I were to change them using the UI).
How do I access/change the expressions of the line width and line offset of a graduated symbology in PyQGIS?
In case someone else runs into this issue.
I solved it using a workaround. I saved the style of the source layer to a qml-file, for the duplicated layers I create a temporary copy of the qml-file, do a search-and-replace on the qml-file and apply this to the new layer using
newLayer.loadNamedStyle(pathToTheTempQmlFile)
Hope this helps:
rule=layer.renderer().rootRule().children()[0]
rule.setFilterExpression('whatever')
see:
QgsRuleBasedRenderer.Rule

Orange Data Mining: Change data type (e.g from continuous to discrete)

I have loaded data in Orange using a CSV file, and some columns are being automatically detected as continuous (C) while in reality they're ordinal dicrete (i.e. may have integer values from 1 to 5).
I was expecting widgets such as the "Edit Domain Data" to let me change these meta attributes, but I couldn't figure it out. The only workaround I've managed so far was to save the CSV as a TAB file and add the meta attributes myself.
Am I missing something very silly? :)

Have a list of strings I want to populate a gui with

Basically I have an excel file, and I read into one of my matlab variables a set of strings which are the headers for the columns of the data. Since this excel file is huge and I want to have the option to select which data to analyze at a given time I am hoping to take those strings/headers and have them appear on my gui with some check boxes buttons next to them so that I can pick which ones to work on ( i need the ability to select multiple data columns). This number of headers can change from file to file, so the number of list items and checkboxes will have to change on the gui based on the data file. Any ideas how to accomplish this? I can fill my gui with a bunch of text boxes and radio buttons but then i might end up with some that are empty, or end up with some that are to few, since the data file can have anywhere from 1-50 data columns each with their own header
Alternatively if anyone knows of a better way to have my user choose what data columns to act upon other than a ton of checkboxes, i'd be happy to hear it! This seemed like the most direct approach.
I tried what was suggested and get:
The code looks like:
[Data,Text] = xlsread('C:\data.csv');
a = Text(:,1);
b = strmatch('Channel Description',a);
Channels = Text(b,:);
[vals{1:numel(Channels,1)}]=deal(false);
foo= uitable('Data',vals,'ColumnEdit', true, 'RowName',Channels);
Here is an example using uitable, similar to excaza's comment but using the excel column headers as row names in the table:
[~,s,~] = xlsread('excelFile.xlsx', 1, 'A1:ZZ1');
[vals{1:numel(s),1}] = deal(false);
foo = uitable('Data', vals, 'ColumnEdit', true, 'RowName', s);
colsToLoad = foo.Data;
You will then need to either read the entire table and select columns in MATLAB using colsToLoad or loop over colsToLoad and read each column separately as xlsread does not support non-contiguous ranges.
[Data,Text] = xlsread('excelFile.xlsx');
dataToProcess = Data(:,[foo.Data{:}]);

Prestashop Import multiple images for combinations via CSV import

In PrestaShop 1.5.4 while importing combinations by default we can't import multiple images via CSV. It only takes one image and if we add more than one image links in the csv import file and upload it then all product images shows as blank. I've already tried the image position and that seems to be working the same way as we can define only one image position.
Is there any way or anyone used any other method may be editing code by which they have been succeeded importing multiple images ? Please do share with me. Thanks in advance.
Images;
http://www.domin.com/image/abc.png,http://www.domin.com/image/xyz.png
Use comma for multiple file seperation, Like wise upload the files and select the attribute value as Image URLs...
It it is the last column don't use ";" it not use ";" .