@@ -60,11 +60,11 @@ import kotlin.reflect.typeOf
60
60
* Converts the values in the specified [columns\] to a target type
61
61
* or using a custom converter, keeping their original names and positions within the [DataFrame].
62
62
*
63
- * This function does not immediately convert the columns but instead select columns to convert and
63
+ * This function does not immediately convert the columns but instead selects columns to convert and
64
64
* returns a [Convert],
65
65
* which serves as an intermediate step.
66
66
* The [Convert] object allows you to specify how the selected
67
- * columns will be converted using methods such as
67
+ * columns will be converted using following methods:
68
68
* [to][Convert.to],
69
69
* [with][Convert.with],
70
70
* [asFrame][Convert.asFrame],
@@ -201,7 +201,7 @@ private interface CommonConvertDocs
201
201
* ```kotlin
202
202
* df.convert { columnA and columnB }.with { it.toString().lowercase() }
203
203
* df.convert { colsOf<String>() }.to<Double>()
204
- * df.convert { colsAtAnyDepth().colGroups() }.asFrame { it.add("nan") { Double.NaN } }
204
+ * df.convert { colsAtAnyDepth().colGroups() }.asFrame { it.add("nan") { Double.NaN } }
205
205
* ```
206
206
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to group.
207
207
*/
@@ -284,7 +284,7 @@ public inline fun <T, C, reified R> Convert<T, C?>.notNull(
284
284
/* *
285
285
* An intermediate class used in the [convert] operation.
286
286
*
287
- * This class itself does not perform any conversion— it is a transitional step
287
+ * This class itself does not perform any conversion — it is a transitional step
288
288
* before specifying how to convert the selected columns.
289
289
* It must be followed by one of the conversion methods
290
290
* to produce a new [DataFrame] with updated column values and types.
@@ -371,10 +371,14 @@ public fun <T> Convert<T, *>.to(type: KType): DataFrame<T> = to { it.convertTo(t
371
371
* Converts values in the columns previously selected with [convert]
372
372
* using [columnConverter] expression within the [DataFrame].
373
373
*
374
- * [columnConverter] provides original `DataFrame` as a receiver.
374
+ * The [columnConverter] is a lambda with the current [DataFrame] as receiver and the selected column as argument.
375
+ * It returns a new [DataColumn] (or [ColumnGroup]) that will replace the original column.
375
376
*
376
377
* For more information: {@include [DocumentationUrls.Convert]}
377
378
*
379
+ * ## See Also
380
+ * - {@include [SeeAlsoConvertWith]}
381
+ *
378
382
* ### Examples:
379
383
* ```kotlin
380
384
* // Select `Int` columns ("valueA", "valueB") and multiply them with `Double` column ("coeff").
@@ -392,17 +396,24 @@ public fun <T, C> Convert<T, C>.to(columnConverter: DataFrame<T>.(DataColumn<C>)
392
396
@ExcludeFromSources
393
397
private interface SeeAlsoConvertPerRowCol
394
398
399
+ /* * [Convert with][Convert.to] to convert using a column converter */
400
+ @ExcludeFromSources
401
+ private interface SeeAlsoConvertTo
402
+
395
403
/* *
396
404
* Converts values in the columns previously selected with [convert]
397
405
* using [row value][RowValueExpression] [expression] within the [DataFrame].
398
406
*
399
407
* A [row value expression][RowValueExpression] allows to provide a new value for every selected cell
400
408
* given its row (as a receiver) and its previous value (as a lambda argument).
409
+ *
410
+ * For more information: {@include [DocumentationUrls.Convert]}
401
411
*
402
412
* ## Note
403
413
* @include [ExpressionsGivenRow.AddDataRowNote]
404
414
* ## See Also
405
415
* - {@include [SeeAlsoConvertPerRowCol]}
416
+ * - {@include [SeeAlsoConvertTo]}
406
417
*
407
418
* ### Examples:
408
419
* ```kotlin
@@ -427,11 +438,13 @@ public inline fun <T, C, reified R> Convert<T, C>.with(
427
438
/* *
428
439
* Converts [column groups][ColumnGroup] previously selected with [convert]
429
440
* as a [DataFrame] using a [dataframe expression][DataFrameExpression].
441
+ *
442
+ * For more information: {@include [DocumentationUrls.Convert]}
430
443
*
431
444
* ### Example:
432
445
* ```kotlin
433
446
* // Add a column to selected column group "name".
434
- * df.convert { name }.asFrame { it.add("fullName") { "$firstName $lastName" } }
447
+ * df.convert { name }.asFrame { it.add("fullName") { "\ $firstName \ $lastName" } }
435
448
* ```
436
449
*
437
450
* @param [expression] The {@include [ExpressionsGivenDataFrame.DataFrameExpressionLink]} to replace the selected column group with.
@@ -450,10 +463,13 @@ private interface SeeAlsoConvertWith
450
463
* using [row column][RowColumnExpression] [expression] within the [DataFrame].
451
464
*
452
465
* A [row column expression][RowColumnExpression] allows to provide a new value for every selected cell
453
- * given its row and column (as a lambda arguments).
466
+ * given its row and column (as lambda arguments).
467
+ *
468
+ * For more information: {@include [DocumentationUrls.Convert]}
454
469
*
455
470
* ## See Also
456
471
* - {@include [SeeAlsoConvertWith]}
472
+ * - {@include [SeeAlsoConvertTo]}
457
473
*
458
474
* ### Example:
459
475
* ```kotlin
@@ -788,7 +804,7 @@ public fun <T : Any> DataColumn<T?>.convertToBoolean(): DataColumn<Boolean?> = c
788
804
// region convert URL
789
805
790
806
/* *
791
- * Converts values in the [URL] columns previously selected with [convert] to the [IFRAME],
807
+ * Converts values in an [URL] columns previously selected with [convert] to an [IFRAME],
792
808
* preserving their original names and positions within the [DataFrame].
793
809
* Preserves null values.
794
810
*
@@ -802,7 +818,7 @@ public fun <T : Any> DataColumn<T?>.convertToBoolean(): DataColumn<Boolean?> = c
802
818
* @param border Whether the iframe should have a border. Defaults to `false`.
803
819
* @param width Optional width of the iframe in pixels.
804
820
* @param height Optional height of the iframe in pixels.
805
- * @return A new [DataFrame] with the values converted to [IFRAME].
821
+ * @return A new [DataFrame] with the values converted to an [IFRAME].
806
822
*/
807
823
@JvmName(" toIframeFromUrlNullable" )
808
824
@Refine
@@ -815,7 +831,7 @@ public fun <T> Convert<T, URL?>.toIFrame(
815
831
): DataFrame <T > = to { it.map { url -> url?.let { IFRAME (url.toString(), border, width, height) } } }
816
832
817
833
/* *
818
- * Converts values in the [URL] columns previously selected with [convert] to the [IFRAME],
834
+ * Converts values in an [URL] columns previously selected with [convert] to an [IFRAME],
819
835
* preserving their original names and positions within the [DataFrame].
820
836
*
821
837
* For more information: {@include [DocumentationUrls.Convert]}
@@ -828,7 +844,7 @@ public fun <T> Convert<T, URL?>.toIFrame(
828
844
* @param border Whether the iframe should have a border. Defaults to `false`.
829
845
* @param width Optional width of the iframe in pixels.
830
846
* @param height Optional height of the iframe in pixels.
831
- * @return A new [DataFrame] with the values converted to [IFRAME].
847
+ * @return A new [DataFrame] with the values converted to an [IFRAME].
832
848
*/
833
849
@JvmName(" toIframeFromUrl" )
834
850
@Refine
@@ -841,7 +857,7 @@ public fun <T> Convert<T, URL>.toIFrame(
841
857
): DataFrame <T > = to { it.map { IFRAME (it.toString(), border, width, height) } }
842
858
843
859
/* *
844
- * Converts values in the [URL] columns previously selected with [convert] to the [IMG],
860
+ * Converts values in an [URL] columns previously selected with [convert] to an [IMG],
845
861
* preserving their original names and positions within the [DataFrame].
846
862
* Preserves null values.
847
863
*
@@ -854,7 +870,7 @@ public fun <T> Convert<T, URL>.toIFrame(
854
870
*
855
871
* @param width Optional width of the image in pixels.
856
872
* @param height Optional height of the image in pixels.
857
- * @return A new [DataFrame] with the values converted to [IMG].
873
+ * @return A new [DataFrame] with the values converted to an [IMG].
858
874
*/
859
875
@JvmName(" toImgFromUrlNullable" )
860
876
@Refine
@@ -864,7 +880,7 @@ public fun <T, R : URL?> Convert<T, URL?>.toImg(width: Int? = null, height: Int?
864
880
to { it.map { url -> url?.let { IMG (url.toString(), width, height) } } }
865
881
866
882
/* *
867
- * Converts values in the [URL] columns previously selected with [convert] to the [IMG],
883
+ * Converts values in an [URL] columns previously selected with [convert] to an [IMG],
868
884
* preserving their original names and positions within the [DataFrame].
869
885
*
870
886
* For more information: {@include [DocumentationUrls.Convert]}
@@ -876,7 +892,7 @@ public fun <T, R : URL?> Convert<T, URL?>.toImg(width: Int? = null, height: Int?
876
892
*
877
893
* @param width Optional width of the image in pixels.
878
894
* @param height Optional height of the image in pixels.
879
- * @return A new [DataFrame] with the values converted to [IMG].
895
+ * @return A new [DataFrame] with the values converted to an [IMG].
880
896
*/
881
897
@JvmName(" toImgFromUrl" )
882
898
@Refine
@@ -890,22 +906,22 @@ public fun <T, R : URL?> Convert<T, URL>.toImg(width: Int? = null, height: Int?
890
906
// region toURL
891
907
892
908
/* *
893
- * Converts values in this [String] column to [URL].
909
+ * Converts values in this [String] column to an [URL].
894
910
*
895
- * @return A new [DataColumn] with the [URL] values.
911
+ * @return A new [DataColumn] with an [URL] values.
896
912
*/
897
913
public fun DataColumn<String>.convertToURL (): DataColumn <URL > = map { URL (it) }
898
914
899
915
/* *
900
- * Converts values in this [String] column to [URL]. Preserves null values.
916
+ * Converts values in this [String] column to an [URL]. Preserves null values.
901
917
*
902
- * @return A new [DataColumn] with the [URL] nullable values.
918
+ * @return A new [DataColumn] with an [URL] nullable values.
903
919
*/
904
920
@JvmName(" convertToURLFromStringNullable" )
905
921
public fun DataColumn<String?>.convertToURL (): DataColumn <URL ?> = map { it?.let { URL (it) } }
906
922
907
923
/* *
908
- * Converts values in the [String] columns previously selected with [convert] to the [URL],
924
+ * Converts values in the [String] columns previously selected with [convert] to an [URL],
909
925
* preserving their original names and positions within the [DataFrame].
910
926
* Preserves null values.
911
927
*
@@ -916,7 +932,7 @@ public fun DataColumn<String?>.convertToURL(): DataColumn<URL?> = map { it?.let
916
932
* df.convert { webAddress }.toURL()
917
933
* ```
918
934
*
919
- * @return A new [DataFrame] with the values converted to [URL].
935
+ * @return A new [DataFrame] with the values converted to an [URL].
920
936
*/
921
937
@JvmName(" toUrlFromStringNullable" )
922
938
@Refine
@@ -925,7 +941,7 @@ public fun DataColumn<String?>.convertToURL(): DataColumn<URL?> = map { it?.let
925
941
public fun <T > Convert <T , String ?>.toURL (): DataFrame <T > = to { it.convertToURL() }
926
942
927
943
/* *
928
- * Converts values in the [String] columns previously selected with [convert] to the [URL],
944
+ * Converts values in the [String] columns previously selected with [convert] to an [URL],
929
945
* preserving their original names and positions within the [DataFrame].
930
946
*
931
947
* For more information: {@include [DocumentationUrls.Convert]}
@@ -935,7 +951,7 @@ public fun <T> Convert<T, String?>.toURL(): DataFrame<T> = to { it.convertToURL(
935
951
* df.convert { webAddress }.toURL()
936
952
* ```
937
953
*
938
- * @return A new [DataFrame] with the values converted to [URL].
954
+ * @return A new [DataFrame] with the values converted to an [URL].
939
955
*/
940
956
@JvmName(" toUrlFromString" )
941
957
@Refine
0 commit comments