CRAN
matconv 0.4.0
A Code Converter from the Matlab/Octave Language to R
Released Jan 7, 2019 by Siddarta Jairam
Transferring over a code base from Matlab to R is often a repetitive and inefficient use of time. This package provides a translator for Matlab / Octave code into R code. It does some syntax changes, but most of the heavy lifting is in the function changes since the languages are so similar. Options for different data structures and the functions that can be changed are given. The Matlab code should be mostly in adherence to the standard style guide but some effort has been made to accommodate different number of spaces and other small syntax issues. This will not make the code more R friendly and may not even run afterwards. However, the rudimentary syntax, base function and data structure conversion is done quickly so that the maintainer can focus on changes to the design structure.
Installation
Maven
This package can be included as a dependency from a Java or Scala project by including
the following your project's pom.xml
file.
Read more
about embedding Renjin in JVM-based projects.
<dependencies> <dependency> <groupId>org.renjin.cran</groupId> <artifactId>matconv</artifactId> <version>0.4.0-b1</version> </dependency> </dependencies> <repositories> <repository> <id>bedatadriven</id> <name>bedatadriven public repo</name> <url>https://nexus.bedatadriven.com/content/groups/public/</url> </repository> </repositories>
Renjin CLI
If you're using Renjin from the command line, you load this library by invoking:
library('org.renjin.cran:matconv')
Test Results
This package was last tested against Renjin 0.9.2719 on Jan 9, 2019.
- Data_Conversion.Can_turn_into_matrix:_Digits_E1
- Data_Conversion.Can_turn_into_matrix:_Digits_E2
- Data_Conversion.Can_turn_into_matrix:_Digits_E3
- Data_Conversion.Can_turn_into_matrix:_Numerics_E1
- Data_Conversion.Can_turn_into_matrix:_Numerics_E2
- Data_Conversion.Can_turn_into_matrix:_Numerics_E3
- Data_Conversion.Convert_string_data
- Data_Conversion.Convert_string_data_with_escaped_quotes
- Data_Conversion.Data_maps_doesn't_pick_up_non-instantiations
- Data_Conversion.Does_not_convert_data_as_a_string_concat
- Data_Conversion.Does_not_convert_string_cat_as_matrix
- Data_Conversion.Integration:_data_maps
- Data_Conversion.Missing_numbers_can_be_inputted_as_data
- Data_Conversion.R_lists_can_be_selected
- Easy_syntax.End_to_get_the_last_element_gets_replaced
- Easy_syntax.End_within_slicing_gets_replaced_E1
- Easy_syntax.End_within_slicing_gets_replaced_E2
- Easy_syntax.dot_syntax_gets_replaced
- Easy_syntax.regular_dots_don't_get_replaced
- Flag_usage.Dictionary_switcher_works_E1
- Flag_usage.Dictionary_switcher_works_E2
- Flag_usage.Dictionary_switcher_works_E3
- Flag_usage.Dictionary_switcher_works_E4
- Flag_usage.Dictionary_switcher_works_E5
- Flag_usage.length_out_switch_works_E1
- Flag_usage.length_out_switch_works_E2
- Function_Maps.Basic_argument_switching
- Function_Maps.Can_convert_functions_with_groups_for_variables
- Function_Maps.Can_convert_functions_with_strings_in_it
- Function_Maps.Can_convert_functions_within_the_line
- Function_Maps.Can_parse_using_space_separated_args
- Function_Maps.Can_understand_lines_with_a_mixture_of_unsanitary_conditions
- Function_Maps.Can_understand_lines_with_data_in_the_arguments
- Function_Maps.Can_understand_lines_with_groups_in_the_arguments
- Function_Maps.Can_understand_lines_with_strings_in_the_arguments
- Function_Maps.Flag_switching_integrates
- Function_Maps.Literal_arg_inserts
- Function_Maps.Literal_numbers_in_output
- Function_Maps.Multiple_outputs_work
- Slicing_Data.Can_slice_with_Structures
- Slicing_Data.Can_slice_with_mult_instance
- Slicing_Data.Can_slice_with_mult_struct_instances
- Slicing_Data.Can_slice_with_one_instance
- Slicing_Data.Doesn't_pick_up_cases_in_strings
- Slicing_Data.Dont_convert_floating_point_numbers
- Slicing_Data.Negative_case_doesn't_do_anything
- makeDataMap-examples
- makeFuncMaps-examples
- makeSliceMap-examples
- mat2r-examples
- testthat